1 // Copyright 2024 Google LLC. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 // Code generated file. DO NOT EDIT. 6 7 // Package retail provides access to the Vertex AI Search for Retail API. 8 // 9 // For product documentation, see: https://cloud.google.com/recommendations 10 // 11 // # Library status 12 // 13 // These client libraries are officially supported by Google. However, this 14 // library is considered complete and is in maintenance mode. This means 15 // that we will address critical bugs and security issues but will not add 16 // any new features. 17 // 18 // When possible, we recommend using our newer 19 // [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) 20 // that are still actively being worked and iterated on. 21 // 22 // # Creating a client 23 // 24 // Usage example: 25 // 26 // import "google.golang.org/api/retail/v2beta" 27 // ... 28 // ctx := context.Background() 29 // retailService, err := retail.NewService(ctx) 30 // 31 // In this example, Google Application Default Credentials are used for 32 // authentication. For information on how to create and obtain Application 33 // Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. 34 // 35 // # Other authentication options 36 // 37 // To use an API key for authentication (note: some APIs do not support API 38 // keys), use [google.golang.org/api/option.WithAPIKey]: 39 // 40 // retailService, err := retail.NewService(ctx, option.WithAPIKey("AIza...")) 41 // 42 // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth 43 // flow, use [google.golang.org/api/option.WithTokenSource]: 44 // 45 // config := &oauth2.Config{...} 46 // // ... 47 // token, err := config.Exchange(ctx, ...) 48 // retailService, err := retail.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 49 // 50 // See [google.golang.org/api/option.ClientOption] for details on options. 51 package retail // import "google.golang.org/api/retail/v2beta" 52 53 import ( 54 "bytes" 55 "context" 56 "encoding/json" 57 "errors" 58 "fmt" 59 "io" 60 "net/http" 61 "net/url" 62 "strconv" 63 "strings" 64 65 googleapi "google.golang.org/api/googleapi" 66 internal "google.golang.org/api/internal" 67 gensupport "google.golang.org/api/internal/gensupport" 68 option "google.golang.org/api/option" 69 internaloption "google.golang.org/api/option/internaloption" 70 htransport "google.golang.org/api/transport/http" 71 ) 72 73 // Always reference these packages, just in case the auto-generated code 74 // below doesn't. 75 var _ = bytes.NewBuffer 76 var _ = strconv.Itoa 77 var _ = fmt.Sprintf 78 var _ = json.NewDecoder 79 var _ = io.Copy 80 var _ = url.Parse 81 var _ = gensupport.MarshalJSON 82 var _ = googleapi.Version 83 var _ = errors.New 84 var _ = strings.Replace 85 var _ = context.Canceled 86 var _ = internaloption.WithDefaultEndpoint 87 var _ = internal.Version 88 89 const apiId = "retail:v2beta" 90 const apiName = "retail" 91 const apiVersion = "v2beta" 92 const basePath = "https://retail.googleapis.com/" 93 const basePathTemplate = "https://retail.UNIVERSE_DOMAIN/" 94 const mtlsBasePath = "https://retail.mtls.googleapis.com/" 95 96 // OAuth2 scopes used by this API. 97 const ( 98 // See, edit, configure, and delete your Google Cloud data and see the email 99 // address for your Google Account. 100 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" 101 ) 102 103 // NewService creates a new Service. 104 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 105 scopesOption := internaloption.WithDefaultScopes( 106 "https://www.googleapis.com/auth/cloud-platform", 107 ) 108 // NOTE: prepend, so we don't override user-specified scopes. 109 opts = append([]option.ClientOption{scopesOption}, opts...) 110 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 111 opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate)) 112 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) 113 opts = append(opts, internaloption.EnableNewAuthLibrary()) 114 client, endpoint, err := htransport.NewClient(ctx, opts...) 115 if err != nil { 116 return nil, err 117 } 118 s, err := New(client) 119 if err != nil { 120 return nil, err 121 } 122 if endpoint != "" { 123 s.BasePath = endpoint 124 } 125 return s, nil 126 } 127 128 // New creates a new Service. It uses the provided http.Client for requests. 129 // 130 // Deprecated: please use NewService instead. 131 // To provide a custom HTTP client, use option.WithHTTPClient. 132 // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 133 func New(client *http.Client) (*Service, error) { 134 if client == nil { 135 return nil, errors.New("client is nil") 136 } 137 s := &Service{client: client, BasePath: basePath} 138 s.Projects = NewProjectsService(s) 139 return s, nil 140 } 141 142 type Service struct { 143 client *http.Client 144 BasePath string // API endpoint base URL 145 UserAgent string // optional additional User-Agent fragment 146 147 Projects *ProjectsService 148 } 149 150 func (s *Service) userAgent() string { 151 if s.UserAgent == "" { 152 return googleapi.UserAgent 153 } 154 return googleapi.UserAgent + " " + s.UserAgent 155 } 156 157 func NewProjectsService(s *Service) *ProjectsService { 158 rs := &ProjectsService{s: s} 159 rs.Locations = NewProjectsLocationsService(s) 160 rs.Operations = NewProjectsOperationsService(s) 161 return rs 162 } 163 164 type ProjectsService struct { 165 s *Service 166 167 Locations *ProjectsLocationsService 168 169 Operations *ProjectsOperationsService 170 } 171 172 func NewProjectsLocationsService(s *Service) *ProjectsLocationsService { 173 rs := &ProjectsLocationsService{s: s} 174 rs.Catalogs = NewProjectsLocationsCatalogsService(s) 175 rs.Operations = NewProjectsLocationsOperationsService(s) 176 return rs 177 } 178 179 type ProjectsLocationsService struct { 180 s *Service 181 182 Catalogs *ProjectsLocationsCatalogsService 183 184 Operations *ProjectsLocationsOperationsService 185 } 186 187 func NewProjectsLocationsCatalogsService(s *Service) *ProjectsLocationsCatalogsService { 188 rs := &ProjectsLocationsCatalogsService{s: s} 189 rs.AttributesConfig = NewProjectsLocationsCatalogsAttributesConfigService(s) 190 rs.Branches = NewProjectsLocationsCatalogsBranchesService(s) 191 rs.CompletionData = NewProjectsLocationsCatalogsCompletionDataService(s) 192 rs.Controls = NewProjectsLocationsCatalogsControlsService(s) 193 rs.Models = NewProjectsLocationsCatalogsModelsService(s) 194 rs.Operations = NewProjectsLocationsCatalogsOperationsService(s) 195 rs.Placements = NewProjectsLocationsCatalogsPlacementsService(s) 196 rs.ServingConfigs = NewProjectsLocationsCatalogsServingConfigsService(s) 197 rs.UserEvents = NewProjectsLocationsCatalogsUserEventsService(s) 198 return rs 199 } 200 201 type ProjectsLocationsCatalogsService struct { 202 s *Service 203 204 AttributesConfig *ProjectsLocationsCatalogsAttributesConfigService 205 206 Branches *ProjectsLocationsCatalogsBranchesService 207 208 CompletionData *ProjectsLocationsCatalogsCompletionDataService 209 210 Controls *ProjectsLocationsCatalogsControlsService 211 212 Models *ProjectsLocationsCatalogsModelsService 213 214 Operations *ProjectsLocationsCatalogsOperationsService 215 216 Placements *ProjectsLocationsCatalogsPlacementsService 217 218 ServingConfigs *ProjectsLocationsCatalogsServingConfigsService 219 220 UserEvents *ProjectsLocationsCatalogsUserEventsService 221 } 222 223 func NewProjectsLocationsCatalogsAttributesConfigService(s *Service) *ProjectsLocationsCatalogsAttributesConfigService { 224 rs := &ProjectsLocationsCatalogsAttributesConfigService{s: s} 225 return rs 226 } 227 228 type ProjectsLocationsCatalogsAttributesConfigService struct { 229 s *Service 230 } 231 232 func NewProjectsLocationsCatalogsBranchesService(s *Service) *ProjectsLocationsCatalogsBranchesService { 233 rs := &ProjectsLocationsCatalogsBranchesService{s: s} 234 rs.Operations = NewProjectsLocationsCatalogsBranchesOperationsService(s) 235 rs.Products = NewProjectsLocationsCatalogsBranchesProductsService(s) 236 return rs 237 } 238 239 type ProjectsLocationsCatalogsBranchesService struct { 240 s *Service 241 242 Operations *ProjectsLocationsCatalogsBranchesOperationsService 243 244 Products *ProjectsLocationsCatalogsBranchesProductsService 245 } 246 247 func NewProjectsLocationsCatalogsBranchesOperationsService(s *Service) *ProjectsLocationsCatalogsBranchesOperationsService { 248 rs := &ProjectsLocationsCatalogsBranchesOperationsService{s: s} 249 return rs 250 } 251 252 type ProjectsLocationsCatalogsBranchesOperationsService struct { 253 s *Service 254 } 255 256 func NewProjectsLocationsCatalogsBranchesProductsService(s *Service) *ProjectsLocationsCatalogsBranchesProductsService { 257 rs := &ProjectsLocationsCatalogsBranchesProductsService{s: s} 258 return rs 259 } 260 261 type ProjectsLocationsCatalogsBranchesProductsService struct { 262 s *Service 263 } 264 265 func NewProjectsLocationsCatalogsCompletionDataService(s *Service) *ProjectsLocationsCatalogsCompletionDataService { 266 rs := &ProjectsLocationsCatalogsCompletionDataService{s: s} 267 return rs 268 } 269 270 type ProjectsLocationsCatalogsCompletionDataService struct { 271 s *Service 272 } 273 274 func NewProjectsLocationsCatalogsControlsService(s *Service) *ProjectsLocationsCatalogsControlsService { 275 rs := &ProjectsLocationsCatalogsControlsService{s: s} 276 return rs 277 } 278 279 type ProjectsLocationsCatalogsControlsService struct { 280 s *Service 281 } 282 283 func NewProjectsLocationsCatalogsModelsService(s *Service) *ProjectsLocationsCatalogsModelsService { 284 rs := &ProjectsLocationsCatalogsModelsService{s: s} 285 return rs 286 } 287 288 type ProjectsLocationsCatalogsModelsService struct { 289 s *Service 290 } 291 292 func NewProjectsLocationsCatalogsOperationsService(s *Service) *ProjectsLocationsCatalogsOperationsService { 293 rs := &ProjectsLocationsCatalogsOperationsService{s: s} 294 return rs 295 } 296 297 type ProjectsLocationsCatalogsOperationsService struct { 298 s *Service 299 } 300 301 func NewProjectsLocationsCatalogsPlacementsService(s *Service) *ProjectsLocationsCatalogsPlacementsService { 302 rs := &ProjectsLocationsCatalogsPlacementsService{s: s} 303 return rs 304 } 305 306 type ProjectsLocationsCatalogsPlacementsService struct { 307 s *Service 308 } 309 310 func NewProjectsLocationsCatalogsServingConfigsService(s *Service) *ProjectsLocationsCatalogsServingConfigsService { 311 rs := &ProjectsLocationsCatalogsServingConfigsService{s: s} 312 return rs 313 } 314 315 type ProjectsLocationsCatalogsServingConfigsService struct { 316 s *Service 317 } 318 319 func NewProjectsLocationsCatalogsUserEventsService(s *Service) *ProjectsLocationsCatalogsUserEventsService { 320 rs := &ProjectsLocationsCatalogsUserEventsService{s: s} 321 return rs 322 } 323 324 type ProjectsLocationsCatalogsUserEventsService struct { 325 s *Service 326 } 327 328 func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService { 329 rs := &ProjectsLocationsOperationsService{s: s} 330 return rs 331 } 332 333 type ProjectsLocationsOperationsService struct { 334 s *Service 335 } 336 337 func NewProjectsOperationsService(s *Service) *ProjectsOperationsService { 338 rs := &ProjectsOperationsService{s: s} 339 return rs 340 } 341 342 type ProjectsOperationsService struct { 343 s *Service 344 } 345 346 // GoogleApiHttpBody: Message that represents an arbitrary HTTP body. It should 347 // only be used for payload formats that can't be represented as JSON, such as 348 // raw binary or an HTML page. This message can be used both in streaming and 349 // non-streaming API methods in the request as well as the response. It can be 350 // used as a top-level request field, which is convenient if one wants to 351 // extract parameters from either the URL or HTTP template into the request 352 // fields and also want access to the raw HTTP body. Example: message 353 // GetResourceRequest { // A unique request id. string request_id = 1; // The 354 // raw HTTP body is bound to this field. google.api.HttpBody http_body = 2; } 355 // service ResourceService { rpc GetResource(GetResourceRequest) returns 356 // (google.api.HttpBody); rpc UpdateResource(google.api.HttpBody) returns 357 // (google.protobuf.Empty); } Example with streaming methods: service 358 // CaldavService { rpc GetCalendar(stream google.api.HttpBody) returns (stream 359 // google.api.HttpBody); rpc UpdateCalendar(stream google.api.HttpBody) returns 360 // (stream google.api.HttpBody); } Use of this type only changes how the 361 // request and response bodies are handled, all other features will continue to 362 // work unchanged. 363 type GoogleApiHttpBody struct { 364 // ContentType: The HTTP Content-Type header value specifying the content type 365 // of the body. 366 ContentType string `json:"contentType,omitempty"` 367 // Data: The HTTP request/response body as raw binary. 368 Data string `json:"data,omitempty"` 369 // Extensions: Application specific response metadata. Must be set in the first 370 // response for streaming APIs. 371 Extensions []googleapi.RawMessage `json:"extensions,omitempty"` 372 373 // ServerResponse contains the HTTP response code and headers from the server. 374 googleapi.ServerResponse `json:"-"` 375 // ForceSendFields is a list of field names (e.g. "ContentType") to 376 // unconditionally include in API requests. By default, fields with empty or 377 // default values are omitted from API requests. See 378 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 379 // details. 380 ForceSendFields []string `json:"-"` 381 // NullFields is a list of field names (e.g. "ContentType") to include in API 382 // requests with the JSON null value. By default, fields with empty values are 383 // omitted from API requests. See 384 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 385 NullFields []string `json:"-"` 386 } 387 388 func (s *GoogleApiHttpBody) MarshalJSON() ([]byte, error) { 389 type NoMethod GoogleApiHttpBody 390 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 391 } 392 393 // GoogleCloudRetailLoggingErrorContext: A description of the context in which 394 // an error occurred. 395 type GoogleCloudRetailLoggingErrorContext struct { 396 // HttpRequest: The HTTP request which was processed when the error was 397 // triggered. 398 HttpRequest *GoogleCloudRetailLoggingHttpRequestContext `json:"httpRequest,omitempty"` 399 // ReportLocation: The location in the source code where the decision was made 400 // to report the error, usually the place where it was logged. 401 ReportLocation *GoogleCloudRetailLoggingSourceLocation `json:"reportLocation,omitempty"` 402 // ForceSendFields is a list of field names (e.g. "HttpRequest") to 403 // unconditionally include in API requests. By default, fields with empty or 404 // default values are omitted from API requests. See 405 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 406 // details. 407 ForceSendFields []string `json:"-"` 408 // NullFields is a list of field names (e.g. "HttpRequest") to include in API 409 // requests with the JSON null value. By default, fields with empty values are 410 // omitted from API requests. See 411 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 412 NullFields []string `json:"-"` 413 } 414 415 func (s *GoogleCloudRetailLoggingErrorContext) MarshalJSON() ([]byte, error) { 416 type NoMethod GoogleCloudRetailLoggingErrorContext 417 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 418 } 419 420 // GoogleCloudRetailLoggingErrorLog: An error log which is reported to the 421 // Error Reporting system. This proto a superset of 422 // google.devtools.clouderrorreporting.v1beta1.ReportedErrorEvent. 423 type GoogleCloudRetailLoggingErrorLog struct { 424 // Context: A description of the context in which the error occurred. 425 Context *GoogleCloudRetailLoggingErrorContext `json:"context,omitempty"` 426 // ImportPayload: The error payload that is populated on LRO import APIs. 427 ImportPayload *GoogleCloudRetailLoggingImportErrorContext `json:"importPayload,omitempty"` 428 // Message: A message describing the error. 429 Message string `json:"message,omitempty"` 430 // RequestPayload: The API request payload, represented as a protocol buffer. 431 // Most API request types are supported. For example: 432 // "type.googleapis.com/google.cloud.retail.v2.ProductService.CreateProductReque 433 // st" 434 // "type.googleapis.com/google.cloud.retail.v2.UserEventService.WriteUserEventRe 435 // quest" 436 RequestPayload googleapi.RawMessage `json:"requestPayload,omitempty"` 437 // ResponsePayload: The API response payload, represented as a protocol buffer. 438 // This is used to log some "soft errors", where the response is valid but we 439 // consider there are some quality issues like unjoined events. The following 440 // API responses are supported and no PII is included: 441 // "google.cloud.retail.v2.PredictionService.Predict" 442 // "google.cloud.retail.v2.UserEventService.WriteUserEvent" 443 // "google.cloud.retail.v2.UserEventService.CollectUserEvent" 444 ResponsePayload googleapi.RawMessage `json:"responsePayload,omitempty"` 445 // ServiceContext: The service context in which this error has occurred. 446 ServiceContext *GoogleCloudRetailLoggingServiceContext `json:"serviceContext,omitempty"` 447 // Status: The RPC status associated with the error log. 448 Status *GoogleRpcStatus `json:"status,omitempty"` 449 // ForceSendFields is a list of field names (e.g. "Context") to unconditionally 450 // include in API requests. By default, fields with empty or default values are 451 // omitted from API requests. See 452 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 453 // details. 454 ForceSendFields []string `json:"-"` 455 // NullFields is a list of field names (e.g. "Context") to include in API 456 // requests with the JSON null value. By default, fields with empty values are 457 // omitted from API requests. See 458 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 459 NullFields []string `json:"-"` 460 } 461 462 func (s *GoogleCloudRetailLoggingErrorLog) MarshalJSON() ([]byte, error) { 463 type NoMethod GoogleCloudRetailLoggingErrorLog 464 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 465 } 466 467 // GoogleCloudRetailLoggingHttpRequestContext: HTTP request data that is 468 // related to a reported error. 469 type GoogleCloudRetailLoggingHttpRequestContext struct { 470 // ResponseStatusCode: The HTTP response status code for the request. 471 ResponseStatusCode int64 `json:"responseStatusCode,omitempty"` 472 // ForceSendFields is a list of field names (e.g. "ResponseStatusCode") to 473 // unconditionally include in API requests. By default, fields with empty or 474 // default values are omitted from API requests. See 475 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 476 // details. 477 ForceSendFields []string `json:"-"` 478 // NullFields is a list of field names (e.g. "ResponseStatusCode") to include 479 // in API requests with the JSON null value. By default, fields with empty 480 // values are omitted from API requests. See 481 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 482 NullFields []string `json:"-"` 483 } 484 485 func (s *GoogleCloudRetailLoggingHttpRequestContext) MarshalJSON() ([]byte, error) { 486 type NoMethod GoogleCloudRetailLoggingHttpRequestContext 487 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 488 } 489 490 // GoogleCloudRetailLoggingImportErrorContext: The error payload that is 491 // populated on LRO import APIs, including 492 // "google.cloud.retail.v2.ProductService.ImportProducts" and 493 // "google.cloud.retail.v2.EventService.ImportUserEvents". 494 type GoogleCloudRetailLoggingImportErrorContext struct { 495 // CatalogItem: The detailed content which caused the error on importing a 496 // catalog item. 497 CatalogItem string `json:"catalogItem,omitempty"` 498 // GcsPath: Cloud Storage file path of the import source. Can be set for batch 499 // operation error. 500 GcsPath string `json:"gcsPath,omitempty"` 501 // LineNumber: Line number of the content in file. Should be empty for 502 // permission or batch operation error. 503 LineNumber string `json:"lineNumber,omitempty"` 504 // OperationName: The operation resource name of the LRO. 505 OperationName string `json:"operationName,omitempty"` 506 // Product: The detailed content which caused the error on importing a product. 507 Product string `json:"product,omitempty"` 508 // UserEvent: The detailed content which caused the error on importing a user 509 // event. 510 UserEvent string `json:"userEvent,omitempty"` 511 // ForceSendFields is a list of field names (e.g. "CatalogItem") to 512 // unconditionally include in API requests. By default, fields with empty or 513 // default values are omitted from API requests. See 514 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 515 // details. 516 ForceSendFields []string `json:"-"` 517 // NullFields is a list of field names (e.g. "CatalogItem") to include in API 518 // requests with the JSON null value. By default, fields with empty values are 519 // omitted from API requests. See 520 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 521 NullFields []string `json:"-"` 522 } 523 524 func (s *GoogleCloudRetailLoggingImportErrorContext) MarshalJSON() ([]byte, error) { 525 type NoMethod GoogleCloudRetailLoggingImportErrorContext 526 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 527 } 528 529 // GoogleCloudRetailLoggingServiceContext: Describes a running service that 530 // sends errors. 531 type GoogleCloudRetailLoggingServiceContext struct { 532 // Service: An identifier of the service. For example, "retail.googleapis.com". 533 Service string `json:"service,omitempty"` 534 // ForceSendFields is a list of field names (e.g. "Service") to unconditionally 535 // include in API requests. By default, fields with empty or default values are 536 // omitted from API requests. See 537 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 538 // details. 539 ForceSendFields []string `json:"-"` 540 // NullFields is a list of field names (e.g. "Service") to include in API 541 // requests with the JSON null value. By default, fields with empty values are 542 // omitted from API requests. See 543 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 544 NullFields []string `json:"-"` 545 } 546 547 func (s *GoogleCloudRetailLoggingServiceContext) MarshalJSON() ([]byte, error) { 548 type NoMethod GoogleCloudRetailLoggingServiceContext 549 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 550 } 551 552 // GoogleCloudRetailLoggingSourceLocation: Indicates a location in the source 553 // code of the service for which errors are reported. 554 type GoogleCloudRetailLoggingSourceLocation struct { 555 // FunctionName: Human-readable name of a function or method. For example, 556 // "google.cloud.retail.v2.UserEventService.ImportUserEvents". 557 FunctionName string `json:"functionName,omitempty"` 558 // ForceSendFields is a list of field names (e.g. "FunctionName") to 559 // unconditionally include in API requests. By default, fields with empty or 560 // default values are omitted from API requests. See 561 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 562 // details. 563 ForceSendFields []string `json:"-"` 564 // NullFields is a list of field names (e.g. "FunctionName") to include in API 565 // requests with the JSON null value. By default, fields with empty values are 566 // omitted from API requests. See 567 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 568 NullFields []string `json:"-"` 569 } 570 571 func (s *GoogleCloudRetailLoggingSourceLocation) MarshalJSON() ([]byte, error) { 572 type NoMethod GoogleCloudRetailLoggingSourceLocation 573 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 574 } 575 576 // GoogleCloudRetailV2AddFulfillmentPlacesMetadata: Metadata related to the 577 // progress of the AddFulfillmentPlaces operation. Currently empty because 578 // there is no meaningful metadata populated from the 579 // ProductService.AddFulfillmentPlaces method. 580 type GoogleCloudRetailV2AddFulfillmentPlacesMetadata struct { 581 } 582 583 // GoogleCloudRetailV2AddFulfillmentPlacesResponse: Response of the 584 // AddFulfillmentPlacesRequest. Currently empty because there is no meaningful 585 // response populated from the ProductService.AddFulfillmentPlaces method. 586 type GoogleCloudRetailV2AddFulfillmentPlacesResponse struct { 587 } 588 589 // GoogleCloudRetailV2AddLocalInventoriesMetadata: Metadata related to the 590 // progress of the AddLocalInventories operation. Currently empty because there 591 // is no meaningful metadata populated from the 592 // ProductService.AddLocalInventories method. 593 type GoogleCloudRetailV2AddLocalInventoriesMetadata struct { 594 } 595 596 // GoogleCloudRetailV2AddLocalInventoriesResponse: Response of the 597 // ProductService.AddLocalInventories API. Currently empty because there is no 598 // meaningful response populated from the ProductService.AddLocalInventories 599 // method. 600 type GoogleCloudRetailV2AddLocalInventoriesResponse struct { 601 } 602 603 // GoogleCloudRetailV2BigQueryOutputResult: A BigQuery output result. 604 type GoogleCloudRetailV2BigQueryOutputResult struct { 605 // DatasetId: The ID of a BigQuery Dataset. 606 DatasetId string `json:"datasetId,omitempty"` 607 // TableId: The ID of a BigQuery Table. 608 TableId string `json:"tableId,omitempty"` 609 // ForceSendFields is a list of field names (e.g. "DatasetId") to 610 // unconditionally include in API requests. By default, fields with empty or 611 // default values are omitted from API requests. See 612 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 613 // details. 614 ForceSendFields []string `json:"-"` 615 // NullFields is a list of field names (e.g. "DatasetId") to include in API 616 // requests with the JSON null value. By default, fields with empty values are 617 // omitted from API requests. See 618 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 619 NullFields []string `json:"-"` 620 } 621 622 func (s *GoogleCloudRetailV2BigQueryOutputResult) MarshalJSON() ([]byte, error) { 623 type NoMethod GoogleCloudRetailV2BigQueryOutputResult 624 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 625 } 626 627 // GoogleCloudRetailV2CreateModelMetadata: Metadata associated with a create 628 // operation. 629 type GoogleCloudRetailV2CreateModelMetadata struct { 630 // Model: The resource name of the model that this create applies to. Format: 631 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/mode 632 // ls/{model_id}` 633 Model string `json:"model,omitempty"` 634 // ForceSendFields is a list of field names (e.g. "Model") to unconditionally 635 // include in API requests. By default, fields with empty or default values are 636 // omitted from API requests. See 637 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 638 // details. 639 ForceSendFields []string `json:"-"` 640 // NullFields is a list of field names (e.g. "Model") to include in API 641 // requests with the JSON null value. By default, fields with empty values are 642 // omitted from API requests. See 643 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 644 NullFields []string `json:"-"` 645 } 646 647 func (s *GoogleCloudRetailV2CreateModelMetadata) MarshalJSON() ([]byte, error) { 648 type NoMethod GoogleCloudRetailV2CreateModelMetadata 649 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 650 } 651 652 // GoogleCloudRetailV2ExportAnalyticsMetricsResponse: Response of the 653 // ExportAnalyticsMetricsRequest. If the long running operation was successful, 654 // then this message is returned by the google.longrunning.Operations.response 655 // field if the operation was successful. 656 type GoogleCloudRetailV2ExportAnalyticsMetricsResponse struct { 657 // ErrorSamples: A sample of errors encountered while processing the request. 658 ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` 659 // ErrorsConfig: This field is never set. 660 ErrorsConfig *GoogleCloudRetailV2ExportErrorsConfig `json:"errorsConfig,omitempty"` 661 // OutputResult: Output result indicating where the data were exported to. 662 OutputResult *GoogleCloudRetailV2OutputResult `json:"outputResult,omitempty"` 663 // ForceSendFields is a list of field names (e.g. "ErrorSamples") to 664 // unconditionally include in API requests. By default, fields with empty or 665 // default values are omitted from API requests. See 666 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 667 // details. 668 ForceSendFields []string `json:"-"` 669 // NullFields is a list of field names (e.g. "ErrorSamples") to include in API 670 // requests with the JSON null value. By default, fields with empty values are 671 // omitted from API requests. See 672 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 673 NullFields []string `json:"-"` 674 } 675 676 func (s *GoogleCloudRetailV2ExportAnalyticsMetricsResponse) MarshalJSON() ([]byte, error) { 677 type NoMethod GoogleCloudRetailV2ExportAnalyticsMetricsResponse 678 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 679 } 680 681 // GoogleCloudRetailV2ExportErrorsConfig: Configuration of destination for 682 // Export related errors. 683 type GoogleCloudRetailV2ExportErrorsConfig struct { 684 // GcsPrefix: Google Cloud Storage path for import errors. This must be an 685 // empty, existing Cloud Storage bucket. Export errors will be written to a 686 // file in this bucket, one per line, as a JSON-encoded `google.rpc.Status` 687 // message. 688 GcsPrefix string `json:"gcsPrefix,omitempty"` 689 // ForceSendFields is a list of field names (e.g. "GcsPrefix") to 690 // unconditionally include in API requests. By default, fields with empty or 691 // default values are omitted from API requests. See 692 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 693 // details. 694 ForceSendFields []string `json:"-"` 695 // NullFields is a list of field names (e.g. "GcsPrefix") to include in API 696 // requests with the JSON null value. By default, fields with empty values are 697 // omitted from API requests. See 698 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 699 NullFields []string `json:"-"` 700 } 701 702 func (s *GoogleCloudRetailV2ExportErrorsConfig) MarshalJSON() ([]byte, error) { 703 type NoMethod GoogleCloudRetailV2ExportErrorsConfig 704 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 705 } 706 707 // GoogleCloudRetailV2ExportMetadata: Metadata related to the progress of the 708 // Export operation. This is returned by the 709 // google.longrunning.Operation.metadata field. 710 type GoogleCloudRetailV2ExportMetadata struct { 711 // CreateTime: Operation create time. 712 CreateTime string `json:"createTime,omitempty"` 713 // UpdateTime: Operation last update time. If the operation is done, this is 714 // also the finish time. 715 UpdateTime string `json:"updateTime,omitempty"` 716 // ForceSendFields is a list of field names (e.g. "CreateTime") to 717 // unconditionally include in API requests. By default, fields with empty or 718 // default values are omitted from API requests. See 719 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 720 // details. 721 ForceSendFields []string `json:"-"` 722 // NullFields is a list of field names (e.g. "CreateTime") to include in API 723 // requests with the JSON null value. By default, fields with empty values are 724 // omitted from API requests. See 725 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 726 NullFields []string `json:"-"` 727 } 728 729 func (s *GoogleCloudRetailV2ExportMetadata) MarshalJSON() ([]byte, error) { 730 type NoMethod GoogleCloudRetailV2ExportMetadata 731 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 732 } 733 734 // GoogleCloudRetailV2GcsOutputResult: A Gcs output result. 735 type GoogleCloudRetailV2GcsOutputResult struct { 736 // OutputUri: The uri of Gcs output 737 OutputUri string `json:"outputUri,omitempty"` 738 // ForceSendFields is a list of field names (e.g. "OutputUri") to 739 // unconditionally include in API requests. By default, fields with empty or 740 // default values are omitted from API requests. See 741 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 742 // details. 743 ForceSendFields []string `json:"-"` 744 // NullFields is a list of field names (e.g. "OutputUri") to include in API 745 // requests with the JSON null value. By default, fields with empty values are 746 // omitted from API requests. See 747 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 748 NullFields []string `json:"-"` 749 } 750 751 func (s *GoogleCloudRetailV2GcsOutputResult) MarshalJSON() ([]byte, error) { 752 type NoMethod GoogleCloudRetailV2GcsOutputResult 753 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 754 } 755 756 // GoogleCloudRetailV2ImportCompletionDataResponse: Response of the 757 // ImportCompletionDataRequest. If the long running operation is done, this 758 // message is returned by the google.longrunning.Operations.response field if 759 // the operation is successful. 760 type GoogleCloudRetailV2ImportCompletionDataResponse struct { 761 // ErrorSamples: A sample of errors encountered while processing the request. 762 ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` 763 // ForceSendFields is a list of field names (e.g. "ErrorSamples") to 764 // unconditionally include in API requests. By default, fields with empty or 765 // default values are omitted from API requests. See 766 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 767 // details. 768 ForceSendFields []string `json:"-"` 769 // NullFields is a list of field names (e.g. "ErrorSamples") to include in API 770 // requests with the JSON null value. By default, fields with empty values are 771 // omitted from API requests. See 772 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 773 NullFields []string `json:"-"` 774 } 775 776 func (s *GoogleCloudRetailV2ImportCompletionDataResponse) MarshalJSON() ([]byte, error) { 777 type NoMethod GoogleCloudRetailV2ImportCompletionDataResponse 778 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 779 } 780 781 // GoogleCloudRetailV2ImportErrorsConfig: Configuration of destination for 782 // Import related errors. 783 type GoogleCloudRetailV2ImportErrorsConfig struct { 784 // GcsPrefix: Google Cloud Storage prefix for import errors. This must be an 785 // empty, existing Cloud Storage directory. Import errors are written to 786 // sharded files in this directory, one per line, as a JSON-encoded 787 // `google.rpc.Status` message. 788 GcsPrefix string `json:"gcsPrefix,omitempty"` 789 // ForceSendFields is a list of field names (e.g. "GcsPrefix") to 790 // unconditionally include in API requests. By default, fields with empty or 791 // default values are omitted from API requests. See 792 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 793 // details. 794 ForceSendFields []string `json:"-"` 795 // NullFields is a list of field names (e.g. "GcsPrefix") to include in API 796 // requests with the JSON null value. By default, fields with empty values are 797 // omitted from API requests. See 798 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 799 NullFields []string `json:"-"` 800 } 801 802 func (s *GoogleCloudRetailV2ImportErrorsConfig) MarshalJSON() ([]byte, error) { 803 type NoMethod GoogleCloudRetailV2ImportErrorsConfig 804 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 805 } 806 807 // GoogleCloudRetailV2ImportMetadata: Metadata related to the progress of the 808 // Import operation. This is returned by the 809 // google.longrunning.Operation.metadata field. 810 type GoogleCloudRetailV2ImportMetadata struct { 811 // CreateTime: Operation create time. 812 CreateTime string `json:"createTime,omitempty"` 813 // FailureCount: Count of entries that encountered errors while processing. 814 FailureCount int64 `json:"failureCount,omitempty,string"` 815 // NotificationPubsubTopic: Pub/Sub topic for receiving notification. If this 816 // field is set, when the import is finished, a notification is sent to 817 // specified Pub/Sub topic. The message data is JSON string of a Operation. 818 // Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. 819 NotificationPubsubTopic string `json:"notificationPubsubTopic,omitempty"` 820 // RequestId: Deprecated. This field is never set. 821 RequestId string `json:"requestId,omitempty"` 822 // SuccessCount: Count of entries that were processed successfully. 823 SuccessCount int64 `json:"successCount,omitempty,string"` 824 // UpdateTime: Operation last update time. If the operation is done, this is 825 // also the finish time. 826 UpdateTime string `json:"updateTime,omitempty"` 827 // ForceSendFields is a list of field names (e.g. "CreateTime") to 828 // unconditionally include in API requests. By default, fields with empty or 829 // default values are omitted from API requests. See 830 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 831 // details. 832 ForceSendFields []string `json:"-"` 833 // NullFields is a list of field names (e.g. "CreateTime") to include in API 834 // requests with the JSON null value. By default, fields with empty values are 835 // omitted from API requests. See 836 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 837 NullFields []string `json:"-"` 838 } 839 840 func (s *GoogleCloudRetailV2ImportMetadata) MarshalJSON() ([]byte, error) { 841 type NoMethod GoogleCloudRetailV2ImportMetadata 842 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 843 } 844 845 // GoogleCloudRetailV2ImportProductsResponse: Response of the 846 // ImportProductsRequest. If the long running operation is done, then this 847 // message is returned by the google.longrunning.Operations.response field if 848 // the operation was successful. 849 type GoogleCloudRetailV2ImportProductsResponse struct { 850 // ErrorSamples: A sample of errors encountered while processing the request. 851 ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` 852 // ErrorsConfig: Echoes the destination for the complete errors in the request 853 // if set. 854 ErrorsConfig *GoogleCloudRetailV2ImportErrorsConfig `json:"errorsConfig,omitempty"` 855 // ForceSendFields is a list of field names (e.g. "ErrorSamples") to 856 // unconditionally include in API requests. By default, fields with empty or 857 // default values are omitted from API requests. See 858 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 859 // details. 860 ForceSendFields []string `json:"-"` 861 // NullFields is a list of field names (e.g. "ErrorSamples") to include in API 862 // requests with the JSON null value. By default, fields with empty values are 863 // omitted from API requests. See 864 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 865 NullFields []string `json:"-"` 866 } 867 868 func (s *GoogleCloudRetailV2ImportProductsResponse) MarshalJSON() ([]byte, error) { 869 type NoMethod GoogleCloudRetailV2ImportProductsResponse 870 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 871 } 872 873 // GoogleCloudRetailV2ImportUserEventsResponse: Response of the 874 // ImportUserEventsRequest. If the long running operation was successful, then 875 // this message is returned by the google.longrunning.Operations.response field 876 // if the operation was successful. 877 type GoogleCloudRetailV2ImportUserEventsResponse struct { 878 // ErrorSamples: A sample of errors encountered while processing the request. 879 ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` 880 // ErrorsConfig: Echoes the destination for the complete errors if this field 881 // was set in the request. 882 ErrorsConfig *GoogleCloudRetailV2ImportErrorsConfig `json:"errorsConfig,omitempty"` 883 // ImportSummary: Aggregated statistics of user event import status. 884 ImportSummary *GoogleCloudRetailV2UserEventImportSummary `json:"importSummary,omitempty"` 885 // ForceSendFields is a list of field names (e.g. "ErrorSamples") to 886 // unconditionally include in API requests. By default, fields with empty or 887 // default values are omitted from API requests. See 888 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 889 // details. 890 ForceSendFields []string `json:"-"` 891 // NullFields is a list of field names (e.g. "ErrorSamples") to include in API 892 // requests with the JSON null value. By default, fields with empty values are 893 // omitted from API requests. See 894 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 895 NullFields []string `json:"-"` 896 } 897 898 func (s *GoogleCloudRetailV2ImportUserEventsResponse) MarshalJSON() ([]byte, error) { 899 type NoMethod GoogleCloudRetailV2ImportUserEventsResponse 900 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 901 } 902 903 // GoogleCloudRetailV2Model: Metadata that describes the training and serving 904 // parameters of a Model. A Model can be associated with a ServingConfig and 905 // then queried through the Predict API. 906 type GoogleCloudRetailV2Model struct { 907 // CreateTime: Output only. Timestamp the Recommendation Model was created at. 908 CreateTime string `json:"createTime,omitempty"` 909 // DataState: Output only. The state of data requirements for this model: 910 // `DATA_OK` and `DATA_ERROR`. Recommendation model cannot be trained if the 911 // data is in `DATA_ERROR` state. Recommendation model can have `DATA_ERROR` 912 // state even if serving state is `ACTIVE`: models were trained successfully 913 // before, but cannot be refreshed because model no longer has sufficient data 914 // for training. 915 // 916 // Possible values: 917 // "DATA_STATE_UNSPECIFIED" - Unspecified default value, should never be 918 // explicitly set. 919 // "DATA_OK" - The model has sufficient training data. 920 // "DATA_ERROR" - The model does not have sufficient training data. Error 921 // messages can be queried via Stackdriver. 922 DataState string `json:"dataState,omitempty"` 923 // DisplayName: Required. The display name of the model. Should be human 924 // readable, used to display Recommendation Models in the Retail Cloud Console 925 // Dashboard. UTF-8 encoded string with limit of 1024 characters. 926 DisplayName string `json:"displayName,omitempty"` 927 // FilteringOption: Optional. If `RECOMMENDATIONS_FILTERING_ENABLED`, 928 // recommendation filtering by attributes is enabled for the model. 929 // 930 // Possible values: 931 // "RECOMMENDATIONS_FILTERING_OPTION_UNSPECIFIED" - Value used when unset. In 932 // this case, server behavior defaults to RECOMMENDATIONS_FILTERING_DISABLED. 933 // "RECOMMENDATIONS_FILTERING_DISABLED" - Recommendation filtering is 934 // disabled. 935 // "RECOMMENDATIONS_FILTERING_ENABLED" - Recommendation filtering is enabled. 936 FilteringOption string `json:"filteringOption,omitempty"` 937 // LastTuneTime: Output only. The timestamp when the latest successful tune 938 // finished. 939 LastTuneTime string `json:"lastTuneTime,omitempty"` 940 // ModelFeaturesConfig: Optional. Additional model features config. 941 ModelFeaturesConfig *GoogleCloudRetailV2ModelModelFeaturesConfig `json:"modelFeaturesConfig,omitempty"` 942 // Name: Required. The fully qualified resource name of the model. Format: 943 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/mode 944 // ls/{model_id}` catalog_id has char limit of 50. recommendation_model_id has 945 // char limit of 40. 946 Name string `json:"name,omitempty"` 947 // OptimizationObjective: Optional. The optimization objective e.g. `cvr`. 948 // Currently supported values: `ctr`, `cvr`, `revenue-per-order`. If not 949 // specified, we choose default based on model type. Default depends on type of 950 // recommendation: `recommended-for-you` => `ctr` `others-you-may-like` => 951 // `ctr` `frequently-bought-together` => `revenue_per_order` This field 952 // together with optimization_objective describe model metadata to use to 953 // control model training and serving. See 954 // https://cloud.google.com/retail/docs/models for more details on what the 955 // model metadata control and which combination of parameters are valid. For 956 // invalid combinations of parameters (e.g. type = `frequently-bought-together` 957 // and optimization_objective = `ctr`), you receive an error 400 if you try to 958 // create/update a recommendation with this set of knobs. 959 OptimizationObjective string `json:"optimizationObjective,omitempty"` 960 // PeriodicTuningState: Optional. The state of periodic tuning. The period we 961 // use is 3 months - to do a one-off tune earlier use the `TuneModel` method. 962 // Default value is `PERIODIC_TUNING_ENABLED`. 963 // 964 // Possible values: 965 // "PERIODIC_TUNING_STATE_UNSPECIFIED" - Unspecified default value, should 966 // never be explicitly set. 967 // "PERIODIC_TUNING_DISABLED" - The model has periodic tuning disabled. 968 // Tuning can be reenabled by calling the `EnableModelPeriodicTuning` method or 969 // by calling the `TuneModel` method. 970 // "ALL_TUNING_DISABLED" - The model cannot be tuned with periodic tuning OR 971 // the `TuneModel` method. Hide the options in customer UI and reject any 972 // requests through the backend self serve API. 973 // "PERIODIC_TUNING_ENABLED" - The model has periodic tuning enabled. Tuning 974 // can be disabled by calling the `DisableModelPeriodicTuning` method. 975 PeriodicTuningState string `json:"periodicTuningState,omitempty"` 976 // ServingConfigLists: Output only. The list of valid serving configs 977 // associated with the PageOptimizationConfig. 978 ServingConfigLists []*GoogleCloudRetailV2ModelServingConfigList `json:"servingConfigLists,omitempty"` 979 // ServingState: Output only. The serving state of the model: `ACTIVE`, 980 // `NOT_ACTIVE`. 981 // 982 // Possible values: 983 // "SERVING_STATE_UNSPECIFIED" - Unspecified serving state. 984 // "INACTIVE" - The model is not serving. 985 // "ACTIVE" - The model is serving and can be queried. 986 // "TUNED" - The model is trained on tuned hyperparameters and can be 987 // queried. 988 ServingState string `json:"servingState,omitempty"` 989 // TrainingState: Optional. The training state that the model is in (e.g. 990 // `TRAINING` or `PAUSED`). Since part of the cost of running the service is 991 // frequency of training - this can be used to determine when to train model in 992 // order to control cost. If not specified: the default value for `CreateModel` 993 // method is `TRAINING`. The default value for `UpdateModel` method is to keep 994 // the state the same as before. 995 // 996 // Possible values: 997 // "TRAINING_STATE_UNSPECIFIED" - Unspecified training state. 998 // "PAUSED" - The model training is paused. 999 // "TRAINING" - The model is training. 1000 TrainingState string `json:"trainingState,omitempty"` 1001 // TuningOperation: Output only. The tune operation associated with the model. 1002 // Can be used to determine if there is an ongoing tune for this 1003 // recommendation. Empty field implies no tune is goig on. 1004 TuningOperation string `json:"tuningOperation,omitempty"` 1005 // Type: Required. The type of model e.g. `home-page`. Currently supported 1006 // values: `recommended-for-you`, `others-you-may-like`, 1007 // `frequently-bought-together`, `page-optimization`, `similar-items`, 1008 // `buy-it-again`, `on-sale-items`, and `recently-viewed`(readonly value). This 1009 // field together with optimization_objective describe model metadata to use to 1010 // control model training and serving. See 1011 // https://cloud.google.com/retail/docs/models for more details on what the 1012 // model metadata control and which combination of parameters are valid. For 1013 // invalid combinations of parameters (e.g. type = `frequently-bought-together` 1014 // and optimization_objective = `ctr`), you receive an error 400 if you try to 1015 // create/update a recommendation with this set of knobs. 1016 Type string `json:"type,omitempty"` 1017 // UpdateTime: Output only. Timestamp the Recommendation Model was last 1018 // updated. E.g. if a Recommendation Model was paused - this would be the time 1019 // the pause was initiated. 1020 UpdateTime string `json:"updateTime,omitempty"` 1021 // ForceSendFields is a list of field names (e.g. "CreateTime") to 1022 // unconditionally include in API requests. By default, fields with empty or 1023 // default values are omitted from API requests. See 1024 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1025 // details. 1026 ForceSendFields []string `json:"-"` 1027 // NullFields is a list of field names (e.g. "CreateTime") to include in API 1028 // requests with the JSON null value. By default, fields with empty values are 1029 // omitted from API requests. See 1030 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1031 NullFields []string `json:"-"` 1032 } 1033 1034 func (s *GoogleCloudRetailV2Model) MarshalJSON() ([]byte, error) { 1035 type NoMethod GoogleCloudRetailV2Model 1036 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1037 } 1038 1039 // GoogleCloudRetailV2ModelFrequentlyBoughtTogetherFeaturesConfig: Additional 1040 // configs for the frequently-bought-together model type. 1041 type GoogleCloudRetailV2ModelFrequentlyBoughtTogetherFeaturesConfig struct { 1042 // ContextProductsType: Optional. Specifies the context of the model when it is 1043 // used in predict requests. Can only be set for the 1044 // `frequently-bought-together` type. If it isn't specified, it defaults to 1045 // MULTIPLE_CONTEXT_PRODUCTS. 1046 // 1047 // Possible values: 1048 // "CONTEXT_PRODUCTS_TYPE_UNSPECIFIED" - Unspecified default value, should 1049 // never be explicitly set. Defaults to MULTIPLE_CONTEXT_PRODUCTS. 1050 // "SINGLE_CONTEXT_PRODUCT" - Use only a single product as context for the 1051 // recommendation. Typically used on pages like add-to-cart or product details. 1052 // "MULTIPLE_CONTEXT_PRODUCTS" - Use one or multiple products as context for 1053 // the recommendation. Typically used on shopping cart pages. 1054 ContextProductsType string `json:"contextProductsType,omitempty"` 1055 // ForceSendFields is a list of field names (e.g. "ContextProductsType") to 1056 // unconditionally include in API requests. By default, fields with empty or 1057 // default values are omitted from API requests. See 1058 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1059 // details. 1060 ForceSendFields []string `json:"-"` 1061 // NullFields is a list of field names (e.g. "ContextProductsType") to include 1062 // in API requests with the JSON null value. By default, fields with empty 1063 // values are omitted from API requests. See 1064 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1065 NullFields []string `json:"-"` 1066 } 1067 1068 func (s *GoogleCloudRetailV2ModelFrequentlyBoughtTogetherFeaturesConfig) MarshalJSON() ([]byte, error) { 1069 type NoMethod GoogleCloudRetailV2ModelFrequentlyBoughtTogetherFeaturesConfig 1070 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1071 } 1072 1073 // GoogleCloudRetailV2ModelModelFeaturesConfig: Additional model features 1074 // config. 1075 type GoogleCloudRetailV2ModelModelFeaturesConfig struct { 1076 // FrequentlyBoughtTogetherConfig: Additional configs for 1077 // frequently-bought-together models. 1078 FrequentlyBoughtTogetherConfig *GoogleCloudRetailV2ModelFrequentlyBoughtTogetherFeaturesConfig `json:"frequentlyBoughtTogetherConfig,omitempty"` 1079 // ForceSendFields is a list of field names (e.g. 1080 // "FrequentlyBoughtTogetherConfig") to unconditionally include in API 1081 // requests. By default, fields with empty or default values are omitted from 1082 // API requests. See 1083 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1084 // details. 1085 ForceSendFields []string `json:"-"` 1086 // NullFields is a list of field names (e.g. "FrequentlyBoughtTogetherConfig") 1087 // to include in API requests with the JSON null value. By default, fields with 1088 // empty values are omitted from API requests. See 1089 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1090 NullFields []string `json:"-"` 1091 } 1092 1093 func (s *GoogleCloudRetailV2ModelModelFeaturesConfig) MarshalJSON() ([]byte, error) { 1094 type NoMethod GoogleCloudRetailV2ModelModelFeaturesConfig 1095 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1096 } 1097 1098 // GoogleCloudRetailV2ModelServingConfigList: Represents an ordered combination 1099 // of valid serving configs, which can be used for `PAGE_OPTIMIZATION` 1100 // recommendations. 1101 type GoogleCloudRetailV2ModelServingConfigList struct { 1102 // ServingConfigIds: Optional. A set of valid serving configs that may be used 1103 // for `PAGE_OPTIMIZATION`. 1104 ServingConfigIds []string `json:"servingConfigIds,omitempty"` 1105 // ForceSendFields is a list of field names (e.g. "ServingConfigIds") to 1106 // unconditionally include in API requests. By default, fields with empty or 1107 // default values are omitted from API requests. See 1108 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1109 // details. 1110 ForceSendFields []string `json:"-"` 1111 // NullFields is a list of field names (e.g. "ServingConfigIds") to include in 1112 // API requests with the JSON null value. By default, fields with empty values 1113 // are omitted from API requests. See 1114 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1115 NullFields []string `json:"-"` 1116 } 1117 1118 func (s *GoogleCloudRetailV2ModelServingConfigList) MarshalJSON() ([]byte, error) { 1119 type NoMethod GoogleCloudRetailV2ModelServingConfigList 1120 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1121 } 1122 1123 // GoogleCloudRetailV2OutputResult: Output result that stores the information 1124 // about where the exported data is stored. 1125 type GoogleCloudRetailV2OutputResult struct { 1126 // BigqueryResult: The BigQuery location where the result is stored. 1127 BigqueryResult []*GoogleCloudRetailV2BigQueryOutputResult `json:"bigqueryResult,omitempty"` 1128 // GcsResult: The Google Cloud Storage location where the result is stored. 1129 GcsResult []*GoogleCloudRetailV2GcsOutputResult `json:"gcsResult,omitempty"` 1130 // ForceSendFields is a list of field names (e.g. "BigqueryResult") to 1131 // unconditionally include in API requests. By default, fields with empty or 1132 // default values are omitted from API requests. See 1133 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1134 // details. 1135 ForceSendFields []string `json:"-"` 1136 // NullFields is a list of field names (e.g. "BigqueryResult") to include in 1137 // API requests with the JSON null value. By default, fields with empty values 1138 // are omitted from API requests. See 1139 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1140 NullFields []string `json:"-"` 1141 } 1142 1143 func (s *GoogleCloudRetailV2OutputResult) MarshalJSON() ([]byte, error) { 1144 type NoMethod GoogleCloudRetailV2OutputResult 1145 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1146 } 1147 1148 // GoogleCloudRetailV2PurgeMetadata: Metadata related to the progress of the 1149 // Purge operation. This will be returned by the 1150 // google.longrunning.Operation.metadata field. 1151 type GoogleCloudRetailV2PurgeMetadata struct { 1152 } 1153 1154 // GoogleCloudRetailV2PurgeProductsMetadata: Metadata related to the progress 1155 // of the PurgeProducts operation. This will be returned by the 1156 // google.longrunning.Operation.metadata field. 1157 type GoogleCloudRetailV2PurgeProductsMetadata struct { 1158 // CreateTime: Operation create time. 1159 CreateTime string `json:"createTime,omitempty"` 1160 // FailureCount: Count of entries that encountered errors while processing. 1161 FailureCount int64 `json:"failureCount,omitempty,string"` 1162 // SuccessCount: Count of entries that were deleted successfully. 1163 SuccessCount int64 `json:"successCount,omitempty,string"` 1164 // UpdateTime: Operation last update time. If the operation is done, this is 1165 // also the finish time. 1166 UpdateTime string `json:"updateTime,omitempty"` 1167 // ForceSendFields is a list of field names (e.g. "CreateTime") to 1168 // unconditionally include in API requests. By default, fields with empty or 1169 // default values are omitted from API requests. See 1170 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1171 // details. 1172 ForceSendFields []string `json:"-"` 1173 // NullFields is a list of field names (e.g. "CreateTime") to include in API 1174 // requests with the JSON null value. By default, fields with empty values are 1175 // omitted from API requests. See 1176 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1177 NullFields []string `json:"-"` 1178 } 1179 1180 func (s *GoogleCloudRetailV2PurgeProductsMetadata) MarshalJSON() ([]byte, error) { 1181 type NoMethod GoogleCloudRetailV2PurgeProductsMetadata 1182 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1183 } 1184 1185 // GoogleCloudRetailV2PurgeProductsResponse: Response of the 1186 // PurgeProductsRequest. If the long running operation is successfully done, 1187 // then this message is returned by the google.longrunning.Operations.response 1188 // field. 1189 type GoogleCloudRetailV2PurgeProductsResponse struct { 1190 // PurgeCount: The total count of products purged as a result of the operation. 1191 PurgeCount int64 `json:"purgeCount,omitempty,string"` 1192 // PurgeSample: A sample of the product names that will be deleted. Only 1193 // populated if `force` is set to false. A max of 100 names will be returned 1194 // and the names are chosen at random. 1195 PurgeSample []string `json:"purgeSample,omitempty"` 1196 // ForceSendFields is a list of field names (e.g. "PurgeCount") to 1197 // unconditionally include in API requests. By default, fields with empty or 1198 // default values are omitted from API requests. See 1199 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1200 // details. 1201 ForceSendFields []string `json:"-"` 1202 // NullFields is a list of field names (e.g. "PurgeCount") to include in API 1203 // requests with the JSON null value. By default, fields with empty values are 1204 // omitted from API requests. See 1205 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1206 NullFields []string `json:"-"` 1207 } 1208 1209 func (s *GoogleCloudRetailV2PurgeProductsResponse) MarshalJSON() ([]byte, error) { 1210 type NoMethod GoogleCloudRetailV2PurgeProductsResponse 1211 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1212 } 1213 1214 // GoogleCloudRetailV2PurgeUserEventsResponse: Response of the 1215 // PurgeUserEventsRequest. If the long running operation is successfully done, 1216 // then this message is returned by the google.longrunning.Operations.response 1217 // field. 1218 type GoogleCloudRetailV2PurgeUserEventsResponse struct { 1219 // PurgedEventsCount: The total count of events purged as a result of the 1220 // operation. 1221 PurgedEventsCount int64 `json:"purgedEventsCount,omitempty,string"` 1222 // ForceSendFields is a list of field names (e.g. "PurgedEventsCount") to 1223 // unconditionally include in API requests. By default, fields with empty or 1224 // default values are omitted from API requests. See 1225 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1226 // details. 1227 ForceSendFields []string `json:"-"` 1228 // NullFields is a list of field names (e.g. "PurgedEventsCount") to include in 1229 // API requests with the JSON null value. By default, fields with empty values 1230 // are omitted from API requests. See 1231 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1232 NullFields []string `json:"-"` 1233 } 1234 1235 func (s *GoogleCloudRetailV2PurgeUserEventsResponse) MarshalJSON() ([]byte, error) { 1236 type NoMethod GoogleCloudRetailV2PurgeUserEventsResponse 1237 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1238 } 1239 1240 // GoogleCloudRetailV2RejoinUserEventsMetadata: Metadata for `RejoinUserEvents` 1241 // method. 1242 type GoogleCloudRetailV2RejoinUserEventsMetadata struct { 1243 } 1244 1245 // GoogleCloudRetailV2RejoinUserEventsResponse: Response message for 1246 // `RejoinUserEvents` method. 1247 type GoogleCloudRetailV2RejoinUserEventsResponse struct { 1248 // RejoinedUserEventsCount: Number of user events that were joined with latest 1249 // product catalog. 1250 RejoinedUserEventsCount int64 `json:"rejoinedUserEventsCount,omitempty,string"` 1251 // ForceSendFields is a list of field names (e.g. "RejoinedUserEventsCount") to 1252 // unconditionally include in API requests. By default, fields with empty or 1253 // default values are omitted from API requests. See 1254 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1255 // details. 1256 ForceSendFields []string `json:"-"` 1257 // NullFields is a list of field names (e.g. "RejoinedUserEventsCount") to 1258 // include in API requests with the JSON null value. By default, fields with 1259 // empty values are omitted from API requests. See 1260 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1261 NullFields []string `json:"-"` 1262 } 1263 1264 func (s *GoogleCloudRetailV2RejoinUserEventsResponse) MarshalJSON() ([]byte, error) { 1265 type NoMethod GoogleCloudRetailV2RejoinUserEventsResponse 1266 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1267 } 1268 1269 // GoogleCloudRetailV2RemoveFulfillmentPlacesMetadata: Metadata related to the 1270 // progress of the RemoveFulfillmentPlaces operation. Currently empty because 1271 // there is no meaningful metadata populated from the 1272 // ProductService.RemoveFulfillmentPlaces method. 1273 type GoogleCloudRetailV2RemoveFulfillmentPlacesMetadata struct { 1274 } 1275 1276 // GoogleCloudRetailV2RemoveFulfillmentPlacesResponse: Response of the 1277 // RemoveFulfillmentPlacesRequest. Currently empty because there is no 1278 // meaningful response populated from the 1279 // ProductService.RemoveFulfillmentPlaces method. 1280 type GoogleCloudRetailV2RemoveFulfillmentPlacesResponse struct { 1281 } 1282 1283 // GoogleCloudRetailV2RemoveLocalInventoriesMetadata: Metadata related to the 1284 // progress of the RemoveLocalInventories operation. Currently empty because 1285 // there is no meaningful metadata populated from the 1286 // ProductService.RemoveLocalInventories method. 1287 type GoogleCloudRetailV2RemoveLocalInventoriesMetadata struct { 1288 } 1289 1290 // GoogleCloudRetailV2RemoveLocalInventoriesResponse: Response of the 1291 // ProductService.RemoveLocalInventories API. Currently empty because there is 1292 // no meaningful response populated from the 1293 // ProductService.RemoveLocalInventories method. 1294 type GoogleCloudRetailV2RemoveLocalInventoriesResponse struct { 1295 } 1296 1297 // GoogleCloudRetailV2SetInventoryMetadata: Metadata related to the progress of 1298 // the SetInventory operation. Currently empty because there is no meaningful 1299 // metadata populated from the ProductService.SetInventory method. 1300 type GoogleCloudRetailV2SetInventoryMetadata struct { 1301 } 1302 1303 // GoogleCloudRetailV2SetInventoryResponse: Response of the 1304 // SetInventoryRequest. Currently empty because there is no meaningful response 1305 // populated from the ProductService.SetInventory method. 1306 type GoogleCloudRetailV2SetInventoryResponse struct { 1307 } 1308 1309 // GoogleCloudRetailV2TuneModelMetadata: Metadata associated with a tune 1310 // operation. 1311 type GoogleCloudRetailV2TuneModelMetadata struct { 1312 // Model: The resource name of the model that this tune applies to. Format: 1313 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/mode 1314 // ls/{model_id}` 1315 Model string `json:"model,omitempty"` 1316 // ForceSendFields is a list of field names (e.g. "Model") to unconditionally 1317 // include in API requests. By default, fields with empty or default values are 1318 // omitted from API requests. See 1319 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1320 // details. 1321 ForceSendFields []string `json:"-"` 1322 // NullFields is a list of field names (e.g. "Model") to include in API 1323 // requests with the JSON null value. By default, fields with empty values are 1324 // omitted from API requests. See 1325 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1326 NullFields []string `json:"-"` 1327 } 1328 1329 func (s *GoogleCloudRetailV2TuneModelMetadata) MarshalJSON() ([]byte, error) { 1330 type NoMethod GoogleCloudRetailV2TuneModelMetadata 1331 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1332 } 1333 1334 // GoogleCloudRetailV2TuneModelResponse: Response associated with a tune 1335 // operation. 1336 type GoogleCloudRetailV2TuneModelResponse struct { 1337 } 1338 1339 // GoogleCloudRetailV2UserEventImportSummary: A summary of import result. The 1340 // UserEventImportSummary summarizes the import status for user events. 1341 type GoogleCloudRetailV2UserEventImportSummary struct { 1342 // JoinedEventsCount: Count of user events imported with complete existing 1343 // catalog information. 1344 JoinedEventsCount int64 `json:"joinedEventsCount,omitempty,string"` 1345 // UnjoinedEventsCount: Count of user events imported, but with catalog 1346 // information not found in the imported catalog. 1347 UnjoinedEventsCount int64 `json:"unjoinedEventsCount,omitempty,string"` 1348 // ForceSendFields is a list of field names (e.g. "JoinedEventsCount") to 1349 // unconditionally include in API requests. By default, fields with empty or 1350 // default values are omitted from API requests. See 1351 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1352 // details. 1353 ForceSendFields []string `json:"-"` 1354 // NullFields is a list of field names (e.g. "JoinedEventsCount") to include in 1355 // API requests with the JSON null value. By default, fields with empty values 1356 // are omitted from API requests. See 1357 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1358 NullFields []string `json:"-"` 1359 } 1360 1361 func (s *GoogleCloudRetailV2UserEventImportSummary) MarshalJSON() ([]byte, error) { 1362 type NoMethod GoogleCloudRetailV2UserEventImportSummary 1363 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1364 } 1365 1366 // GoogleCloudRetailV2alphaAddFulfillmentPlacesMetadata: Metadata related to 1367 // the progress of the AddFulfillmentPlaces operation. Currently empty because 1368 // there is no meaningful metadata populated from the 1369 // ProductService.AddFulfillmentPlaces method. 1370 type GoogleCloudRetailV2alphaAddFulfillmentPlacesMetadata struct { 1371 } 1372 1373 // GoogleCloudRetailV2alphaAddFulfillmentPlacesResponse: Response of the 1374 // AddFulfillmentPlacesRequest. Currently empty because there is no meaningful 1375 // response populated from the ProductService.AddFulfillmentPlaces method. 1376 type GoogleCloudRetailV2alphaAddFulfillmentPlacesResponse struct { 1377 } 1378 1379 // GoogleCloudRetailV2alphaAddLocalInventoriesMetadata: Metadata related to the 1380 // progress of the AddLocalInventories operation. Currently empty because there 1381 // is no meaningful metadata populated from the 1382 // ProductService.AddLocalInventories method. 1383 type GoogleCloudRetailV2alphaAddLocalInventoriesMetadata struct { 1384 } 1385 1386 // GoogleCloudRetailV2alphaAddLocalInventoriesResponse: Response of the 1387 // ProductService.AddLocalInventories API. Currently empty because there is no 1388 // meaningful response populated from the ProductService.AddLocalInventories 1389 // method. 1390 type GoogleCloudRetailV2alphaAddLocalInventoriesResponse struct { 1391 } 1392 1393 // GoogleCloudRetailV2alphaBigQueryOutputResult: A BigQuery output result. 1394 type GoogleCloudRetailV2alphaBigQueryOutputResult struct { 1395 // DatasetId: The ID of a BigQuery Dataset. 1396 DatasetId string `json:"datasetId,omitempty"` 1397 // TableId: The ID of a BigQuery Table. 1398 TableId string `json:"tableId,omitempty"` 1399 // ForceSendFields is a list of field names (e.g. "DatasetId") to 1400 // unconditionally include in API requests. By default, fields with empty or 1401 // default values are omitted from API requests. See 1402 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1403 // details. 1404 ForceSendFields []string `json:"-"` 1405 // NullFields is a list of field names (e.g. "DatasetId") to include in API 1406 // requests with the JSON null value. By default, fields with empty values are 1407 // omitted from API requests. See 1408 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1409 NullFields []string `json:"-"` 1410 } 1411 1412 func (s *GoogleCloudRetailV2alphaBigQueryOutputResult) MarshalJSON() ([]byte, error) { 1413 type NoMethod GoogleCloudRetailV2alphaBigQueryOutputResult 1414 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1415 } 1416 1417 // GoogleCloudRetailV2alphaCreateMerchantCenterAccountLinkMetadata: Common 1418 // metadata related to the progress of the operations. 1419 type GoogleCloudRetailV2alphaCreateMerchantCenterAccountLinkMetadata struct { 1420 // CreateTime: Operation create time. 1421 CreateTime string `json:"createTime,omitempty"` 1422 // UpdateTime: Operation last update time. If the operation is done, this is 1423 // also the finish time. 1424 UpdateTime string `json:"updateTime,omitempty"` 1425 // ForceSendFields is a list of field names (e.g. "CreateTime") to 1426 // unconditionally include in API requests. By default, fields with empty or 1427 // default values are omitted from API requests. See 1428 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1429 // details. 1430 ForceSendFields []string `json:"-"` 1431 // NullFields is a list of field names (e.g. "CreateTime") to include in API 1432 // requests with the JSON null value. By default, fields with empty values are 1433 // omitted from API requests. See 1434 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1435 NullFields []string `json:"-"` 1436 } 1437 1438 func (s *GoogleCloudRetailV2alphaCreateMerchantCenterAccountLinkMetadata) MarshalJSON() ([]byte, error) { 1439 type NoMethod GoogleCloudRetailV2alphaCreateMerchantCenterAccountLinkMetadata 1440 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1441 } 1442 1443 // GoogleCloudRetailV2alphaCreateModelMetadata: Metadata associated with a 1444 // create operation. 1445 type GoogleCloudRetailV2alphaCreateModelMetadata struct { 1446 // Model: The resource name of the model that this create applies to. Format: 1447 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/mode 1448 // ls/{model_id}` 1449 Model string `json:"model,omitempty"` 1450 // ForceSendFields is a list of field names (e.g. "Model") to unconditionally 1451 // include in API requests. By default, fields with empty or default values are 1452 // omitted from API requests. See 1453 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1454 // details. 1455 ForceSendFields []string `json:"-"` 1456 // NullFields is a list of field names (e.g. "Model") to include in API 1457 // requests with the JSON null value. By default, fields with empty values are 1458 // omitted from API requests. See 1459 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1460 NullFields []string `json:"-"` 1461 } 1462 1463 func (s *GoogleCloudRetailV2alphaCreateModelMetadata) MarshalJSON() ([]byte, error) { 1464 type NoMethod GoogleCloudRetailV2alphaCreateModelMetadata 1465 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1466 } 1467 1468 // GoogleCloudRetailV2alphaEnrollSolutionMetadata: Metadata related to the 1469 // EnrollSolution method. This will be returned by the 1470 // google.longrunning.Operation.metadata field. 1471 type GoogleCloudRetailV2alphaEnrollSolutionMetadata struct { 1472 } 1473 1474 // GoogleCloudRetailV2alphaEnrollSolutionResponse: Response for EnrollSolution 1475 // method. 1476 type GoogleCloudRetailV2alphaEnrollSolutionResponse struct { 1477 // EnrolledSolution: Retail API solution that the project has enrolled. 1478 // 1479 // Possible values: 1480 // "SOLUTION_TYPE_UNSPECIFIED" - Default value. 1481 // "SOLUTION_TYPE_RECOMMENDATION" - Used for Recommendations AI. 1482 // "SOLUTION_TYPE_SEARCH" - Used for Retail Search. 1483 EnrolledSolution string `json:"enrolledSolution,omitempty"` 1484 // ForceSendFields is a list of field names (e.g. "EnrolledSolution") to 1485 // unconditionally include in API requests. By default, fields with empty or 1486 // default values are omitted from API requests. See 1487 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1488 // details. 1489 ForceSendFields []string `json:"-"` 1490 // NullFields is a list of field names (e.g. "EnrolledSolution") to include in 1491 // API requests with the JSON null value. By default, fields with empty values 1492 // are omitted from API requests. See 1493 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1494 NullFields []string `json:"-"` 1495 } 1496 1497 func (s *GoogleCloudRetailV2alphaEnrollSolutionResponse) MarshalJSON() ([]byte, error) { 1498 type NoMethod GoogleCloudRetailV2alphaEnrollSolutionResponse 1499 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1500 } 1501 1502 // GoogleCloudRetailV2alphaExportAnalyticsMetricsResponse: Response of the 1503 // ExportAnalyticsMetricsRequest. If the long running operation was successful, 1504 // then this message is returned by the google.longrunning.Operations.response 1505 // field if the operation was successful. 1506 type GoogleCloudRetailV2alphaExportAnalyticsMetricsResponse struct { 1507 // ErrorSamples: A sample of errors encountered while processing the request. 1508 ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` 1509 // ErrorsConfig: This field is never set. 1510 ErrorsConfig *GoogleCloudRetailV2alphaExportErrorsConfig `json:"errorsConfig,omitempty"` 1511 // OutputResult: Output result indicating where the data were exported to. 1512 OutputResult *GoogleCloudRetailV2alphaOutputResult `json:"outputResult,omitempty"` 1513 // ForceSendFields is a list of field names (e.g. "ErrorSamples") to 1514 // unconditionally include in API requests. By default, fields with empty or 1515 // default values are omitted from API requests. See 1516 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1517 // details. 1518 ForceSendFields []string `json:"-"` 1519 // NullFields is a list of field names (e.g. "ErrorSamples") to include in API 1520 // requests with the JSON null value. By default, fields with empty values are 1521 // omitted from API requests. See 1522 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1523 NullFields []string `json:"-"` 1524 } 1525 1526 func (s *GoogleCloudRetailV2alphaExportAnalyticsMetricsResponse) MarshalJSON() ([]byte, error) { 1527 type NoMethod GoogleCloudRetailV2alphaExportAnalyticsMetricsResponse 1528 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1529 } 1530 1531 // GoogleCloudRetailV2alphaExportErrorsConfig: Configuration of destination for 1532 // Export related errors. 1533 type GoogleCloudRetailV2alphaExportErrorsConfig struct { 1534 // GcsPrefix: Google Cloud Storage path for import errors. This must be an 1535 // empty, existing Cloud Storage bucket. Export errors will be written to a 1536 // file in this bucket, one per line, as a JSON-encoded `google.rpc.Status` 1537 // message. 1538 GcsPrefix string `json:"gcsPrefix,omitempty"` 1539 // ForceSendFields is a list of field names (e.g. "GcsPrefix") to 1540 // unconditionally include in API requests. By default, fields with empty or 1541 // default values are omitted from API requests. See 1542 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1543 // details. 1544 ForceSendFields []string `json:"-"` 1545 // NullFields is a list of field names (e.g. "GcsPrefix") to include in API 1546 // requests with the JSON null value. By default, fields with empty values are 1547 // omitted from API requests. See 1548 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1549 NullFields []string `json:"-"` 1550 } 1551 1552 func (s *GoogleCloudRetailV2alphaExportErrorsConfig) MarshalJSON() ([]byte, error) { 1553 type NoMethod GoogleCloudRetailV2alphaExportErrorsConfig 1554 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1555 } 1556 1557 // GoogleCloudRetailV2alphaExportMetadata: Metadata related to the progress of 1558 // the Export operation. This is returned by the 1559 // google.longrunning.Operation.metadata field. 1560 type GoogleCloudRetailV2alphaExportMetadata struct { 1561 // CreateTime: Operation create time. 1562 CreateTime string `json:"createTime,omitempty"` 1563 // UpdateTime: Operation last update time. If the operation is done, this is 1564 // also the finish time. 1565 UpdateTime string `json:"updateTime,omitempty"` 1566 // ForceSendFields is a list of field names (e.g. "CreateTime") to 1567 // unconditionally include in API requests. By default, fields with empty or 1568 // default values are omitted from API requests. See 1569 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1570 // details. 1571 ForceSendFields []string `json:"-"` 1572 // NullFields is a list of field names (e.g. "CreateTime") to include in API 1573 // requests with the JSON null value. By default, fields with empty values are 1574 // omitted from API requests. See 1575 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1576 NullFields []string `json:"-"` 1577 } 1578 1579 func (s *GoogleCloudRetailV2alphaExportMetadata) MarshalJSON() ([]byte, error) { 1580 type NoMethod GoogleCloudRetailV2alphaExportMetadata 1581 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1582 } 1583 1584 // GoogleCloudRetailV2alphaExportProductsResponse: Response of the 1585 // ExportProductsRequest. If the long running operation is done, then this 1586 // message is returned by the google.longrunning.Operations.response field if 1587 // the operation was successful. 1588 type GoogleCloudRetailV2alphaExportProductsResponse struct { 1589 // ErrorSamples: A sample of errors encountered while processing the request. 1590 ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` 1591 // ErrorsConfig: This field is never set. 1592 ErrorsConfig *GoogleCloudRetailV2alphaExportErrorsConfig `json:"errorsConfig,omitempty"` 1593 // OutputResult: Output result indicating where the data were exported to. 1594 OutputResult *GoogleCloudRetailV2alphaOutputResult `json:"outputResult,omitempty"` 1595 // ForceSendFields is a list of field names (e.g. "ErrorSamples") to 1596 // unconditionally include in API requests. By default, fields with empty or 1597 // default values are omitted from API requests. See 1598 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1599 // details. 1600 ForceSendFields []string `json:"-"` 1601 // NullFields is a list of field names (e.g. "ErrorSamples") to include in API 1602 // requests with the JSON null value. By default, fields with empty values are 1603 // omitted from API requests. See 1604 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1605 NullFields []string `json:"-"` 1606 } 1607 1608 func (s *GoogleCloudRetailV2alphaExportProductsResponse) MarshalJSON() ([]byte, error) { 1609 type NoMethod GoogleCloudRetailV2alphaExportProductsResponse 1610 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1611 } 1612 1613 // GoogleCloudRetailV2alphaExportUserEventsResponse: Response of the 1614 // ExportUserEventsRequest. If the long running operation was successful, then 1615 // this message is returned by the google.longrunning.Operations.response field 1616 // if the operation was successful. 1617 type GoogleCloudRetailV2alphaExportUserEventsResponse struct { 1618 // ErrorSamples: A sample of errors encountered while processing the request. 1619 ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` 1620 // ErrorsConfig: This field is never set. 1621 ErrorsConfig *GoogleCloudRetailV2alphaExportErrorsConfig `json:"errorsConfig,omitempty"` 1622 // OutputResult: Output result indicating where the data were exported to. 1623 OutputResult *GoogleCloudRetailV2alphaOutputResult `json:"outputResult,omitempty"` 1624 // ForceSendFields is a list of field names (e.g. "ErrorSamples") to 1625 // unconditionally include in API requests. By default, fields with empty or 1626 // default values are omitted from API requests. See 1627 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1628 // details. 1629 ForceSendFields []string `json:"-"` 1630 // NullFields is a list of field names (e.g. "ErrorSamples") to include in API 1631 // requests with the JSON null value. By default, fields with empty values are 1632 // omitted from API requests. See 1633 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1634 NullFields []string `json:"-"` 1635 } 1636 1637 func (s *GoogleCloudRetailV2alphaExportUserEventsResponse) MarshalJSON() ([]byte, error) { 1638 type NoMethod GoogleCloudRetailV2alphaExportUserEventsResponse 1639 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1640 } 1641 1642 // GoogleCloudRetailV2alphaGcsOutputResult: A Gcs output result. 1643 type GoogleCloudRetailV2alphaGcsOutputResult struct { 1644 // OutputUri: The uri of Gcs output 1645 OutputUri string `json:"outputUri,omitempty"` 1646 // ForceSendFields is a list of field names (e.g. "OutputUri") to 1647 // unconditionally include in API requests. By default, fields with empty or 1648 // default values are omitted from API requests. See 1649 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1650 // details. 1651 ForceSendFields []string `json:"-"` 1652 // NullFields is a list of field names (e.g. "OutputUri") to include in API 1653 // requests with the JSON null value. By default, fields with empty values are 1654 // omitted from API requests. See 1655 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1656 NullFields []string `json:"-"` 1657 } 1658 1659 func (s *GoogleCloudRetailV2alphaGcsOutputResult) MarshalJSON() ([]byte, error) { 1660 type NoMethod GoogleCloudRetailV2alphaGcsOutputResult 1661 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1662 } 1663 1664 // GoogleCloudRetailV2alphaImportCompletionDataResponse: Response of the 1665 // ImportCompletionDataRequest. If the long running operation is done, this 1666 // message is returned by the google.longrunning.Operations.response field if 1667 // the operation is successful. 1668 type GoogleCloudRetailV2alphaImportCompletionDataResponse struct { 1669 // ErrorSamples: A sample of errors encountered while processing the request. 1670 ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` 1671 // ForceSendFields is a list of field names (e.g. "ErrorSamples") to 1672 // unconditionally include in API requests. By default, fields with empty or 1673 // default values are omitted from API requests. See 1674 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1675 // details. 1676 ForceSendFields []string `json:"-"` 1677 // NullFields is a list of field names (e.g. "ErrorSamples") to include in API 1678 // requests with the JSON null value. By default, fields with empty values are 1679 // omitted from API requests. See 1680 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1681 NullFields []string `json:"-"` 1682 } 1683 1684 func (s *GoogleCloudRetailV2alphaImportCompletionDataResponse) MarshalJSON() ([]byte, error) { 1685 type NoMethod GoogleCloudRetailV2alphaImportCompletionDataResponse 1686 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1687 } 1688 1689 // GoogleCloudRetailV2alphaImportErrorsConfig: Configuration of destination for 1690 // Import related errors. 1691 type GoogleCloudRetailV2alphaImportErrorsConfig struct { 1692 // GcsPrefix: Google Cloud Storage prefix for import errors. This must be an 1693 // empty, existing Cloud Storage directory. Import errors are written to 1694 // sharded files in this directory, one per line, as a JSON-encoded 1695 // `google.rpc.Status` message. 1696 GcsPrefix string `json:"gcsPrefix,omitempty"` 1697 // ForceSendFields is a list of field names (e.g. "GcsPrefix") to 1698 // unconditionally include in API requests. By default, fields with empty or 1699 // default values are omitted from API requests. See 1700 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1701 // details. 1702 ForceSendFields []string `json:"-"` 1703 // NullFields is a list of field names (e.g. "GcsPrefix") to include in API 1704 // requests with the JSON null value. By default, fields with empty values are 1705 // omitted from API requests. See 1706 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1707 NullFields []string `json:"-"` 1708 } 1709 1710 func (s *GoogleCloudRetailV2alphaImportErrorsConfig) MarshalJSON() ([]byte, error) { 1711 type NoMethod GoogleCloudRetailV2alphaImportErrorsConfig 1712 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1713 } 1714 1715 // GoogleCloudRetailV2alphaImportMetadata: Metadata related to the progress of 1716 // the Import operation. This is returned by the 1717 // google.longrunning.Operation.metadata field. 1718 type GoogleCloudRetailV2alphaImportMetadata struct { 1719 // CreateTime: Operation create time. 1720 CreateTime string `json:"createTime,omitempty"` 1721 // FailureCount: Count of entries that encountered errors while processing. 1722 FailureCount int64 `json:"failureCount,omitempty,string"` 1723 // NotificationPubsubTopic: Pub/Sub topic for receiving notification. If this 1724 // field is set, when the import is finished, a notification is sent to 1725 // specified Pub/Sub topic. The message data is JSON string of a Operation. 1726 // Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. 1727 NotificationPubsubTopic string `json:"notificationPubsubTopic,omitempty"` 1728 // RequestId: Deprecated. This field is never set. 1729 RequestId string `json:"requestId,omitempty"` 1730 // SuccessCount: Count of entries that were processed successfully. 1731 SuccessCount int64 `json:"successCount,omitempty,string"` 1732 // TransformedUserEventsMetadata: Metadata related to transform user events. 1733 TransformedUserEventsMetadata *GoogleCloudRetailV2alphaTransformedUserEventsMetadata `json:"transformedUserEventsMetadata,omitempty"` 1734 // UpdateTime: Operation last update time. If the operation is done, this is 1735 // also the finish time. 1736 UpdateTime string `json:"updateTime,omitempty"` 1737 // ForceSendFields is a list of field names (e.g. "CreateTime") to 1738 // unconditionally include in API requests. By default, fields with empty or 1739 // default values are omitted from API requests. See 1740 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1741 // details. 1742 ForceSendFields []string `json:"-"` 1743 // NullFields is a list of field names (e.g. "CreateTime") to include in API 1744 // requests with the JSON null value. By default, fields with empty values are 1745 // omitted from API requests. See 1746 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1747 NullFields []string `json:"-"` 1748 } 1749 1750 func (s *GoogleCloudRetailV2alphaImportMetadata) MarshalJSON() ([]byte, error) { 1751 type NoMethod GoogleCloudRetailV2alphaImportMetadata 1752 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1753 } 1754 1755 // GoogleCloudRetailV2alphaImportProductsResponse: Response of the 1756 // ImportProductsRequest. If the long running operation is done, then this 1757 // message is returned by the google.longrunning.Operations.response field if 1758 // the operation was successful. 1759 type GoogleCloudRetailV2alphaImportProductsResponse struct { 1760 // ErrorSamples: A sample of errors encountered while processing the request. 1761 ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` 1762 // ErrorsConfig: Echoes the destination for the complete errors in the request 1763 // if set. 1764 ErrorsConfig *GoogleCloudRetailV2alphaImportErrorsConfig `json:"errorsConfig,omitempty"` 1765 // ForceSendFields is a list of field names (e.g. "ErrorSamples") to 1766 // unconditionally include in API requests. By default, fields with empty or 1767 // default values are omitted from API requests. See 1768 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1769 // details. 1770 ForceSendFields []string `json:"-"` 1771 // NullFields is a list of field names (e.g. "ErrorSamples") to include in API 1772 // requests with the JSON null value. By default, fields with empty values are 1773 // omitted from API requests. See 1774 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1775 NullFields []string `json:"-"` 1776 } 1777 1778 func (s *GoogleCloudRetailV2alphaImportProductsResponse) MarshalJSON() ([]byte, error) { 1779 type NoMethod GoogleCloudRetailV2alphaImportProductsResponse 1780 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1781 } 1782 1783 // GoogleCloudRetailV2alphaImportUserEventsResponse: Response of the 1784 // ImportUserEventsRequest. If the long running operation was successful, then 1785 // this message is returned by the google.longrunning.Operations.response field 1786 // if the operation was successful. 1787 type GoogleCloudRetailV2alphaImportUserEventsResponse struct { 1788 // ErrorSamples: A sample of errors encountered while processing the request. 1789 ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` 1790 // ErrorsConfig: Echoes the destination for the complete errors if this field 1791 // was set in the request. 1792 ErrorsConfig *GoogleCloudRetailV2alphaImportErrorsConfig `json:"errorsConfig,omitempty"` 1793 // ImportSummary: Aggregated statistics of user event import status. 1794 ImportSummary *GoogleCloudRetailV2alphaUserEventImportSummary `json:"importSummary,omitempty"` 1795 // ForceSendFields is a list of field names (e.g. "ErrorSamples") to 1796 // unconditionally include in API requests. By default, fields with empty or 1797 // default values are omitted from API requests. See 1798 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1799 // details. 1800 ForceSendFields []string `json:"-"` 1801 // NullFields is a list of field names (e.g. "ErrorSamples") to include in API 1802 // requests with the JSON null value. By default, fields with empty values are 1803 // omitted from API requests. See 1804 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1805 NullFields []string `json:"-"` 1806 } 1807 1808 func (s *GoogleCloudRetailV2alphaImportUserEventsResponse) MarshalJSON() ([]byte, error) { 1809 type NoMethod GoogleCloudRetailV2alphaImportUserEventsResponse 1810 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1811 } 1812 1813 // GoogleCloudRetailV2alphaMerchantCenterAccountLink: Represents a link between 1814 // a Merchant Center account and a branch. After a link is established, 1815 // products from the linked Merchant Center account are streamed to the linked 1816 // branch. 1817 type GoogleCloudRetailV2alphaMerchantCenterAccountLink struct { 1818 // BranchId: Required. The branch ID (e.g. 0/1/2) within the catalog that 1819 // products from merchant_center_account_id are streamed to. When updating this 1820 // field, an empty value will use the currently configured default branch. 1821 // However, changing the default branch later on won't change the linked branch 1822 // here. A single branch ID can only have one linked Merchant Center account 1823 // ID. 1824 BranchId string `json:"branchId,omitempty"` 1825 // FeedFilters: Criteria for the Merchant Center feeds to be ingested via the 1826 // link. All offers will be ingested if the list is empty. Otherwise the offers 1827 // will be ingested from selected feeds. 1828 FeedFilters []*GoogleCloudRetailV2alphaMerchantCenterAccountLinkMerchantCenterFeedFilter `json:"feedFilters,omitempty"` 1829 // FeedLabel: The FeedLabel used to perform filtering. Note: this replaces 1830 // region_id 1831 // (https://developers.google.com/shopping-content/reference/rest/v2.1/products#Product.FIELDS.feed_label). 1832 // Example value: `US`. Example value: `FeedLabel1`. 1833 FeedLabel string `json:"feedLabel,omitempty"` 1834 // Id: Output only. Immutable. MerchantCenterAccountLink identifier, which is 1835 // the final component of name. This field is auto generated and follows the 1836 // convention: `BranchId_MerchantCenterAccountId`. 1837 // `projects/*/locations/global/catalogs/default_catalog/merchantCenterAccountLi 1838 // nks/id_1`. 1839 Id string `json:"id,omitempty"` 1840 // LanguageCode: Language of the title/description and other string attributes. 1841 // Use language tags defined by BCP 47 1842 // (https://www.rfc-editor.org/rfc/bcp/bcp47.txt). ISO 639-1. This specifies 1843 // the language of offers in Merchant Center that will be accepted. If empty, 1844 // no language filtering will be performed. Example value: `en`. 1845 LanguageCode string `json:"languageCode,omitempty"` 1846 // MerchantCenterAccountId: Required. The linked Merchant center account id 1847 // (https://developers.google.com/shopping-content/guides/accountstatuses). The 1848 // account must be a standalone account or a sub-account of a MCA. 1849 MerchantCenterAccountId int64 `json:"merchantCenterAccountId,omitempty,string"` 1850 // Name: Output only. Immutable. Full resource name of the Merchant Center 1851 // Account Link, such as 1852 // `projects/*/locations/global/catalogs/default_catalog/merchantCenterAccountLi 1853 // nks/merchant_center_account_link`. 1854 Name string `json:"name,omitempty"` 1855 // ProjectId: Output only. Google Cloud project ID. 1856 ProjectId string `json:"projectId,omitempty"` 1857 // Source: Optional. An optional arbitrary string that could be used as a tag 1858 // for tracking link source. 1859 Source string `json:"source,omitempty"` 1860 // State: Output only. Represents the state of the link. 1861 // 1862 // Possible values: 1863 // "STATE_UNSPECIFIED" - Default value. 1864 // "PENDING" - Link is created and LRO is not complete. 1865 // "ACTIVE" - Link is active. 1866 // "FAILED" - Link creation failed. 1867 State string `json:"state,omitempty"` 1868 // ForceSendFields is a list of field names (e.g. "BranchId") to 1869 // unconditionally include in API requests. By default, fields with empty or 1870 // default values are omitted from API requests. See 1871 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1872 // details. 1873 ForceSendFields []string `json:"-"` 1874 // NullFields is a list of field names (e.g. "BranchId") to include in API 1875 // requests with the JSON null value. By default, fields with empty values are 1876 // omitted from API requests. See 1877 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1878 NullFields []string `json:"-"` 1879 } 1880 1881 func (s *GoogleCloudRetailV2alphaMerchantCenterAccountLink) MarshalJSON() ([]byte, error) { 1882 type NoMethod GoogleCloudRetailV2alphaMerchantCenterAccountLink 1883 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1884 } 1885 1886 // GoogleCloudRetailV2alphaMerchantCenterAccountLinkMerchantCenterFeedFilter: 1887 // Merchant Center Feed filter criterion. 1888 type GoogleCloudRetailV2alphaMerchantCenterAccountLinkMerchantCenterFeedFilter struct { 1889 // PrimaryFeedId: Merchant Center primary feed ID. 1890 PrimaryFeedId int64 `json:"primaryFeedId,omitempty,string"` 1891 // PrimaryFeedName: Merchant Center primary feed name. The name is used for the 1892 // display purposes only. 1893 PrimaryFeedName string `json:"primaryFeedName,omitempty"` 1894 // ForceSendFields is a list of field names (e.g. "PrimaryFeedId") to 1895 // unconditionally include in API requests. By default, fields with empty or 1896 // default values are omitted from API requests. See 1897 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1898 // details. 1899 ForceSendFields []string `json:"-"` 1900 // NullFields is a list of field names (e.g. "PrimaryFeedId") to include in API 1901 // requests with the JSON null value. By default, fields with empty values are 1902 // omitted from API requests. See 1903 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1904 NullFields []string `json:"-"` 1905 } 1906 1907 func (s *GoogleCloudRetailV2alphaMerchantCenterAccountLinkMerchantCenterFeedFilter) MarshalJSON() ([]byte, error) { 1908 type NoMethod GoogleCloudRetailV2alphaMerchantCenterAccountLinkMerchantCenterFeedFilter 1909 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1910 } 1911 1912 // GoogleCloudRetailV2alphaModel: Metadata that describes the training and 1913 // serving parameters of a Model. A Model can be associated with a 1914 // ServingConfig and then queried through the Predict API. 1915 type GoogleCloudRetailV2alphaModel struct { 1916 // CreateTime: Output only. Timestamp the Recommendation Model was created at. 1917 CreateTime string `json:"createTime,omitempty"` 1918 // DataState: Output only. The state of data requirements for this model: 1919 // `DATA_OK` and `DATA_ERROR`. Recommendation model cannot be trained if the 1920 // data is in `DATA_ERROR` state. Recommendation model can have `DATA_ERROR` 1921 // state even if serving state is `ACTIVE`: models were trained successfully 1922 // before, but cannot be refreshed because model no longer has sufficient data 1923 // for training. 1924 // 1925 // Possible values: 1926 // "DATA_STATE_UNSPECIFIED" - Unspecified default value, should never be 1927 // explicitly set. 1928 // "DATA_OK" - The model has sufficient training data. 1929 // "DATA_ERROR" - The model does not have sufficient training data. Error 1930 // messages can be queried via Stackdriver. 1931 DataState string `json:"dataState,omitempty"` 1932 // DisplayName: Required. The display name of the model. Should be human 1933 // readable, used to display Recommendation Models in the Retail Cloud Console 1934 // Dashboard. UTF-8 encoded string with limit of 1024 characters. 1935 DisplayName string `json:"displayName,omitempty"` 1936 // FilteringOption: Optional. If `RECOMMENDATIONS_FILTERING_ENABLED`, 1937 // recommendation filtering by attributes is enabled for the model. 1938 // 1939 // Possible values: 1940 // "RECOMMENDATIONS_FILTERING_OPTION_UNSPECIFIED" - Value used when unset. In 1941 // this case, server behavior defaults to RECOMMENDATIONS_FILTERING_DISABLED. 1942 // "RECOMMENDATIONS_FILTERING_DISABLED" - Recommendation filtering is 1943 // disabled. 1944 // "RECOMMENDATIONS_FILTERING_ENABLED" - Recommendation filtering is enabled. 1945 FilteringOption string `json:"filteringOption,omitempty"` 1946 // LastTuneTime: Output only. The timestamp when the latest successful tune 1947 // finished. 1948 LastTuneTime string `json:"lastTuneTime,omitempty"` 1949 // ModelFeaturesConfig: Optional. Additional model features config. 1950 ModelFeaturesConfig *GoogleCloudRetailV2alphaModelModelFeaturesConfig `json:"modelFeaturesConfig,omitempty"` 1951 // Name: Required. The fully qualified resource name of the model. Format: 1952 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/mode 1953 // ls/{model_id}` catalog_id has char limit of 50. recommendation_model_id has 1954 // char limit of 40. 1955 Name string `json:"name,omitempty"` 1956 // OptimizationObjective: Optional. The optimization objective e.g. `cvr`. 1957 // Currently supported values: `ctr`, `cvr`, `revenue-per-order`. If not 1958 // specified, we choose default based on model type. Default depends on type of 1959 // recommendation: `recommended-for-you` => `ctr` `others-you-may-like` => 1960 // `ctr` `frequently-bought-together` => `revenue_per_order` This field 1961 // together with optimization_objective describe model metadata to use to 1962 // control model training and serving. See 1963 // https://cloud.google.com/retail/docs/models for more details on what the 1964 // model metadata control and which combination of parameters are valid. For 1965 // invalid combinations of parameters (e.g. type = `frequently-bought-together` 1966 // and optimization_objective = `ctr`), you receive an error 400 if you try to 1967 // create/update a recommendation with this set of knobs. 1968 OptimizationObjective string `json:"optimizationObjective,omitempty"` 1969 // PageOptimizationConfig: Optional. The page optimization config. 1970 PageOptimizationConfig *GoogleCloudRetailV2alphaModelPageOptimizationConfig `json:"pageOptimizationConfig,omitempty"` 1971 // PeriodicTuningState: Optional. The state of periodic tuning. The period we 1972 // use is 3 months - to do a one-off tune earlier use the `TuneModel` method. 1973 // Default value is `PERIODIC_TUNING_ENABLED`. 1974 // 1975 // Possible values: 1976 // "PERIODIC_TUNING_STATE_UNSPECIFIED" - Unspecified default value, should 1977 // never be explicitly set. 1978 // "PERIODIC_TUNING_DISABLED" - The model has periodic tuning disabled. 1979 // Tuning can be reenabled by calling the `EnableModelPeriodicTuning` method or 1980 // by calling the `TuneModel` method. 1981 // "ALL_TUNING_DISABLED" - The model cannot be tuned with periodic tuning OR 1982 // the `TuneModel` method. Hide the options in customer UI and reject any 1983 // requests through the backend self serve API. 1984 // "PERIODIC_TUNING_ENABLED" - The model has periodic tuning enabled. Tuning 1985 // can be disabled by calling the `DisableModelPeriodicTuning` method. 1986 PeriodicTuningState string `json:"periodicTuningState,omitempty"` 1987 // ServingConfigLists: Output only. The list of valid serving configs 1988 // associated with the PageOptimizationConfig. 1989 ServingConfigLists []*GoogleCloudRetailV2alphaModelServingConfigList `json:"servingConfigLists,omitempty"` 1990 // ServingState: Output only. The serving state of the model: `ACTIVE`, 1991 // `NOT_ACTIVE`. 1992 // 1993 // Possible values: 1994 // "SERVING_STATE_UNSPECIFIED" - Unspecified serving state. 1995 // "INACTIVE" - The model is not serving. 1996 // "ACTIVE" - The model is serving and can be queried. 1997 // "TUNED" - The model is trained on tuned hyperparameters and can be 1998 // queried. 1999 ServingState string `json:"servingState,omitempty"` 2000 // TrainingState: Optional. The training state that the model is in (e.g. 2001 // `TRAINING` or `PAUSED`). Since part of the cost of running the service is 2002 // frequency of training - this can be used to determine when to train model in 2003 // order to control cost. If not specified: the default value for `CreateModel` 2004 // method is `TRAINING`. The default value for `UpdateModel` method is to keep 2005 // the state the same as before. 2006 // 2007 // Possible values: 2008 // "TRAINING_STATE_UNSPECIFIED" - Unspecified training state. 2009 // "PAUSED" - The model training is paused. 2010 // "TRAINING" - The model is training. 2011 TrainingState string `json:"trainingState,omitempty"` 2012 // TuningOperation: Output only. The tune operation associated with the model. 2013 // Can be used to determine if there is an ongoing tune for this 2014 // recommendation. Empty field implies no tune is goig on. 2015 TuningOperation string `json:"tuningOperation,omitempty"` 2016 // Type: Required. The type of model e.g. `home-page`. Currently supported 2017 // values: `recommended-for-you`, `others-you-may-like`, 2018 // `frequently-bought-together`, `page-optimization`, `similar-items`, 2019 // `buy-it-again`, `on-sale-items`, and `recently-viewed`(readonly value). This 2020 // field together with optimization_objective describe model metadata to use to 2021 // control model training and serving. See 2022 // https://cloud.google.com/retail/docs/models for more details on what the 2023 // model metadata control and which combination of parameters are valid. For 2024 // invalid combinations of parameters (e.g. type = `frequently-bought-together` 2025 // and optimization_objective = `ctr`), you receive an error 400 if you try to 2026 // create/update a recommendation with this set of knobs. 2027 Type string `json:"type,omitempty"` 2028 // UpdateTime: Output only. Timestamp the Recommendation Model was last 2029 // updated. E.g. if a Recommendation Model was paused - this would be the time 2030 // the pause was initiated. 2031 UpdateTime string `json:"updateTime,omitempty"` 2032 // ForceSendFields is a list of field names (e.g. "CreateTime") to 2033 // unconditionally include in API requests. By default, fields with empty or 2034 // default values are omitted from API requests. See 2035 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2036 // details. 2037 ForceSendFields []string `json:"-"` 2038 // NullFields is a list of field names (e.g. "CreateTime") to include in API 2039 // requests with the JSON null value. By default, fields with empty values are 2040 // omitted from API requests. See 2041 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2042 NullFields []string `json:"-"` 2043 } 2044 2045 func (s *GoogleCloudRetailV2alphaModel) MarshalJSON() ([]byte, error) { 2046 type NoMethod GoogleCloudRetailV2alphaModel 2047 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2048 } 2049 2050 // GoogleCloudRetailV2alphaModelFrequentlyBoughtTogetherFeaturesConfig: 2051 // Additional configs for the frequently-bought-together model type. 2052 type GoogleCloudRetailV2alphaModelFrequentlyBoughtTogetherFeaturesConfig struct { 2053 // ContextProductsType: Optional. Specifies the context of the model when it is 2054 // used in predict requests. Can only be set for the 2055 // `frequently-bought-together` type. If it isn't specified, it defaults to 2056 // MULTIPLE_CONTEXT_PRODUCTS. 2057 // 2058 // Possible values: 2059 // "CONTEXT_PRODUCTS_TYPE_UNSPECIFIED" - Unspecified default value, should 2060 // never be explicitly set. Defaults to MULTIPLE_CONTEXT_PRODUCTS. 2061 // "SINGLE_CONTEXT_PRODUCT" - Use only a single product as context for the 2062 // recommendation. Typically used on pages like add-to-cart or product details. 2063 // "MULTIPLE_CONTEXT_PRODUCTS" - Use one or multiple products as context for 2064 // the recommendation. Typically used on shopping cart pages. 2065 ContextProductsType string `json:"contextProductsType,omitempty"` 2066 // ForceSendFields is a list of field names (e.g. "ContextProductsType") to 2067 // unconditionally include in API requests. By default, fields with empty or 2068 // default values are omitted from API requests. See 2069 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2070 // details. 2071 ForceSendFields []string `json:"-"` 2072 // NullFields is a list of field names (e.g. "ContextProductsType") to include 2073 // in API requests with the JSON null value. By default, fields with empty 2074 // values are omitted from API requests. See 2075 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2076 NullFields []string `json:"-"` 2077 } 2078 2079 func (s *GoogleCloudRetailV2alphaModelFrequentlyBoughtTogetherFeaturesConfig) MarshalJSON() ([]byte, error) { 2080 type NoMethod GoogleCloudRetailV2alphaModelFrequentlyBoughtTogetherFeaturesConfig 2081 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2082 } 2083 2084 // GoogleCloudRetailV2alphaModelModelFeaturesConfig: Additional model features 2085 // config. 2086 type GoogleCloudRetailV2alphaModelModelFeaturesConfig struct { 2087 // FrequentlyBoughtTogetherConfig: Additional configs for 2088 // frequently-bought-together models. 2089 FrequentlyBoughtTogetherConfig *GoogleCloudRetailV2alphaModelFrequentlyBoughtTogetherFeaturesConfig `json:"frequentlyBoughtTogetherConfig,omitempty"` 2090 // ForceSendFields is a list of field names (e.g. 2091 // "FrequentlyBoughtTogetherConfig") to unconditionally include in API 2092 // requests. By default, fields with empty or default values are omitted from 2093 // API requests. See 2094 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2095 // details. 2096 ForceSendFields []string `json:"-"` 2097 // NullFields is a list of field names (e.g. "FrequentlyBoughtTogetherConfig") 2098 // to include in API requests with the JSON null value. By default, fields with 2099 // empty values are omitted from API requests. See 2100 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2101 NullFields []string `json:"-"` 2102 } 2103 2104 func (s *GoogleCloudRetailV2alphaModelModelFeaturesConfig) MarshalJSON() ([]byte, error) { 2105 type NoMethod GoogleCloudRetailV2alphaModelModelFeaturesConfig 2106 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2107 } 2108 2109 // GoogleCloudRetailV2alphaModelPageOptimizationConfig: The 2110 // PageOptimizationConfig for model training. This determines how many panels 2111 // to optimize for, and which serving configs to consider for each panel. The 2112 // purpose of this model is to optimize which ServingConfig to show on which 2113 // panels in way that optimizes the visitors shopping journey. 2114 type GoogleCloudRetailV2alphaModelPageOptimizationConfig struct { 2115 // PageOptimizationEventType: Required. The type of UserEvent this page 2116 // optimization is shown for. Each page has an associated event type - this 2117 // will be the corresponding event type for the page that the page optimization 2118 // model is used on. Supported types: * `add-to-cart`: Products being added to 2119 // cart. * `detail-page-view`: Products detail page viewed. * `home-page-view`: 2120 // Homepage viewed * `category-page-view`: Homepage viewed * 2121 // `shopping-cart-page-view`: User viewing a shopping cart. `home-page-view` 2122 // only allows models with type `recommended-for-you`. All other 2123 // page_optimization_event_type allow all Model.types. 2124 PageOptimizationEventType string `json:"pageOptimizationEventType,omitempty"` 2125 // Panels: Required. A list of panel configurations. Limit = 5. 2126 Panels []*GoogleCloudRetailV2alphaModelPageOptimizationConfigPanel `json:"panels,omitempty"` 2127 // Restriction: Optional. How to restrict results across panels e.g. can the 2128 // same ServingConfig be shown on multiple panels at once. If unspecified, 2129 // default to `UNIQUE_MODEL_RESTRICTION`. 2130 // 2131 // Possible values: 2132 // "RESTRICTION_UNSPECIFIED" - Unspecified value for restriction. 2133 // "NO_RESTRICTION" - Allow any ServingConfig to be show on any number of 2134 // panels. Example: `Panel1 candidates`: pdp_ctr, pdp_cvr, 2135 // home_page_ctr_no_diversity `Panel2 candidates`: home_page_ctr_no_diversity, 2136 // home_page_ctr_diversity, pdp_cvr_no_diversity `Restriction` = NO_RESTRICTION 2137 // `Valid combinations`: * * (pdp_ctr, home_page_ctr_no_diversity) * (pdp_ctr, 2138 // home_page_ctr_diversity) * (pdp_ctr, pdp_cvr_no_diversity) * (pdp_cvr, 2139 // home_page_ctr_no_diversity) * (pdp_cvr, home_page_ctr_diversity) * (pdp_cvr, 2140 // pdp_cvr_no_diversity) * (home_page_ctr_no_diversity, 2141 // home_page_ctr_no_diversity) * (home_page_ctr_no_diversity, 2142 // home_page_ctr_diversity) * (home_page_ctr_no_diversity, 2143 // pdp_cvr_no_diversity) * `Invalid combinations`: [] 2144 // "UNIQUE_SERVING_CONFIG_RESTRICTION" - Do not allow the same 2145 // ServingConfig.name to be shown on multiple panels. Example: `Panel1 2146 // candidates`: * pdp_ctr, pdp_cvr, home_page_ctr_no_diversity * `Panel2 2147 // candidates`: * home_page_ctr_no_diversity, home_page_ctr_diversity_low, 2148 // pdp_cvr_no_diversity * `Restriction` = `UNIQUE_SERVING_CONFIG_RESTRICTION` 2149 // `Valid combinations`: * * (pdp_ctr, home_page_ctr_no_diversity) * (pdp_ctr, 2150 // home_page_ctr_diversity_low) * (pdp_ctr, pdp_cvr_no_diversity) * (pdp_ctr, 2151 // pdp_cvr_no_diversity) * (pdp_cvr, home_page_ctr_no_diversity) * (pdp_cvr, 2152 // home_page_ctr_diversity_low) * (pdp_cvr, pdp_cvr_no_diversity) * 2153 // (home_page_ctr_no_diversity, home_page_ctr_diversity_low) * 2154 // (home_page_ctr_no_diversity, pdp_cvr_no_diversity) * `Invalid combinations`: 2155 // * * (home_page_ctr_no_diversity, home_page_ctr_no_diversity) * 2156 // "UNIQUE_MODEL_RESTRICTION" - Do not allow multiple ServingConfigs with 2157 // same Model.name to be show on on different panels. Example: `Panel1 2158 // candidates`: * pdp_ctr, pdp_cvr, home_page_ctr_no_diversity * `Panel2 2159 // candidates`: * home_page_ctr_no_diversity, home_page_ctr_diversity_low, 2160 // pdp_cvr_no_diversity * `Restriction` = `UNIQUE_MODEL_RESTRICTION` `Valid 2161 // combinations`: * * (pdp_ctr, home_page_ctr_no_diversity) * (pdp_ctr, 2162 // home_page_ctr_diversity) * (pdp_ctr, pdp_cvr_no_diversity) * (pdp_ctr, 2163 // pdp_cvr_no_diversity) * (pdp_cvr, home_page_ctr_no_diversity) * (pdp_cvr, 2164 // home_page_ctr_diversity_low) * (home_page_ctr_no_diversity, 2165 // pdp_cvr_no_diversity) * `Invalid combinations`: * * 2166 // (home_page_ctr_no_diversity, home_page_ctr_no_diversity) * (pdp_cvr, 2167 // pdp_cvr_no_diversity) * 2168 // "UNIQUE_MODEL_TYPE_RESTRICTION" - Do not allow multiple ServingConfigs 2169 // with same Model.type to be shown on different panels. Example: `Panel1 2170 // candidates`: * pdp_ctr, pdp_cvr, home_page_ctr_no_diversity * `Panel2 2171 // candidates`: * home_page_ctr_no_diversity, home_page_ctr_diversity_low, 2172 // pdp_cvr_no_diversity * `Restriction` = `UNIQUE_MODEL_RESTRICTION` `Valid 2173 // combinations`: * * (pdp_ctr, home_page_ctr_no_diversity) * (pdp_ctr, 2174 // home_page_ctr_diversity) * (pdp_cvr, home_page_ctr_no_diversity) * (pdp_cvr, 2175 // home_page_ctr_diversity_low) * (home_page_ctr_no_diversity, 2176 // pdp_cvr_no_diversity) * `Invalid combinations`: * * (pdp_ctr, 2177 // pdp_cvr_no_diversity) * (pdp_ctr, pdp_cvr_no_diversity) * (pdp_cvr, 2178 // pdp_cvr_no_diversity) * (home_page_ctr_no_diversity, 2179 // home_page_ctr_no_diversity) * (home_page_ctr_no_diversity, 2180 // home_page_ctr_diversity) * 2181 Restriction string `json:"restriction,omitempty"` 2182 // ForceSendFields is a list of field names (e.g. "PageOptimizationEventType") 2183 // to unconditionally include in API requests. By default, fields with empty or 2184 // default values are omitted from API requests. See 2185 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2186 // details. 2187 ForceSendFields []string `json:"-"` 2188 // NullFields is a list of field names (e.g. "PageOptimizationEventType") to 2189 // include in API requests with the JSON null value. By default, fields with 2190 // empty values are omitted from API requests. See 2191 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2192 NullFields []string `json:"-"` 2193 } 2194 2195 func (s *GoogleCloudRetailV2alphaModelPageOptimizationConfig) MarshalJSON() ([]byte, error) { 2196 type NoMethod GoogleCloudRetailV2alphaModelPageOptimizationConfig 2197 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2198 } 2199 2200 // GoogleCloudRetailV2alphaModelPageOptimizationConfigCandidate: A candidate to 2201 // consider for a given panel. Currently only ServingConfig are valid 2202 // candidates. 2203 type GoogleCloudRetailV2alphaModelPageOptimizationConfigCandidate struct { 2204 // ServingConfigId: This has to be a valid ServingConfig identifier. For 2205 // example, for a ServingConfig with full name: 2206 // `projects/*/locations/global/catalogs/default_catalog/servingConfigs/my_candi 2207 // date_config`, this would be `my_candidate_config`. 2208 ServingConfigId string `json:"servingConfigId,omitempty"` 2209 // ForceSendFields is a list of field names (e.g. "ServingConfigId") to 2210 // unconditionally include in API requests. By default, fields with empty or 2211 // default values are omitted from API requests. See 2212 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2213 // details. 2214 ForceSendFields []string `json:"-"` 2215 // NullFields is a list of field names (e.g. "ServingConfigId") to include in 2216 // API requests with the JSON null value. By default, fields with empty values 2217 // are omitted from API requests. See 2218 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2219 NullFields []string `json:"-"` 2220 } 2221 2222 func (s *GoogleCloudRetailV2alphaModelPageOptimizationConfigCandidate) MarshalJSON() ([]byte, error) { 2223 type NoMethod GoogleCloudRetailV2alphaModelPageOptimizationConfigCandidate 2224 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2225 } 2226 2227 // GoogleCloudRetailV2alphaModelPageOptimizationConfigPanel: An individual 2228 // panel with a list of ServingConfigs to consider for it. 2229 type GoogleCloudRetailV2alphaModelPageOptimizationConfigPanel struct { 2230 // Candidates: Required. The candidates to consider on the panel. 2231 Candidates []*GoogleCloudRetailV2alphaModelPageOptimizationConfigCandidate `json:"candidates,omitempty"` 2232 // DefaultCandidate: Required. The default candidate. If the model fails at 2233 // serving time, we fall back to the default. 2234 DefaultCandidate *GoogleCloudRetailV2alphaModelPageOptimizationConfigCandidate `json:"defaultCandidate,omitempty"` 2235 // DisplayName: Optional. The name to display for the panel. 2236 DisplayName string `json:"displayName,omitempty"` 2237 // ForceSendFields is a list of field names (e.g. "Candidates") to 2238 // unconditionally include in API requests. By default, fields with empty or 2239 // default values are omitted from API requests. See 2240 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2241 // details. 2242 ForceSendFields []string `json:"-"` 2243 // NullFields is a list of field names (e.g. "Candidates") to include in API 2244 // requests with the JSON null value. By default, fields with empty values are 2245 // omitted from API requests. See 2246 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2247 NullFields []string `json:"-"` 2248 } 2249 2250 func (s *GoogleCloudRetailV2alphaModelPageOptimizationConfigPanel) MarshalJSON() ([]byte, error) { 2251 type NoMethod GoogleCloudRetailV2alphaModelPageOptimizationConfigPanel 2252 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2253 } 2254 2255 // GoogleCloudRetailV2alphaModelServingConfigList: Represents an ordered 2256 // combination of valid serving configs, which can be used for 2257 // `PAGE_OPTIMIZATION` recommendations. 2258 type GoogleCloudRetailV2alphaModelServingConfigList struct { 2259 // ServingConfigIds: Optional. A set of valid serving configs that may be used 2260 // for `PAGE_OPTIMIZATION`. 2261 ServingConfigIds []string `json:"servingConfigIds,omitempty"` 2262 // ForceSendFields is a list of field names (e.g. "ServingConfigIds") to 2263 // unconditionally include in API requests. By default, fields with empty or 2264 // default values are omitted from API requests. See 2265 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2266 // details. 2267 ForceSendFields []string `json:"-"` 2268 // NullFields is a list of field names (e.g. "ServingConfigIds") to include in 2269 // API requests with the JSON null value. By default, fields with empty values 2270 // are omitted from API requests. See 2271 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2272 NullFields []string `json:"-"` 2273 } 2274 2275 func (s *GoogleCloudRetailV2alphaModelServingConfigList) MarshalJSON() ([]byte, error) { 2276 type NoMethod GoogleCloudRetailV2alphaModelServingConfigList 2277 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2278 } 2279 2280 // GoogleCloudRetailV2alphaOutputResult: Output result that stores the 2281 // information about where the exported data is stored. 2282 type GoogleCloudRetailV2alphaOutputResult struct { 2283 // BigqueryResult: The BigQuery location where the result is stored. 2284 BigqueryResult []*GoogleCloudRetailV2alphaBigQueryOutputResult `json:"bigqueryResult,omitempty"` 2285 // GcsResult: The Google Cloud Storage location where the result is stored. 2286 GcsResult []*GoogleCloudRetailV2alphaGcsOutputResult `json:"gcsResult,omitempty"` 2287 // ForceSendFields is a list of field names (e.g. "BigqueryResult") to 2288 // unconditionally include in API requests. By default, fields with empty or 2289 // default values are omitted from API requests. See 2290 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2291 // details. 2292 ForceSendFields []string `json:"-"` 2293 // NullFields is a list of field names (e.g. "BigqueryResult") to include in 2294 // API requests with the JSON null value. By default, fields with empty values 2295 // are omitted from API requests. See 2296 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2297 NullFields []string `json:"-"` 2298 } 2299 2300 func (s *GoogleCloudRetailV2alphaOutputResult) MarshalJSON() ([]byte, error) { 2301 type NoMethod GoogleCloudRetailV2alphaOutputResult 2302 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2303 } 2304 2305 // GoogleCloudRetailV2alphaPurgeMetadata: Metadata related to the progress of 2306 // the Purge operation. This will be returned by the 2307 // google.longrunning.Operation.metadata field. 2308 type GoogleCloudRetailV2alphaPurgeMetadata struct { 2309 } 2310 2311 // GoogleCloudRetailV2alphaPurgeProductsMetadata: Metadata related to the 2312 // progress of the PurgeProducts operation. This will be returned by the 2313 // google.longrunning.Operation.metadata field. 2314 type GoogleCloudRetailV2alphaPurgeProductsMetadata struct { 2315 // CreateTime: Operation create time. 2316 CreateTime string `json:"createTime,omitempty"` 2317 // FailureCount: Count of entries that encountered errors while processing. 2318 FailureCount int64 `json:"failureCount,omitempty,string"` 2319 // SuccessCount: Count of entries that were deleted successfully. 2320 SuccessCount int64 `json:"successCount,omitempty,string"` 2321 // UpdateTime: Operation last update time. If the operation is done, this is 2322 // also the finish time. 2323 UpdateTime string `json:"updateTime,omitempty"` 2324 // ForceSendFields is a list of field names (e.g. "CreateTime") to 2325 // unconditionally include in API requests. By default, fields with empty or 2326 // default values are omitted from API requests. See 2327 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2328 // details. 2329 ForceSendFields []string `json:"-"` 2330 // NullFields is a list of field names (e.g. "CreateTime") to include in API 2331 // requests with the JSON null value. By default, fields with empty values are 2332 // omitted from API requests. See 2333 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2334 NullFields []string `json:"-"` 2335 } 2336 2337 func (s *GoogleCloudRetailV2alphaPurgeProductsMetadata) MarshalJSON() ([]byte, error) { 2338 type NoMethod GoogleCloudRetailV2alphaPurgeProductsMetadata 2339 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2340 } 2341 2342 // GoogleCloudRetailV2alphaPurgeProductsResponse: Response of the 2343 // PurgeProductsRequest. If the long running operation is successfully done, 2344 // then this message is returned by the google.longrunning.Operations.response 2345 // field. 2346 type GoogleCloudRetailV2alphaPurgeProductsResponse struct { 2347 // PurgeCount: The total count of products purged as a result of the operation. 2348 PurgeCount int64 `json:"purgeCount,omitempty,string"` 2349 // PurgeSample: A sample of the product names that will be deleted. Only 2350 // populated if `force` is set to false. A max of 100 names will be returned 2351 // and the names are chosen at random. 2352 PurgeSample []string `json:"purgeSample,omitempty"` 2353 // ForceSendFields is a list of field names (e.g. "PurgeCount") to 2354 // unconditionally include in API requests. By default, fields with empty or 2355 // default values are omitted from API requests. See 2356 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2357 // details. 2358 ForceSendFields []string `json:"-"` 2359 // NullFields is a list of field names (e.g. "PurgeCount") to include in API 2360 // requests with the JSON null value. By default, fields with empty values are 2361 // omitted from API requests. See 2362 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2363 NullFields []string `json:"-"` 2364 } 2365 2366 func (s *GoogleCloudRetailV2alphaPurgeProductsResponse) MarshalJSON() ([]byte, error) { 2367 type NoMethod GoogleCloudRetailV2alphaPurgeProductsResponse 2368 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2369 } 2370 2371 // GoogleCloudRetailV2alphaPurgeUserEventsResponse: Response of the 2372 // PurgeUserEventsRequest. If the long running operation is successfully done, 2373 // then this message is returned by the google.longrunning.Operations.response 2374 // field. 2375 type GoogleCloudRetailV2alphaPurgeUserEventsResponse struct { 2376 // PurgedEventsCount: The total count of events purged as a result of the 2377 // operation. 2378 PurgedEventsCount int64 `json:"purgedEventsCount,omitempty,string"` 2379 // ForceSendFields is a list of field names (e.g. "PurgedEventsCount") to 2380 // unconditionally include in API requests. By default, fields with empty or 2381 // default values are omitted from API requests. See 2382 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2383 // details. 2384 ForceSendFields []string `json:"-"` 2385 // NullFields is a list of field names (e.g. "PurgedEventsCount") to include in 2386 // API requests with the JSON null value. By default, fields with empty values 2387 // are omitted from API requests. See 2388 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2389 NullFields []string `json:"-"` 2390 } 2391 2392 func (s *GoogleCloudRetailV2alphaPurgeUserEventsResponse) MarshalJSON() ([]byte, error) { 2393 type NoMethod GoogleCloudRetailV2alphaPurgeUserEventsResponse 2394 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2395 } 2396 2397 // GoogleCloudRetailV2alphaRejoinUserEventsMetadata: Metadata for 2398 // `RejoinUserEvents` method. 2399 type GoogleCloudRetailV2alphaRejoinUserEventsMetadata struct { 2400 } 2401 2402 // GoogleCloudRetailV2alphaRejoinUserEventsResponse: Response message for 2403 // `RejoinUserEvents` method. 2404 type GoogleCloudRetailV2alphaRejoinUserEventsResponse struct { 2405 // RejoinedUserEventsCount: Number of user events that were joined with latest 2406 // product catalog. 2407 RejoinedUserEventsCount int64 `json:"rejoinedUserEventsCount,omitempty,string"` 2408 // ForceSendFields is a list of field names (e.g. "RejoinedUserEventsCount") to 2409 // unconditionally include in API requests. By default, fields with empty or 2410 // default values are omitted from API requests. See 2411 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2412 // details. 2413 ForceSendFields []string `json:"-"` 2414 // NullFields is a list of field names (e.g. "RejoinedUserEventsCount") to 2415 // include in API requests with the JSON null value. By default, fields with 2416 // empty values are omitted from API requests. See 2417 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2418 NullFields []string `json:"-"` 2419 } 2420 2421 func (s *GoogleCloudRetailV2alphaRejoinUserEventsResponse) MarshalJSON() ([]byte, error) { 2422 type NoMethod GoogleCloudRetailV2alphaRejoinUserEventsResponse 2423 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2424 } 2425 2426 // GoogleCloudRetailV2alphaRemoveFulfillmentPlacesMetadata: Metadata related to 2427 // the progress of the RemoveFulfillmentPlaces operation. Currently empty 2428 // because there is no meaningful metadata populated from the 2429 // ProductService.RemoveFulfillmentPlaces method. 2430 type GoogleCloudRetailV2alphaRemoveFulfillmentPlacesMetadata struct { 2431 } 2432 2433 // GoogleCloudRetailV2alphaRemoveFulfillmentPlacesResponse: Response of the 2434 // RemoveFulfillmentPlacesRequest. Currently empty because there is no 2435 // meaningful response populated from the 2436 // ProductService.RemoveFulfillmentPlaces method. 2437 type GoogleCloudRetailV2alphaRemoveFulfillmentPlacesResponse struct { 2438 } 2439 2440 // GoogleCloudRetailV2alphaRemoveLocalInventoriesMetadata: Metadata related to 2441 // the progress of the RemoveLocalInventories operation. Currently empty 2442 // because there is no meaningful metadata populated from the 2443 // ProductService.RemoveLocalInventories method. 2444 type GoogleCloudRetailV2alphaRemoveLocalInventoriesMetadata struct { 2445 } 2446 2447 // GoogleCloudRetailV2alphaRemoveLocalInventoriesResponse: Response of the 2448 // ProductService.RemoveLocalInventories API. Currently empty because there is 2449 // no meaningful response populated from the 2450 // ProductService.RemoveLocalInventories method. 2451 type GoogleCloudRetailV2alphaRemoveLocalInventoriesResponse struct { 2452 } 2453 2454 // GoogleCloudRetailV2alphaSetInventoryMetadata: Metadata related to the 2455 // progress of the SetInventory operation. Currently empty because there is no 2456 // meaningful metadata populated from the ProductService.SetInventory method. 2457 type GoogleCloudRetailV2alphaSetInventoryMetadata struct { 2458 } 2459 2460 // GoogleCloudRetailV2alphaSetInventoryResponse: Response of the 2461 // SetInventoryRequest. Currently empty because there is no meaningful response 2462 // populated from the ProductService.SetInventory method. 2463 type GoogleCloudRetailV2alphaSetInventoryResponse struct { 2464 } 2465 2466 // GoogleCloudRetailV2alphaTransformedUserEventsMetadata: Metadata related to 2467 // transform user events operation. 2468 type GoogleCloudRetailV2alphaTransformedUserEventsMetadata struct { 2469 // SourceEventsCount: Count of entries in the source user events BigQuery 2470 // table. 2471 SourceEventsCount int64 `json:"sourceEventsCount,omitempty,string"` 2472 // TransformedEventsCount: Count of entries in the transformed user events 2473 // BigQuery table, which could be different from the actually imported number 2474 // of user events. 2475 TransformedEventsCount int64 `json:"transformedEventsCount,omitempty,string"` 2476 // ForceSendFields is a list of field names (e.g. "SourceEventsCount") to 2477 // unconditionally include in API requests. By default, fields with empty or 2478 // default values are omitted from API requests. See 2479 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2480 // details. 2481 ForceSendFields []string `json:"-"` 2482 // NullFields is a list of field names (e.g. "SourceEventsCount") to include in 2483 // API requests with the JSON null value. By default, fields with empty values 2484 // are omitted from API requests. See 2485 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2486 NullFields []string `json:"-"` 2487 } 2488 2489 func (s *GoogleCloudRetailV2alphaTransformedUserEventsMetadata) MarshalJSON() ([]byte, error) { 2490 type NoMethod GoogleCloudRetailV2alphaTransformedUserEventsMetadata 2491 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2492 } 2493 2494 // GoogleCloudRetailV2alphaTuneModelMetadata: Metadata associated with a tune 2495 // operation. 2496 type GoogleCloudRetailV2alphaTuneModelMetadata struct { 2497 // Model: The resource name of the model that this tune applies to. Format: 2498 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/mode 2499 // ls/{model_id}` 2500 Model string `json:"model,omitempty"` 2501 // ForceSendFields is a list of field names (e.g. "Model") to unconditionally 2502 // include in API requests. By default, fields with empty or default values are 2503 // omitted from API requests. See 2504 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2505 // details. 2506 ForceSendFields []string `json:"-"` 2507 // NullFields is a list of field names (e.g. "Model") to include in API 2508 // requests with the JSON null value. By default, fields with empty values are 2509 // omitted from API requests. See 2510 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2511 NullFields []string `json:"-"` 2512 } 2513 2514 func (s *GoogleCloudRetailV2alphaTuneModelMetadata) MarshalJSON() ([]byte, error) { 2515 type NoMethod GoogleCloudRetailV2alphaTuneModelMetadata 2516 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2517 } 2518 2519 // GoogleCloudRetailV2alphaTuneModelResponse: Response associated with a tune 2520 // operation. 2521 type GoogleCloudRetailV2alphaTuneModelResponse struct { 2522 } 2523 2524 // GoogleCloudRetailV2alphaUserEventImportSummary: A summary of import result. 2525 // The UserEventImportSummary summarizes the import status for user events. 2526 type GoogleCloudRetailV2alphaUserEventImportSummary struct { 2527 // JoinedEventsCount: Count of user events imported with complete existing 2528 // catalog information. 2529 JoinedEventsCount int64 `json:"joinedEventsCount,omitempty,string"` 2530 // UnjoinedEventsCount: Count of user events imported, but with catalog 2531 // information not found in the imported catalog. 2532 UnjoinedEventsCount int64 `json:"unjoinedEventsCount,omitempty,string"` 2533 // ForceSendFields is a list of field names (e.g. "JoinedEventsCount") to 2534 // unconditionally include in API requests. By default, fields with empty or 2535 // default values are omitted from API requests. See 2536 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2537 // details. 2538 ForceSendFields []string `json:"-"` 2539 // NullFields is a list of field names (e.g. "JoinedEventsCount") to include in 2540 // API requests with the JSON null value. By default, fields with empty values 2541 // are omitted from API requests. See 2542 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2543 NullFields []string `json:"-"` 2544 } 2545 2546 func (s *GoogleCloudRetailV2alphaUserEventImportSummary) MarshalJSON() ([]byte, error) { 2547 type NoMethod GoogleCloudRetailV2alphaUserEventImportSummary 2548 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2549 } 2550 2551 // GoogleCloudRetailV2betaAddCatalogAttributeRequest: Request for 2552 // CatalogService.AddCatalogAttribute method. 2553 type GoogleCloudRetailV2betaAddCatalogAttributeRequest struct { 2554 // CatalogAttribute: Required. The CatalogAttribute to add. 2555 CatalogAttribute *GoogleCloudRetailV2betaCatalogAttribute `json:"catalogAttribute,omitempty"` 2556 // ForceSendFields is a list of field names (e.g. "CatalogAttribute") to 2557 // unconditionally include in API requests. By default, fields with empty or 2558 // default values are omitted from API requests. See 2559 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2560 // details. 2561 ForceSendFields []string `json:"-"` 2562 // NullFields is a list of field names (e.g. "CatalogAttribute") to include in 2563 // API requests with the JSON null value. By default, fields with empty values 2564 // are omitted from API requests. See 2565 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2566 NullFields []string `json:"-"` 2567 } 2568 2569 func (s *GoogleCloudRetailV2betaAddCatalogAttributeRequest) MarshalJSON() ([]byte, error) { 2570 type NoMethod GoogleCloudRetailV2betaAddCatalogAttributeRequest 2571 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2572 } 2573 2574 // GoogleCloudRetailV2betaAddControlRequest: Request for AddControl method. 2575 type GoogleCloudRetailV2betaAddControlRequest struct { 2576 // ControlId: Required. The id of the control to apply. Assumed to be in the 2577 // same catalog as the serving config - if id is not found a NOT_FOUND error is 2578 // returned. 2579 ControlId string `json:"controlId,omitempty"` 2580 // ForceSendFields is a list of field names (e.g. "ControlId") to 2581 // unconditionally include in API requests. By default, fields with empty or 2582 // default values are omitted from API requests. See 2583 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2584 // details. 2585 ForceSendFields []string `json:"-"` 2586 // NullFields is a list of field names (e.g. "ControlId") to include in API 2587 // requests with the JSON null value. By default, fields with empty values are 2588 // omitted from API requests. See 2589 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2590 NullFields []string `json:"-"` 2591 } 2592 2593 func (s *GoogleCloudRetailV2betaAddControlRequest) MarshalJSON() ([]byte, error) { 2594 type NoMethod GoogleCloudRetailV2betaAddControlRequest 2595 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2596 } 2597 2598 // GoogleCloudRetailV2betaAddFulfillmentPlacesMetadata: Metadata related to the 2599 // progress of the AddFulfillmentPlaces operation. Currently empty because 2600 // there is no meaningful metadata populated from the 2601 // ProductService.AddFulfillmentPlaces method. 2602 type GoogleCloudRetailV2betaAddFulfillmentPlacesMetadata struct { 2603 } 2604 2605 // GoogleCloudRetailV2betaAddFulfillmentPlacesRequest: Request message for 2606 // ProductService.AddFulfillmentPlaces method. 2607 type GoogleCloudRetailV2betaAddFulfillmentPlacesRequest struct { 2608 // AddTime: The time when the fulfillment updates are issued, used to prevent 2609 // out-of-order updates on fulfillment information. If not provided, the 2610 // internal system time will be used. 2611 AddTime string `json:"addTime,omitempty"` 2612 // AllowMissing: If set to true, and the Product is not found, the fulfillment 2613 // information will still be processed and retained for at most 1 day and 2614 // processed once the Product is created. If set to false, a NOT_FOUND error is 2615 // returned if the Product is not found. 2616 AllowMissing bool `json:"allowMissing,omitempty"` 2617 // PlaceIds: Required. The IDs for this type, such as the store IDs for 2618 // "pickup-in-store" or the region IDs for "same-day-delivery" to be added for 2619 // this type. Duplicate IDs will be automatically ignored. At least 1 value is 2620 // required, and a maximum of 2000 values are allowed. Each value must be a 2621 // string with a length limit of 10 characters, matching the pattern 2622 // `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an 2623 // INVALID_ARGUMENT error is returned. If the total number of place IDs exceeds 2624 // 2000 for this type after adding, then the update will be rejected. 2625 PlaceIds []string `json:"placeIds,omitempty"` 2626 // Type: Required. The fulfillment type, including commonly used types (such as 2627 // pickup in store and same day delivery), and custom types. Supported values: 2628 // * "pickup-in-store" * "ship-to-store" * "same-day-delivery" * 2629 // "next-day-delivery" * "custom-type-1" * "custom-type-2" * "custom-type-3" * 2630 // "custom-type-4" * "custom-type-5" If this field is set to an invalid value 2631 // other than these, an INVALID_ARGUMENT error is returned. This field directly 2632 // corresponds to Product.fulfillment_info.type. 2633 Type string `json:"type,omitempty"` 2634 // ForceSendFields is a list of field names (e.g. "AddTime") to unconditionally 2635 // include in API requests. By default, fields with empty or default values are 2636 // omitted from API requests. See 2637 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2638 // details. 2639 ForceSendFields []string `json:"-"` 2640 // NullFields is a list of field names (e.g. "AddTime") to include in API 2641 // requests with the JSON null value. By default, fields with empty values are 2642 // omitted from API requests. See 2643 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2644 NullFields []string `json:"-"` 2645 } 2646 2647 func (s *GoogleCloudRetailV2betaAddFulfillmentPlacesRequest) MarshalJSON() ([]byte, error) { 2648 type NoMethod GoogleCloudRetailV2betaAddFulfillmentPlacesRequest 2649 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2650 } 2651 2652 // GoogleCloudRetailV2betaAddFulfillmentPlacesResponse: Response of the 2653 // AddFulfillmentPlacesRequest. Currently empty because there is no meaningful 2654 // response populated from the ProductService.AddFulfillmentPlaces method. 2655 type GoogleCloudRetailV2betaAddFulfillmentPlacesResponse struct { 2656 } 2657 2658 // GoogleCloudRetailV2betaAddLocalInventoriesMetadata: Metadata related to the 2659 // progress of the AddLocalInventories operation. Currently empty because there 2660 // is no meaningful metadata populated from the 2661 // ProductService.AddLocalInventories method. 2662 type GoogleCloudRetailV2betaAddLocalInventoriesMetadata struct { 2663 } 2664 2665 // GoogleCloudRetailV2betaAddLocalInventoriesRequest: Request message for 2666 // ProductService.AddLocalInventories method. 2667 type GoogleCloudRetailV2betaAddLocalInventoriesRequest struct { 2668 // AddMask: Indicates which inventory fields in the provided list of 2669 // LocalInventory to update. The field is updated to the provided value. If a 2670 // field is set while the place does not have a previous local inventory, the 2671 // local inventory at that store is created. If a field is set while the value 2672 // of that field is not provided, the original field value, if it exists, is 2673 // deleted. If the mask is not set or set with empty paths, all inventory 2674 // fields will be updated. If an unsupported or unknown field is provided, an 2675 // INVALID_ARGUMENT error is returned and the entire update will be ignored. 2676 AddMask string `json:"addMask,omitempty"` 2677 // AddTime: The time when the inventory updates are issued. Used to prevent 2678 // out-of-order updates on local inventory fields. If not provided, the 2679 // internal system time will be used. 2680 AddTime string `json:"addTime,omitempty"` 2681 // AllowMissing: If set to true, and the Product is not found, the local 2682 // inventory will still be processed and retained for at most 1 day and 2683 // processed once the Product is created. If set to false, a NOT_FOUND error is 2684 // returned if the Product is not found. 2685 AllowMissing bool `json:"allowMissing,omitempty"` 2686 // LocalInventories: Required. A list of inventory information at difference 2687 // places. Each place is identified by its place ID. At most 3000 inventories 2688 // are allowed per request. 2689 LocalInventories []*GoogleCloudRetailV2betaLocalInventory `json:"localInventories,omitempty"` 2690 // ForceSendFields is a list of field names (e.g. "AddMask") to unconditionally 2691 // include in API requests. By default, fields with empty or default values are 2692 // omitted from API requests. See 2693 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2694 // details. 2695 ForceSendFields []string `json:"-"` 2696 // NullFields is a list of field names (e.g. "AddMask") to include in API 2697 // requests with the JSON null value. By default, fields with empty values are 2698 // omitted from API requests. See 2699 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2700 NullFields []string `json:"-"` 2701 } 2702 2703 func (s *GoogleCloudRetailV2betaAddLocalInventoriesRequest) MarshalJSON() ([]byte, error) { 2704 type NoMethod GoogleCloudRetailV2betaAddLocalInventoriesRequest 2705 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2706 } 2707 2708 // GoogleCloudRetailV2betaAddLocalInventoriesResponse: Response of the 2709 // ProductService.AddLocalInventories API. Currently empty because there is no 2710 // meaningful response populated from the ProductService.AddLocalInventories 2711 // method. 2712 type GoogleCloudRetailV2betaAddLocalInventoriesResponse struct { 2713 } 2714 2715 // GoogleCloudRetailV2betaAttributesConfig: Catalog level attribute config. 2716 type GoogleCloudRetailV2betaAttributesConfig struct { 2717 // AttributeConfigLevel: Output only. The AttributeConfigLevel used for this 2718 // catalog. 2719 // 2720 // Possible values: 2721 // "ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED" - Value used when unset. In this 2722 // case, server behavior defaults to CATALOG_LEVEL_ATTRIBUTE_CONFIG. 2723 // "PRODUCT_LEVEL_ATTRIBUTE_CONFIG" - At this level, we honor the attribute 2724 // configurations set in Product.attributes. 2725 // "CATALOG_LEVEL_ATTRIBUTE_CONFIG" - At this level, we honor the attribute 2726 // configurations set in CatalogConfig.attribute_configs. 2727 AttributeConfigLevel string `json:"attributeConfigLevel,omitempty"` 2728 // CatalogAttributes: Enable attribute(s) config at catalog level. For example, 2729 // indexable, dynamic_facetable, or searchable for each attribute. The key is 2730 // catalog attribute's name. For example: `color`, `brands`, 2731 // `attributes.custom_attribute`, such as `attributes.xyz`. The maximum number 2732 // of catalog attributes allowed in a request is 1000. 2733 CatalogAttributes map[string]GoogleCloudRetailV2betaCatalogAttribute `json:"catalogAttributes,omitempty"` 2734 // Name: Required. Immutable. The fully qualified resource name of the 2735 // attribute config. Format: 2736 // `projects/*/locations/*/catalogs/*/attributesConfig` 2737 Name string `json:"name,omitempty"` 2738 2739 // ServerResponse contains the HTTP response code and headers from the server. 2740 googleapi.ServerResponse `json:"-"` 2741 // ForceSendFields is a list of field names (e.g. "AttributeConfigLevel") to 2742 // unconditionally include in API requests. By default, fields with empty or 2743 // default values are omitted from API requests. See 2744 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2745 // details. 2746 ForceSendFields []string `json:"-"` 2747 // NullFields is a list of field names (e.g. "AttributeConfigLevel") to include 2748 // in API requests with the JSON null value. By default, fields with empty 2749 // values are omitted from API requests. See 2750 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2751 NullFields []string `json:"-"` 2752 } 2753 2754 func (s *GoogleCloudRetailV2betaAttributesConfig) MarshalJSON() ([]byte, error) { 2755 type NoMethod GoogleCloudRetailV2betaAttributesConfig 2756 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2757 } 2758 2759 // GoogleCloudRetailV2betaAudience: An intended audience of the Product for 2760 // whom it's sold. 2761 type GoogleCloudRetailV2betaAudience struct { 2762 // AgeGroups: The age groups of the audience. Strongly encouraged to use the 2763 // standard values: "newborn" (up to 3 months old), "infant" (3–12 months 2764 // old), "toddler" (1–5 years old), "kids" (5–13 years old), "adult" 2765 // (typically teens or older). At most 5 values are allowed. Each value must be 2766 // a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an 2767 // INVALID_ARGUMENT error is returned. Google Merchant Center property 2768 // age_group (https://support.google.com/merchants/answer/6324463). Schema.org 2769 // property Product.audience.suggestedMinAge 2770 // (https://schema.org/suggestedMinAge) and Product.audience.suggestedMaxAge 2771 // (https://schema.org/suggestedMaxAge). 2772 AgeGroups []string `json:"ageGroups,omitempty"` 2773 // Genders: The genders of the audience. Strongly encouraged to use the 2774 // standard values: "male", "female", "unisex". At most 5 values are allowed. 2775 // Each value must be a UTF-8 encoded string with a length limit of 128 2776 // characters. Otherwise, an INVALID_ARGUMENT error is returned. Google 2777 // Merchant Center property gender 2778 // (https://support.google.com/merchants/answer/6324479). Schema.org property 2779 // Product.audience.suggestedGender (https://schema.org/suggestedGender). 2780 Genders []string `json:"genders,omitempty"` 2781 // ForceSendFields is a list of field names (e.g. "AgeGroups") to 2782 // unconditionally include in API requests. By default, fields with empty or 2783 // default values are omitted from API requests. See 2784 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2785 // details. 2786 ForceSendFields []string `json:"-"` 2787 // NullFields is a list of field names (e.g. "AgeGroups") to include in API 2788 // requests with the JSON null value. By default, fields with empty values are 2789 // omitted from API requests. See 2790 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2791 NullFields []string `json:"-"` 2792 } 2793 2794 func (s *GoogleCloudRetailV2betaAudience) MarshalJSON() ([]byte, error) { 2795 type NoMethod GoogleCloudRetailV2betaAudience 2796 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2797 } 2798 2799 // GoogleCloudRetailV2betaBatchRemoveCatalogAttributesRequest: Request for 2800 // CatalogService.BatchRemoveCatalogAttributes method. 2801 type GoogleCloudRetailV2betaBatchRemoveCatalogAttributesRequest struct { 2802 // AttributeKeys: Required. The attribute name keys of the CatalogAttributes to 2803 // delete. A maximum of 1000 catalog attributes can be deleted in a batch. 2804 AttributeKeys []string `json:"attributeKeys,omitempty"` 2805 // ForceSendFields is a list of field names (e.g. "AttributeKeys") to 2806 // unconditionally include in API requests. By default, fields with empty or 2807 // default values are omitted from API requests. See 2808 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2809 // details. 2810 ForceSendFields []string `json:"-"` 2811 // NullFields is a list of field names (e.g. "AttributeKeys") to include in API 2812 // requests with the JSON null value. By default, fields with empty values are 2813 // omitted from API requests. See 2814 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2815 NullFields []string `json:"-"` 2816 } 2817 2818 func (s *GoogleCloudRetailV2betaBatchRemoveCatalogAttributesRequest) MarshalJSON() ([]byte, error) { 2819 type NoMethod GoogleCloudRetailV2betaBatchRemoveCatalogAttributesRequest 2820 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2821 } 2822 2823 // GoogleCloudRetailV2betaBatchRemoveCatalogAttributesResponse: Response of the 2824 // CatalogService.BatchRemoveCatalogAttributes. 2825 type GoogleCloudRetailV2betaBatchRemoveCatalogAttributesResponse struct { 2826 // DeletedCatalogAttributes: Catalog attributes that were deleted. Only 2827 // pre-loaded catalog attributes that are neither in use by products nor 2828 // predefined can be deleted. 2829 DeletedCatalogAttributes []string `json:"deletedCatalogAttributes,omitempty"` 2830 // ResetCatalogAttributes: Catalog attributes that were reset. Catalog 2831 // attributes that are either in use by products or are predefined attributes 2832 // cannot be deleted; however, their configuration properties will reset to 2833 // default values upon removal request. 2834 ResetCatalogAttributes []string `json:"resetCatalogAttributes,omitempty"` 2835 2836 // ServerResponse contains the HTTP response code and headers from the server. 2837 googleapi.ServerResponse `json:"-"` 2838 // ForceSendFields is a list of field names (e.g. "DeletedCatalogAttributes") 2839 // to unconditionally include in API requests. By default, fields with empty or 2840 // default values are omitted from API requests. See 2841 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2842 // details. 2843 ForceSendFields []string `json:"-"` 2844 // NullFields is a list of field names (e.g. "DeletedCatalogAttributes") to 2845 // include in API requests with the JSON null value. By default, fields with 2846 // empty values are omitted from API requests. See 2847 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2848 NullFields []string `json:"-"` 2849 } 2850 2851 func (s *GoogleCloudRetailV2betaBatchRemoveCatalogAttributesResponse) MarshalJSON() ([]byte, error) { 2852 type NoMethod GoogleCloudRetailV2betaBatchRemoveCatalogAttributesResponse 2853 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2854 } 2855 2856 // GoogleCloudRetailV2betaBigQueryOutputResult: A BigQuery output result. 2857 type GoogleCloudRetailV2betaBigQueryOutputResult struct { 2858 // DatasetId: The ID of a BigQuery Dataset. 2859 DatasetId string `json:"datasetId,omitempty"` 2860 // TableId: The ID of a BigQuery Table. 2861 TableId string `json:"tableId,omitempty"` 2862 // ForceSendFields is a list of field names (e.g. "DatasetId") to 2863 // unconditionally include in API requests. By default, fields with empty or 2864 // default values are omitted from API requests. See 2865 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2866 // details. 2867 ForceSendFields []string `json:"-"` 2868 // NullFields is a list of field names (e.g. "DatasetId") to include in API 2869 // requests with the JSON null value. By default, fields with empty values are 2870 // omitted from API requests. See 2871 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2872 NullFields []string `json:"-"` 2873 } 2874 2875 func (s *GoogleCloudRetailV2betaBigQueryOutputResult) MarshalJSON() ([]byte, error) { 2876 type NoMethod GoogleCloudRetailV2betaBigQueryOutputResult 2877 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2878 } 2879 2880 // GoogleCloudRetailV2betaBigQuerySource: BigQuery source import data from. 2881 type GoogleCloudRetailV2betaBigQuerySource struct { 2882 // DataSchema: The schema to use when parsing the data from the source. 2883 // Supported values for product imports: * `product` (default): One JSON 2884 // Product per line. Each product must have a valid Product.id. * 2885 // `product_merchant_center`: See Importing catalog data from Merchant Center 2886 // (https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc). 2887 // Supported values for user events imports: * `user_event` (default): One JSON 2888 // UserEvent per line. * `user_event_ga360`: The schema is available here: 2889 // https://support.google.com/analytics/answer/3437719. * `user_event_ga4`: The 2890 // schema is available here: 2891 // https://support.google.com/analytics/answer/7029846. Supported values for 2892 // autocomplete imports: * `suggestions` (default): One JSON completion 2893 // suggestion per line. * `denylist`: One JSON deny suggestion per line. * 2894 // `allowlist`: One JSON allow suggestion per line. 2895 DataSchema string `json:"dataSchema,omitempty"` 2896 // DatasetId: Required. The BigQuery data set to copy the data from with a 2897 // length limit of 1,024 characters. 2898 DatasetId string `json:"datasetId,omitempty"` 2899 // GcsStagingDir: Intermediate Cloud Storage directory used for the import with 2900 // a length limit of 2,000 characters. Can be specified if one wants to have 2901 // the BigQuery export to a specific Cloud Storage directory. 2902 GcsStagingDir string `json:"gcsStagingDir,omitempty"` 2903 // PartitionDate: BigQuery time partitioned table's _PARTITIONDATE in 2904 // YYYY-MM-DD format. Only supported in ImportProductsRequest. 2905 PartitionDate *GoogleTypeDate `json:"partitionDate,omitempty"` 2906 // ProjectId: The project ID (can be project # or ID) that the BigQuery source 2907 // is in with a length limit of 128 characters. If not specified, inherits the 2908 // project ID from the parent request. 2909 ProjectId string `json:"projectId,omitempty"` 2910 // TableId: Required. The BigQuery table to copy the data from with a length 2911 // limit of 1,024 characters. 2912 TableId string `json:"tableId,omitempty"` 2913 // ForceSendFields is a list of field names (e.g. "DataSchema") to 2914 // unconditionally include in API requests. By default, fields with empty or 2915 // default values are omitted from API requests. See 2916 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2917 // details. 2918 ForceSendFields []string `json:"-"` 2919 // NullFields is a list of field names (e.g. "DataSchema") to include in API 2920 // requests with the JSON null value. By default, fields with empty values are 2921 // omitted from API requests. See 2922 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2923 NullFields []string `json:"-"` 2924 } 2925 2926 func (s *GoogleCloudRetailV2betaBigQuerySource) MarshalJSON() ([]byte, error) { 2927 type NoMethod GoogleCloudRetailV2betaBigQuerySource 2928 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2929 } 2930 2931 // GoogleCloudRetailV2betaCatalog: The catalog configuration. 2932 type GoogleCloudRetailV2betaCatalog struct { 2933 // DisplayName: Required. Immutable. The catalog display name. This field must 2934 // be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, 2935 // an INVALID_ARGUMENT error is returned. 2936 DisplayName string `json:"displayName,omitempty"` 2937 // MerchantCenterLinkingConfig: The Merchant Center linking configuration. 2938 // After a link is added, the data stream from Merchant Center to Cloud Retail 2939 // will be enabled automatically. The requester must have access to the 2940 // Merchant Center account in order to make changes to this field. 2941 MerchantCenterLinkingConfig *GoogleCloudRetailV2betaMerchantCenterLinkingConfig `json:"merchantCenterLinkingConfig,omitempty"` 2942 // Name: Required. Immutable. The fully qualified resource name of the catalog. 2943 Name string `json:"name,omitempty"` 2944 // ProductLevelConfig: Required. The product level configuration. 2945 ProductLevelConfig *GoogleCloudRetailV2betaProductLevelConfig `json:"productLevelConfig,omitempty"` 2946 2947 // ServerResponse contains the HTTP response code and headers from the server. 2948 googleapi.ServerResponse `json:"-"` 2949 // ForceSendFields is a list of field names (e.g. "DisplayName") to 2950 // unconditionally include in API requests. By default, fields with empty or 2951 // default values are omitted from API requests. See 2952 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2953 // details. 2954 ForceSendFields []string `json:"-"` 2955 // NullFields is a list of field names (e.g. "DisplayName") to include in API 2956 // requests with the JSON null value. By default, fields with empty values are 2957 // omitted from API requests. See 2958 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2959 NullFields []string `json:"-"` 2960 } 2961 2962 func (s *GoogleCloudRetailV2betaCatalog) MarshalJSON() ([]byte, error) { 2963 type NoMethod GoogleCloudRetailV2betaCatalog 2964 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2965 } 2966 2967 // GoogleCloudRetailV2betaCatalogAttribute: Catalog level attribute config for 2968 // an attribute. For example, if customers want to enable/disable facet for a 2969 // specific attribute. 2970 type GoogleCloudRetailV2betaCatalogAttribute struct { 2971 // DynamicFacetableOption: If DYNAMIC_FACETABLE_ENABLED, attribute values are 2972 // available for dynamic facet. Could only be DYNAMIC_FACETABLE_DISABLED if 2973 // CatalogAttribute.indexable_option is INDEXABLE_DISABLED. Otherwise, an 2974 // INVALID_ARGUMENT error is returned. Must be specified, otherwise throws 2975 // INVALID_FORMAT error. 2976 // 2977 // Possible values: 2978 // "DYNAMIC_FACETABLE_OPTION_UNSPECIFIED" - Value used when unset. 2979 // "DYNAMIC_FACETABLE_ENABLED" - Dynamic facetable option enabled for an 2980 // attribute. 2981 // "DYNAMIC_FACETABLE_DISABLED" - Dynamic facetable option disabled for an 2982 // attribute. 2983 DynamicFacetableOption string `json:"dynamicFacetableOption,omitempty"` 2984 // ExactSearchableOption: If EXACT_SEARCHABLE_ENABLED, attribute values will be 2985 // exact searchable. This property only applies to textual custom attributes 2986 // and requires indexable set to enabled to enable exact-searchable. If unset, 2987 // the server behavior defaults to EXACT_SEARCHABLE_DISABLED. 2988 // 2989 // Possible values: 2990 // "EXACT_SEARCHABLE_OPTION_UNSPECIFIED" - Value used when unset. 2991 // "EXACT_SEARCHABLE_ENABLED" - Exact searchable option enabled for an 2992 // attribute. 2993 // "EXACT_SEARCHABLE_DISABLED" - Exact searchable option disabled for an 2994 // attribute. 2995 ExactSearchableOption string `json:"exactSearchableOption,omitempty"` 2996 // FacetConfig: Contains facet options. 2997 FacetConfig *GoogleCloudRetailV2betaCatalogAttributeFacetConfig `json:"facetConfig,omitempty"` 2998 // InUse: Output only. Indicates whether this attribute has been used by any 2999 // products. `True` if at least one Product is using this attribute in 3000 // Product.attributes. Otherwise, this field is `False`. CatalogAttribute can 3001 // be pre-loaded by using CatalogService.AddCatalogAttribute, 3002 // CatalogService.ImportCatalogAttributes, or 3003 // CatalogService.UpdateAttributesConfig APIs. This field is `False` for 3004 // pre-loaded CatalogAttributes. Only pre-loaded catalog attributes that are 3005 // neither in use by products nor predefined can be deleted. Catalog attributes 3006 // that are either in use by products or are predefined attributes cannot be 3007 // deleted; however, their configuration properties will reset to default 3008 // values upon removal request. After catalog changes, it takes about 10 3009 // minutes for this field to update. 3010 InUse bool `json:"inUse,omitempty"` 3011 // IndexableOption: When AttributesConfig.attribute_config_level is 3012 // CATALOG_LEVEL_ATTRIBUTE_CONFIG, if INDEXABLE_ENABLED attribute values are 3013 // indexed so that it can be filtered, faceted, or boosted in 3014 // SearchService.Search. Must be specified when 3015 // AttributesConfig.attribute_config_level is CATALOG_LEVEL_ATTRIBUTE_CONFIG, 3016 // otherwise throws INVALID_FORMAT error. 3017 // 3018 // Possible values: 3019 // "INDEXABLE_OPTION_UNSPECIFIED" - Value used when unset. 3020 // "INDEXABLE_ENABLED" - Indexable option enabled for an attribute. 3021 // "INDEXABLE_DISABLED" - Indexable option disabled for an attribute. 3022 IndexableOption string `json:"indexableOption,omitempty"` 3023 // Key: Required. Attribute name. For example: `color`, `brands`, 3024 // `attributes.custom_attribute`, such as `attributes.xyz`. To be indexable, 3025 // the attribute name can contain only alpha-numeric characters and 3026 // underscores. For example, an attribute named `attributes.abc_xyz` can be 3027 // indexed, but an attribute named `attributes.abc-xyz` cannot be indexed. If 3028 // the attribute key starts with `attributes.`, then the attribute is a custom 3029 // attribute. Attributes such as `brands`, `patterns`, and `title` are built-in 3030 // and called system attributes. 3031 Key string `json:"key,omitempty"` 3032 // RecommendationsFilteringOption: When AttributesConfig.attribute_config_level 3033 // is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if RECOMMENDATIONS_FILTERING_ENABLED, 3034 // attribute values are filterable for recommendations. This option works for 3035 // categorical features only, does not work for numerical features, inventory 3036 // filtering. 3037 // 3038 // Possible values: 3039 // "RECOMMENDATIONS_FILTERING_OPTION_UNSPECIFIED" - Value used when unset. In 3040 // this case, server behavior defaults to RECOMMENDATIONS_FILTERING_DISABLED. 3041 // "RECOMMENDATIONS_FILTERING_DISABLED" - Recommendation filtering is 3042 // disabled. 3043 // "RECOMMENDATIONS_FILTERING_ENABLED" - Recommendation filtering is enabled. 3044 RecommendationsFilteringOption string `json:"recommendationsFilteringOption,omitempty"` 3045 // RetrievableOption: If RETRIEVABLE_ENABLED, attribute values are retrievable 3046 // in the search results. If unset, the server behavior defaults to 3047 // RETRIEVABLE_DISABLED. 3048 // 3049 // Possible values: 3050 // "RETRIEVABLE_OPTION_UNSPECIFIED" - Value used when unset. 3051 // "RETRIEVABLE_ENABLED" - Retrievable option enabled for an attribute. 3052 // "RETRIEVABLE_DISABLED" - Retrievable option disabled for an attribute. 3053 RetrievableOption string `json:"retrievableOption,omitempty"` 3054 // SearchableOption: When AttributesConfig.attribute_config_level is 3055 // CATALOG_LEVEL_ATTRIBUTE_CONFIG, if SEARCHABLE_ENABLED, attribute values are 3056 // searchable by text queries in SearchService.Search. If SEARCHABLE_ENABLED 3057 // but attribute type is numerical, attribute values will not be searchable by 3058 // text queries in SearchService.Search, as there are no text values associated 3059 // to numerical attributes. Must be specified, when 3060 // AttributesConfig.attribute_config_level is CATALOG_LEVEL_ATTRIBUTE_CONFIG, 3061 // otherwise throws INVALID_FORMAT error. 3062 // 3063 // Possible values: 3064 // "SEARCHABLE_OPTION_UNSPECIFIED" - Value used when unset. 3065 // "SEARCHABLE_ENABLED" - Searchable option enabled for an attribute. 3066 // "SEARCHABLE_DISABLED" - Searchable option disabled for an attribute. 3067 SearchableOption string `json:"searchableOption,omitempty"` 3068 // Type: Output only. The type of this attribute. This is derived from the 3069 // attribute in Product.attributes. 3070 // 3071 // Possible values: 3072 // "UNKNOWN" - The type of the attribute is unknown. Used when type cannot be 3073 // derived from attribute that is not in_use. 3074 // "TEXTUAL" - Textual attribute. 3075 // "NUMERICAL" - Numerical attribute. 3076 Type string `json:"type,omitempty"` 3077 // ForceSendFields is a list of field names (e.g. "DynamicFacetableOption") to 3078 // unconditionally include in API requests. By default, fields with empty or 3079 // default values are omitted from API requests. See 3080 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3081 // details. 3082 ForceSendFields []string `json:"-"` 3083 // NullFields is a list of field names (e.g. "DynamicFacetableOption") to 3084 // include in API requests with the JSON null value. By default, fields with 3085 // empty values are omitted from API requests. See 3086 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3087 NullFields []string `json:"-"` 3088 } 3089 3090 func (s *GoogleCloudRetailV2betaCatalogAttribute) MarshalJSON() ([]byte, error) { 3091 type NoMethod GoogleCloudRetailV2betaCatalogAttribute 3092 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3093 } 3094 3095 // GoogleCloudRetailV2betaCatalogAttributeFacetConfig: Possible options for the 3096 // facet that corresponds to the current attribute config. 3097 type GoogleCloudRetailV2betaCatalogAttributeFacetConfig struct { 3098 // FacetIntervals: If you don't set the facet 3099 // SearchRequest.FacetSpec.FacetKey.intervals in the request to a numerical 3100 // attribute, then we use the computed intervals with rounded bounds obtained 3101 // from all its product numerical attribute values. The computed intervals 3102 // might not be ideal for some attributes. Therefore, we give you the option to 3103 // overwrite them with the facet_intervals field. The maximum of facet 3104 // intervals per CatalogAttribute is 40. Each interval must have a lower bound 3105 // or an upper bound. If both bounds are provided, then the lower bound must be 3106 // smaller or equal than the upper bound. 3107 FacetIntervals []*GoogleCloudRetailV2betaInterval `json:"facetIntervals,omitempty"` 3108 // IgnoredFacetValues: Each instance represents a list of attribute values to 3109 // ignore as facet values for a specific time range. The maximum number of 3110 // instances per CatalogAttribute is 25. 3111 IgnoredFacetValues []*GoogleCloudRetailV2betaCatalogAttributeFacetConfigIgnoredFacetValues `json:"ignoredFacetValues,omitempty"` 3112 // MergedFacet: Use this field only if you want to merge a facet key into 3113 // another facet key. 3114 MergedFacet *GoogleCloudRetailV2betaCatalogAttributeFacetConfigMergedFacet `json:"mergedFacet,omitempty"` 3115 // MergedFacetValues: Each instance replaces a list of facet values by a merged 3116 // facet value. If a facet value is not in any list, then it will stay the 3117 // same. To avoid conflicts, only paths of length 1 are accepted. In other 3118 // words, if "dark_blue" merged into "BLUE", then the latter can't merge into 3119 // "blues" because this would create a path of length 2. The maximum number of 3120 // instances of MergedFacetValue per CatalogAttribute is 100. This feature is 3121 // available only for textual custom attributes. 3122 MergedFacetValues []*GoogleCloudRetailV2betaCatalogAttributeFacetConfigMergedFacetValue `json:"mergedFacetValues,omitempty"` 3123 // RerankConfig: Set this field only if you want to rerank based on facet 3124 // values engaged by the user for the current key. This option is only possible 3125 // for custom facetable textual keys. 3126 RerankConfig *GoogleCloudRetailV2betaCatalogAttributeFacetConfigRerankConfig `json:"rerankConfig,omitempty"` 3127 // ForceSendFields is a list of field names (e.g. "FacetIntervals") to 3128 // unconditionally include in API requests. By default, fields with empty or 3129 // default values are omitted from API requests. See 3130 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3131 // details. 3132 ForceSendFields []string `json:"-"` 3133 // NullFields is a list of field names (e.g. "FacetIntervals") to include in 3134 // API requests with the JSON null value. By default, fields with empty values 3135 // are omitted from API requests. See 3136 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3137 NullFields []string `json:"-"` 3138 } 3139 3140 func (s *GoogleCloudRetailV2betaCatalogAttributeFacetConfig) MarshalJSON() ([]byte, error) { 3141 type NoMethod GoogleCloudRetailV2betaCatalogAttributeFacetConfig 3142 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3143 } 3144 3145 // GoogleCloudRetailV2betaCatalogAttributeFacetConfigIgnoredFacetValues: Facet 3146 // values to ignore on facets during the specified time range for the given 3147 // SearchResponse.Facet.key attribute. 3148 type GoogleCloudRetailV2betaCatalogAttributeFacetConfigIgnoredFacetValues struct { 3149 // EndTime: If start time is empty and end time is not empty, then ignore these 3150 // facet values before end time. 3151 EndTime string `json:"endTime,omitempty"` 3152 // StartTime: Time range for the current list of facet values to ignore. If 3153 // multiple time ranges are specified for an facet value for the current 3154 // attribute, consider all of them. If both are empty, ignore always. If start 3155 // time and end time are set, then start time must be before end time. If start 3156 // time is not empty and end time is empty, then will ignore these facet values 3157 // after the start time. 3158 StartTime string `json:"startTime,omitempty"` 3159 // Values: List of facet values to ignore for the following time range. The 3160 // facet values are the same as the attribute values. There is a limit of 10 3161 // values per instance of IgnoredFacetValues. Each value can have at most 128 3162 // characters. 3163 Values []string `json:"values,omitempty"` 3164 // ForceSendFields is a list of field names (e.g. "EndTime") to unconditionally 3165 // include in API requests. By default, fields with empty or default values are 3166 // omitted from API requests. See 3167 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3168 // details. 3169 ForceSendFields []string `json:"-"` 3170 // NullFields is a list of field names (e.g. "EndTime") to include in API 3171 // requests with the JSON null value. By default, fields with empty values are 3172 // omitted from API requests. See 3173 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3174 NullFields []string `json:"-"` 3175 } 3176 3177 func (s *GoogleCloudRetailV2betaCatalogAttributeFacetConfigIgnoredFacetValues) MarshalJSON() ([]byte, error) { 3178 type NoMethod GoogleCloudRetailV2betaCatalogAttributeFacetConfigIgnoredFacetValues 3179 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3180 } 3181 3182 // GoogleCloudRetailV2betaCatalogAttributeFacetConfigMergedFacet: The current 3183 // facet key (i.e. attribute config) maps into the merged_facet_key. A facet 3184 // key can have at most one child. The current facet key and the merged facet 3185 // key need both to be textual custom attributes or both numerical custom 3186 // attributes (same type). 3187 type GoogleCloudRetailV2betaCatalogAttributeFacetConfigMergedFacet struct { 3188 // MergedFacetKey: The merged facet key should be a valid facet key that is 3189 // different than the facet key of the current catalog attribute. We refer this 3190 // is merged facet key as the child of the current catalog attribute. This 3191 // merged facet key can't be a parent of another facet key (i.e. no directed 3192 // path of length 2). This merged facet key needs to be either a textual custom 3193 // attribute or a numerical custom attribute. 3194 MergedFacetKey string `json:"mergedFacetKey,omitempty"` 3195 // MergedFacetValues: Each instance is a list of facet values that map into the 3196 // same (possibly different) merged facet value. For the current attribute 3197 // config, each facet value should map to at most one merged facet value. 3198 MergedFacetValues []*GoogleCloudRetailV2betaCatalogAttributeFacetConfigMergedFacetValue `json:"mergedFacetValues,omitempty"` 3199 // ForceSendFields is a list of field names (e.g. "MergedFacetKey") to 3200 // unconditionally include in API requests. By default, fields with empty or 3201 // default values are omitted from API requests. See 3202 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3203 // details. 3204 ForceSendFields []string `json:"-"` 3205 // NullFields is a list of field names (e.g. "MergedFacetKey") to include in 3206 // API requests with the JSON null value. By default, fields with empty values 3207 // are omitted from API requests. See 3208 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3209 NullFields []string `json:"-"` 3210 } 3211 3212 func (s *GoogleCloudRetailV2betaCatalogAttributeFacetConfigMergedFacet) MarshalJSON() ([]byte, error) { 3213 type NoMethod GoogleCloudRetailV2betaCatalogAttributeFacetConfigMergedFacet 3214 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3215 } 3216 3217 // GoogleCloudRetailV2betaCatalogAttributeFacetConfigMergedFacetValue: Replaces 3218 // a set of textual facet values by the same (possibly different) merged facet 3219 // value. Each facet value should appear at most once as a value per 3220 // CatalogAttribute. This feature is available only for textual custom 3221 // attributes. 3222 type GoogleCloudRetailV2betaCatalogAttributeFacetConfigMergedFacetValue struct { 3223 // MergedValue: All the previous values are replaced by this merged facet 3224 // value. This merged_value must be non-empty and can have up to 128 3225 // characters. 3226 MergedValue string `json:"mergedValue,omitempty"` 3227 // Values: All the facet values that are replaces by the same merged_value that 3228 // follows. The maximum number of values per MergedFacetValue is 25. Each value 3229 // can have up to 128 characters. 3230 Values []string `json:"values,omitempty"` 3231 // ForceSendFields is a list of field names (e.g. "MergedValue") to 3232 // unconditionally include in API requests. By default, fields with empty or 3233 // default values are omitted from API requests. See 3234 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3235 // details. 3236 ForceSendFields []string `json:"-"` 3237 // NullFields is a list of field names (e.g. "MergedValue") to include in API 3238 // requests with the JSON null value. By default, fields with empty values are 3239 // omitted from API requests. See 3240 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3241 NullFields []string `json:"-"` 3242 } 3243 3244 func (s *GoogleCloudRetailV2betaCatalogAttributeFacetConfigMergedFacetValue) MarshalJSON() ([]byte, error) { 3245 type NoMethod GoogleCloudRetailV2betaCatalogAttributeFacetConfigMergedFacetValue 3246 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3247 } 3248 3249 // GoogleCloudRetailV2betaCatalogAttributeFacetConfigRerankConfig: Options to 3250 // rerank based on facet values engaged by the user for the current key. That 3251 // key needs to be a custom textual key and facetable. To use this control, you 3252 // also need to pass all the facet keys engaged by the user in the request 3253 // using the field [SearchRequest.FacetSpec]. In particular, if you don't pass 3254 // the facet keys engaged that you want to rerank on, this control won't be 3255 // effective. Moreover, to obtain better results, the facet values that you 3256 // want to rerank on should be close to English (ideally made of words, 3257 // underscores, and spaces). 3258 type GoogleCloudRetailV2betaCatalogAttributeFacetConfigRerankConfig struct { 3259 // FacetValues: If empty, rerank on all facet values for the current key. 3260 // Otherwise, will rerank on the facet values from this list only. 3261 FacetValues []string `json:"facetValues,omitempty"` 3262 // RerankFacet: If set to true, then we also rerank the dynamic facets based on 3263 // the facet values engaged by the user for the current attribute key during 3264 // serving. 3265 RerankFacet bool `json:"rerankFacet,omitempty"` 3266 // ForceSendFields is a list of field names (e.g. "FacetValues") to 3267 // unconditionally include in API requests. By default, fields with empty or 3268 // default values are omitted from API requests. See 3269 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3270 // details. 3271 ForceSendFields []string `json:"-"` 3272 // NullFields is a list of field names (e.g. "FacetValues") to include in API 3273 // requests with the JSON null value. By default, fields with empty values are 3274 // omitted from API requests. See 3275 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3276 NullFields []string `json:"-"` 3277 } 3278 3279 func (s *GoogleCloudRetailV2betaCatalogAttributeFacetConfigRerankConfig) MarshalJSON() ([]byte, error) { 3280 type NoMethod GoogleCloudRetailV2betaCatalogAttributeFacetConfigRerankConfig 3281 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3282 } 3283 3284 // GoogleCloudRetailV2betaColorInfo: The color information of a Product. 3285 type GoogleCloudRetailV2betaColorInfo struct { 3286 // ColorFamilies: The standard color families. Strongly recommended to use the 3287 // following standard color groups: "Red", "Pink", "Orange", "Yellow", 3288 // "Purple", "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and 3289 // "Mixed". Normally it is expected to have only 1 color family. May consider 3290 // using single "Mixed" instead of multiple values. A maximum of 5 values are 3291 // allowed. Each value must be a UTF-8 encoded string with a length limit of 3292 // 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. Google 3293 // Merchant Center property color 3294 // (https://support.google.com/merchants/answer/6324487). Schema.org property 3295 // Product.color (https://schema.org/color). 3296 ColorFamilies []string `json:"colorFamilies,omitempty"` 3297 // Colors: The color display names, which may be different from standard color 3298 // family names, such as the color aliases used in the website frontend. 3299 // Normally it is expected to have only 1 color. May consider using single 3300 // "Mixed" instead of multiple values. A maximum of 75 colors are allowed. Each 3301 // value must be a UTF-8 encoded string with a length limit of 128 characters. 3302 // Otherwise, an INVALID_ARGUMENT error is returned. Google Merchant Center 3303 // property color (https://support.google.com/merchants/answer/6324487). 3304 // Schema.org property Product.color (https://schema.org/color). 3305 Colors []string `json:"colors,omitempty"` 3306 // ForceSendFields is a list of field names (e.g. "ColorFamilies") to 3307 // unconditionally include in API requests. By default, fields with empty or 3308 // default values are omitted from API requests. See 3309 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3310 // details. 3311 ForceSendFields []string `json:"-"` 3312 // NullFields is a list of field names (e.g. "ColorFamilies") to include in API 3313 // requests with the JSON null value. By default, fields with empty values are 3314 // omitted from API requests. See 3315 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3316 NullFields []string `json:"-"` 3317 } 3318 3319 func (s *GoogleCloudRetailV2betaColorInfo) MarshalJSON() ([]byte, error) { 3320 type NoMethod GoogleCloudRetailV2betaColorInfo 3321 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3322 } 3323 3324 // GoogleCloudRetailV2betaCompleteQueryResponse: Response of the autocomplete 3325 // query. 3326 type GoogleCloudRetailV2betaCompleteQueryResponse struct { 3327 // AttributionToken: A unique complete token. This should be included in the 3328 // UserEvent.completion_detail for search events resulting from this 3329 // completion, which enables accurate attribution of complete model 3330 // performance. 3331 AttributionToken string `json:"attributionToken,omitempty"` 3332 // CompletionResults: Results of the matching suggestions. The result list is 3333 // ordered and the first result is top suggestion. 3334 CompletionResults []*GoogleCloudRetailV2betaCompleteQueryResponseCompletionResult `json:"completionResults,omitempty"` 3335 // RecentSearchResults: Deprecated. Matched recent searches of this user. The 3336 // maximum number of recent searches is 10. This field is a restricted feature. 3337 // If you want to enable it, contact Retail Search support. This feature is 3338 // only available when CompleteQueryRequest.visitor_id field is set and 3339 // UserEvent is imported. The recent searches satisfy the follow rules: * They 3340 // are ordered from latest to oldest. * They are matched with 3341 // CompleteQueryRequest.query case insensitively. * They are transformed to 3342 // lower case. * They are UTF-8 safe. Recent searches are deduplicated. More 3343 // recent searches will be reserved when duplication happens. 3344 RecentSearchResults []*GoogleCloudRetailV2betaCompleteQueryResponseRecentSearchResult `json:"recentSearchResults,omitempty"` 3345 3346 // ServerResponse contains the HTTP response code and headers from the server. 3347 googleapi.ServerResponse `json:"-"` 3348 // ForceSendFields is a list of field names (e.g. "AttributionToken") to 3349 // unconditionally include in API requests. By default, fields with empty or 3350 // default values are omitted from API requests. See 3351 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3352 // details. 3353 ForceSendFields []string `json:"-"` 3354 // NullFields is a list of field names (e.g. "AttributionToken") to include in 3355 // API requests with the JSON null value. By default, fields with empty values 3356 // are omitted from API requests. See 3357 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3358 NullFields []string `json:"-"` 3359 } 3360 3361 func (s *GoogleCloudRetailV2betaCompleteQueryResponse) MarshalJSON() ([]byte, error) { 3362 type NoMethod GoogleCloudRetailV2betaCompleteQueryResponse 3363 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3364 } 3365 3366 // GoogleCloudRetailV2betaCompleteQueryResponseCompletionResult: Resource that 3367 // represents completion results. 3368 type GoogleCloudRetailV2betaCompleteQueryResponseCompletionResult struct { 3369 // Attributes: Custom attributes for the suggestion term. * For "user-data", 3370 // the attributes are additional custom attributes ingested through BigQuery. * 3371 // For "cloud-retail", the attributes are product attributes generated by Cloud 3372 // Retail. It requires UserEvent.product_details is imported properly. 3373 Attributes map[string]GoogleCloudRetailV2betaCustomAttribute `json:"attributes,omitempty"` 3374 // Suggestion: The suggestion for the query. 3375 Suggestion string `json:"suggestion,omitempty"` 3376 // ForceSendFields is a list of field names (e.g. "Attributes") to 3377 // unconditionally include in API requests. By default, fields with empty or 3378 // default values are omitted from API requests. See 3379 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3380 // details. 3381 ForceSendFields []string `json:"-"` 3382 // NullFields is a list of field names (e.g. "Attributes") to include in API 3383 // requests with the JSON null value. By default, fields with empty values are 3384 // omitted from API requests. See 3385 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3386 NullFields []string `json:"-"` 3387 } 3388 3389 func (s *GoogleCloudRetailV2betaCompleteQueryResponseCompletionResult) MarshalJSON() ([]byte, error) { 3390 type NoMethod GoogleCloudRetailV2betaCompleteQueryResponseCompletionResult 3391 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3392 } 3393 3394 // GoogleCloudRetailV2betaCompleteQueryResponseRecentSearchResult: Recent 3395 // search of this user. 3396 type GoogleCloudRetailV2betaCompleteQueryResponseRecentSearchResult struct { 3397 // RecentSearch: The recent search query. 3398 RecentSearch string `json:"recentSearch,omitempty"` 3399 // ForceSendFields is a list of field names (e.g. "RecentSearch") to 3400 // unconditionally include in API requests. By default, fields with empty or 3401 // default values are omitted from API requests. See 3402 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3403 // details. 3404 ForceSendFields []string `json:"-"` 3405 // NullFields is a list of field names (e.g. "RecentSearch") to include in API 3406 // requests with the JSON null value. By default, fields with empty values are 3407 // omitted from API requests. See 3408 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3409 NullFields []string `json:"-"` 3410 } 3411 3412 func (s *GoogleCloudRetailV2betaCompleteQueryResponseRecentSearchResult) MarshalJSON() ([]byte, error) { 3413 type NoMethod GoogleCloudRetailV2betaCompleteQueryResponseRecentSearchResult 3414 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3415 } 3416 3417 // GoogleCloudRetailV2betaCompletionConfig: Catalog level autocomplete config 3418 // for customers to customize autocomplete feature's settings. 3419 type GoogleCloudRetailV2betaCompletionConfig struct { 3420 // AllowlistInputConfig: Output only. The source data for the latest import of 3421 // the autocomplete allowlist phrases. 3422 AllowlistInputConfig *GoogleCloudRetailV2betaCompletionDataInputConfig `json:"allowlistInputConfig,omitempty"` 3423 // AutoLearning: If set to true, the auto learning function is enabled. Auto 3424 // learning uses user data to generate suggestions using ML techniques. Default 3425 // value is false. Only after enabling auto learning can users use 3426 // `cloud-retail` data in CompleteQueryRequest. 3427 AutoLearning bool `json:"autoLearning,omitempty"` 3428 // DenylistInputConfig: Output only. The source data for the latest import of 3429 // the autocomplete denylist phrases. 3430 DenylistInputConfig *GoogleCloudRetailV2betaCompletionDataInputConfig `json:"denylistInputConfig,omitempty"` 3431 // LastAllowlistImportOperation: Output only. Name of the LRO corresponding to 3432 // the latest allowlist import. Can use GetOperation API to retrieve the latest 3433 // state of the Long Running Operation. 3434 LastAllowlistImportOperation string `json:"lastAllowlistImportOperation,omitempty"` 3435 // LastDenylistImportOperation: Output only. Name of the LRO corresponding to 3436 // the latest denylist import. Can use GetOperation API to retrieve the latest 3437 // state of the Long Running Operation. 3438 LastDenylistImportOperation string `json:"lastDenylistImportOperation,omitempty"` 3439 // LastSuggestionsImportOperation: Output only. Name of the LRO corresponding 3440 // to the latest suggestion terms list import. Can use GetOperation API method 3441 // to retrieve the latest state of the Long Running Operation. 3442 LastSuggestionsImportOperation string `json:"lastSuggestionsImportOperation,omitempty"` 3443 // MatchingOrder: Specifies the matching order for autocomplete suggestions, 3444 // e.g., a query consisting of 'sh' with 'out-of-order' specified would suggest 3445 // "women's shoes", whereas a query of 'red s' with 'exact-prefix' specified 3446 // would suggest "red shoes". Currently supported values: * 'out-of-order' * 3447 // 'exact-prefix' Default value: 'exact-prefix'. 3448 MatchingOrder string `json:"matchingOrder,omitempty"` 3449 // MaxSuggestions: The maximum number of autocomplete suggestions returned per 3450 // term. Default value is 20. If left unset or set to 0, then will fallback to 3451 // default value. Value range is 1 to 20. 3452 MaxSuggestions int64 `json:"maxSuggestions,omitempty"` 3453 // MinPrefixLength: The minimum number of characters needed to be typed in 3454 // order to get suggestions. Default value is 2. If left unset or set to 0, 3455 // then will fallback to default value. Value range is 1 to 20. 3456 MinPrefixLength int64 `json:"minPrefixLength,omitempty"` 3457 // Name: Required. Immutable. Fully qualified name 3458 // `projects/*/locations/*/catalogs/*/completionConfig` 3459 Name string `json:"name,omitempty"` 3460 // SuggestionsInputConfig: Output only. The source data for the latest import 3461 // of the autocomplete suggestion phrases. 3462 SuggestionsInputConfig *GoogleCloudRetailV2betaCompletionDataInputConfig `json:"suggestionsInputConfig,omitempty"` 3463 3464 // ServerResponse contains the HTTP response code and headers from the server. 3465 googleapi.ServerResponse `json:"-"` 3466 // ForceSendFields is a list of field names (e.g. "AllowlistInputConfig") to 3467 // unconditionally include in API requests. By default, fields with empty or 3468 // default values are omitted from API requests. See 3469 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3470 // details. 3471 ForceSendFields []string `json:"-"` 3472 // NullFields is a list of field names (e.g. "AllowlistInputConfig") to include 3473 // in API requests with the JSON null value. By default, fields with empty 3474 // values are omitted from API requests. See 3475 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3476 NullFields []string `json:"-"` 3477 } 3478 3479 func (s *GoogleCloudRetailV2betaCompletionConfig) MarshalJSON() ([]byte, error) { 3480 type NoMethod GoogleCloudRetailV2betaCompletionConfig 3481 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3482 } 3483 3484 // GoogleCloudRetailV2betaCompletionDataInputConfig: The input config source 3485 // for completion data. 3486 type GoogleCloudRetailV2betaCompletionDataInputConfig struct { 3487 // BigQuerySource: Required. BigQuery input source. Add the IAM permission 3488 // "BigQuery Data Viewer" for 3489 // cloud-retail-customer-data-access@system.gserviceaccount.com before using 3490 // this feature otherwise an error is thrown. 3491 BigQuerySource *GoogleCloudRetailV2betaBigQuerySource `json:"bigQuerySource,omitempty"` 3492 // ForceSendFields is a list of field names (e.g. "BigQuerySource") to 3493 // unconditionally include in API requests. By default, fields with empty or 3494 // default values are omitted from API requests. See 3495 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3496 // details. 3497 ForceSendFields []string `json:"-"` 3498 // NullFields is a list of field names (e.g. "BigQuerySource") to include in 3499 // API requests with the JSON null value. By default, fields with empty values 3500 // are omitted from API requests. See 3501 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3502 NullFields []string `json:"-"` 3503 } 3504 3505 func (s *GoogleCloudRetailV2betaCompletionDataInputConfig) MarshalJSON() ([]byte, error) { 3506 type NoMethod GoogleCloudRetailV2betaCompletionDataInputConfig 3507 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3508 } 3509 3510 // GoogleCloudRetailV2betaCompletionDetail: Detailed completion information 3511 // including completion attribution token and clicked completion info. 3512 type GoogleCloudRetailV2betaCompletionDetail struct { 3513 // CompletionAttributionToken: Completion attribution token in 3514 // CompleteQueryResponse.attribution_token. 3515 CompletionAttributionToken string `json:"completionAttributionToken,omitempty"` 3516 // SelectedPosition: End user selected 3517 // CompleteQueryResponse.CompletionResult.suggestion position, starting from 0. 3518 SelectedPosition int64 `json:"selectedPosition,omitempty"` 3519 // SelectedSuggestion: End user selected 3520 // CompleteQueryResponse.CompletionResult.suggestion. 3521 SelectedSuggestion string `json:"selectedSuggestion,omitempty"` 3522 // ForceSendFields is a list of field names (e.g. "CompletionAttributionToken") 3523 // to unconditionally include in API requests. By default, fields with empty or 3524 // default values are omitted from API requests. See 3525 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3526 // details. 3527 ForceSendFields []string `json:"-"` 3528 // NullFields is a list of field names (e.g. "CompletionAttributionToken") to 3529 // include in API requests with the JSON null value. By default, fields with 3530 // empty values are omitted from API requests. See 3531 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3532 NullFields []string `json:"-"` 3533 } 3534 3535 func (s *GoogleCloudRetailV2betaCompletionDetail) MarshalJSON() ([]byte, error) { 3536 type NoMethod GoogleCloudRetailV2betaCompletionDetail 3537 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3538 } 3539 3540 // GoogleCloudRetailV2betaCondition: Metadata that is used to define a 3541 // condition that triggers an action. A valid condition must specify at least 3542 // one of 'query_terms' or 'products_filter'. If multiple fields are specified, 3543 // the condition is met if all the fields are satisfied e.g. if a set of query 3544 // terms and product_filter are set, then only items matching the 3545 // product_filter for requests with a query matching the query terms wil get 3546 // boosted. 3547 type GoogleCloudRetailV2betaCondition struct { 3548 // ActiveTimeRange: Range of time(s) specifying when Condition is active. 3549 // Condition true if any time range matches. 3550 ActiveTimeRange []*GoogleCloudRetailV2betaConditionTimeRange `json:"activeTimeRange,omitempty"` 3551 // PageCategories: Used to support browse uses cases. A list (up to 10 entries) 3552 // of categories or departments. The format should be the same as 3553 // UserEvent.page_categories; 3554 PageCategories []string `json:"pageCategories,omitempty"` 3555 // QueryTerms: A list (up to 10 entries) of terms to match the query on. If not 3556 // specified, match all queries. If many query terms are specified, the 3557 // condition is matched if any of the terms is a match (i.e. using the OR 3558 // operator). 3559 QueryTerms []*GoogleCloudRetailV2betaConditionQueryTerm `json:"queryTerms,omitempty"` 3560 // ForceSendFields is a list of field names (e.g. "ActiveTimeRange") to 3561 // unconditionally include in API requests. By default, fields with empty or 3562 // default values are omitted from API requests. See 3563 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3564 // details. 3565 ForceSendFields []string `json:"-"` 3566 // NullFields is a list of field names (e.g. "ActiveTimeRange") to include in 3567 // API requests with the JSON null value. By default, fields with empty values 3568 // are omitted from API requests. See 3569 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3570 NullFields []string `json:"-"` 3571 } 3572 3573 func (s *GoogleCloudRetailV2betaCondition) MarshalJSON() ([]byte, error) { 3574 type NoMethod GoogleCloudRetailV2betaCondition 3575 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3576 } 3577 3578 // GoogleCloudRetailV2betaConditionQueryTerm: Query terms that we want to match 3579 // on. 3580 type GoogleCloudRetailV2betaConditionQueryTerm struct { 3581 // FullMatch: Whether this is supposed to be a full or partial match. 3582 FullMatch bool `json:"fullMatch,omitempty"` 3583 // Value: The value of the term to match on. Value cannot be empty. Value can 3584 // have at most 3 terms if specified as a partial match. Each space separated 3585 // string is considered as one term. For example, "a b c" is 3 terms and 3586 // allowed, but " a b c d" is 4 terms and not allowed for a partial match. 3587 Value string `json:"value,omitempty"` 3588 // ForceSendFields is a list of field names (e.g. "FullMatch") to 3589 // unconditionally include in API requests. By default, fields with empty or 3590 // default values are omitted from API requests. See 3591 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3592 // details. 3593 ForceSendFields []string `json:"-"` 3594 // NullFields is a list of field names (e.g. "FullMatch") to include in API 3595 // requests with the JSON null value. By default, fields with empty values are 3596 // omitted from API requests. See 3597 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3598 NullFields []string `json:"-"` 3599 } 3600 3601 func (s *GoogleCloudRetailV2betaConditionQueryTerm) MarshalJSON() ([]byte, error) { 3602 type NoMethod GoogleCloudRetailV2betaConditionQueryTerm 3603 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3604 } 3605 3606 // GoogleCloudRetailV2betaConditionTimeRange: Used for time-dependent 3607 // conditions. Example: Want to have rule applied for week long sale. 3608 type GoogleCloudRetailV2betaConditionTimeRange struct { 3609 // EndTime: End of time range. Range is inclusive. 3610 EndTime string `json:"endTime,omitempty"` 3611 // StartTime: Start of time range. Range is inclusive. 3612 StartTime string `json:"startTime,omitempty"` 3613 // ForceSendFields is a list of field names (e.g. "EndTime") to unconditionally 3614 // include in API requests. By default, fields with empty or default values are 3615 // omitted from API requests. See 3616 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3617 // details. 3618 ForceSendFields []string `json:"-"` 3619 // NullFields is a list of field names (e.g. "EndTime") to include in API 3620 // requests with the JSON null value. By default, fields with empty values are 3621 // omitted from API requests. See 3622 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3623 NullFields []string `json:"-"` 3624 } 3625 3626 func (s *GoogleCloudRetailV2betaConditionTimeRange) MarshalJSON() ([]byte, error) { 3627 type NoMethod GoogleCloudRetailV2betaConditionTimeRange 3628 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3629 } 3630 3631 // GoogleCloudRetailV2betaControl: Configures dynamic metadata that can be 3632 // linked to a ServingConfig and affect search or recommendation results at 3633 // serving time. 3634 type GoogleCloudRetailV2betaControl struct { 3635 // AssociatedServingConfigIds: Output only. List of serving config ids that are 3636 // associated with this control in the same Catalog. Note the association is 3637 // managed via the ServingConfig, this is an output only denormalized view. 3638 AssociatedServingConfigIds []string `json:"associatedServingConfigIds,omitempty"` 3639 // DisplayName: Required. The human readable control display name. Used in 3640 // Retail UI. This field must be a UTF-8 encoded string with a length limit of 3641 // 128 characters. Otherwise, an INVALID_ARGUMENT error is thrown. 3642 DisplayName string `json:"displayName,omitempty"` 3643 // FacetSpec: A facet specification to perform faceted search. Note that this 3644 // field is deprecated and will throw NOT_IMPLEMENTED if used for creating a 3645 // control. 3646 FacetSpec *GoogleCloudRetailV2betaSearchRequestFacetSpec `json:"facetSpec,omitempty"` 3647 // Name: Immutable. Fully qualified name 3648 // `projects/*/locations/global/catalogs/*/controls/*` 3649 Name string `json:"name,omitempty"` 3650 // Rule: A rule control - a condition-action pair. Enacts a set action when the 3651 // condition is triggered. For example: Boost "gShoe" when query full matches 3652 // "Running Shoes". 3653 Rule *GoogleCloudRetailV2betaRule `json:"rule,omitempty"` 3654 // SearchSolutionUseCase: Specifies the use case for the control. Affects what 3655 // condition fields can be set. Only settable by search controls. Will default 3656 // to SEARCH_SOLUTION_USE_CASE_SEARCH if not specified. Currently only allow 3657 // one search_solution_use_case per control. 3658 // 3659 // Possible values: 3660 // "SEARCH_SOLUTION_USE_CASE_UNSPECIFIED" - The value when it's unspecified. 3661 // In this case, server behavior defaults to SEARCH_SOLUTION_USE_CASE_SEARCH. 3662 // "SEARCH_SOLUTION_USE_CASE_SEARCH" - Search use case. Expects the traffic 3663 // has a non-empty query. 3664 // "SEARCH_SOLUTION_USE_CASE_BROWSE" - Browse use case. Expects the traffic 3665 // has an empty query. 3666 SearchSolutionUseCase []string `json:"searchSolutionUseCase,omitempty"` 3667 // SolutionTypes: Required. Immutable. The solution types that the control is 3668 // used for. Currently we support setting only one type of solution at creation 3669 // time. Only `SOLUTION_TYPE_SEARCH` value is supported at the moment. If no 3670 // solution type is provided at creation time, will default to 3671 // SOLUTION_TYPE_SEARCH. 3672 // 3673 // Possible values: 3674 // "SOLUTION_TYPE_UNSPECIFIED" - Default value. 3675 // "SOLUTION_TYPE_RECOMMENDATION" - Used for Recommendations AI. 3676 // "SOLUTION_TYPE_SEARCH" - Used for Retail Search. 3677 SolutionTypes []string `json:"solutionTypes,omitempty"` 3678 3679 // ServerResponse contains the HTTP response code and headers from the server. 3680 googleapi.ServerResponse `json:"-"` 3681 // ForceSendFields is a list of field names (e.g. "AssociatedServingConfigIds") 3682 // to unconditionally include in API requests. By default, fields with empty or 3683 // default values are omitted from API requests. See 3684 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3685 // details. 3686 ForceSendFields []string `json:"-"` 3687 // NullFields is a list of field names (e.g. "AssociatedServingConfigIds") to 3688 // include in API requests with the JSON null value. By default, fields with 3689 // empty values are omitted from API requests. See 3690 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3691 NullFields []string `json:"-"` 3692 } 3693 3694 func (s *GoogleCloudRetailV2betaControl) MarshalJSON() ([]byte, error) { 3695 type NoMethod GoogleCloudRetailV2betaControl 3696 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3697 } 3698 3699 // GoogleCloudRetailV2betaCreateMerchantCenterAccountLinkMetadata: Common 3700 // metadata related to the progress of the operations. 3701 type GoogleCloudRetailV2betaCreateMerchantCenterAccountLinkMetadata struct { 3702 // CreateTime: Operation create time. 3703 CreateTime string `json:"createTime,omitempty"` 3704 // UpdateTime: Operation last update time. If the operation is done, this is 3705 // also the finish time. 3706 UpdateTime string `json:"updateTime,omitempty"` 3707 // ForceSendFields is a list of field names (e.g. "CreateTime") to 3708 // unconditionally include in API requests. By default, fields with empty or 3709 // default values are omitted from API requests. See 3710 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3711 // details. 3712 ForceSendFields []string `json:"-"` 3713 // NullFields is a list of field names (e.g. "CreateTime") to include in API 3714 // requests with the JSON null value. By default, fields with empty values are 3715 // omitted from API requests. See 3716 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3717 NullFields []string `json:"-"` 3718 } 3719 3720 func (s *GoogleCloudRetailV2betaCreateMerchantCenterAccountLinkMetadata) MarshalJSON() ([]byte, error) { 3721 type NoMethod GoogleCloudRetailV2betaCreateMerchantCenterAccountLinkMetadata 3722 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3723 } 3724 3725 // GoogleCloudRetailV2betaCreateModelMetadata: Metadata associated with a 3726 // create operation. 3727 type GoogleCloudRetailV2betaCreateModelMetadata struct { 3728 // Model: The resource name of the model that this create applies to. Format: 3729 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/mode 3730 // ls/{model_id}` 3731 Model string `json:"model,omitempty"` 3732 // ForceSendFields is a list of field names (e.g. "Model") to unconditionally 3733 // include in API requests. By default, fields with empty or default values are 3734 // omitted from API requests. See 3735 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3736 // details. 3737 ForceSendFields []string `json:"-"` 3738 // NullFields is a list of field names (e.g. "Model") to include in API 3739 // requests with the JSON null value. By default, fields with empty values are 3740 // omitted from API requests. See 3741 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3742 NullFields []string `json:"-"` 3743 } 3744 3745 func (s *GoogleCloudRetailV2betaCreateModelMetadata) MarshalJSON() ([]byte, error) { 3746 type NoMethod GoogleCloudRetailV2betaCreateModelMetadata 3747 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3748 } 3749 3750 // GoogleCloudRetailV2betaCustomAttribute: A custom attribute that is not 3751 // explicitly modeled in Product. 3752 type GoogleCloudRetailV2betaCustomAttribute struct { 3753 // Indexable: This field is normally ignored unless 3754 // AttributesConfig.attribute_config_level of the Catalog is set to the 3755 // deprecated 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG' mode. For information about 3756 // product-level attribute configuration, see Configuration modes 3757 // (https://cloud.google.com/retail/docs/attribute-config#config-modes). If 3758 // true, custom attribute values are indexed, so that they can be filtered, 3759 // faceted or boosted in SearchService.Search. This field is ignored in a 3760 // UserEvent. See SearchRequest.filter, SearchRequest.facet_specs and 3761 // SearchRequest.boost_spec for more details. 3762 Indexable bool `json:"indexable,omitempty"` 3763 // Numbers: The numerical values of this custom attribute. For example, `[2.3, 3764 // 15.4]` when the key is "lengths_cm". Exactly one of text or numbers should 3765 // be set. Otherwise, an INVALID_ARGUMENT error is returned. 3766 Numbers []float64 `json:"numbers,omitempty"` 3767 // Searchable: This field is normally ignored unless 3768 // AttributesConfig.attribute_config_level of the Catalog is set to the 3769 // deprecated 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG' mode. For information about 3770 // product-level attribute configuration, see Configuration modes 3771 // (https://cloud.google.com/retail/docs/attribute-config#config-modes). If 3772 // true, custom attribute values are searchable by text queries in 3773 // SearchService.Search. This field is ignored in a UserEvent. Only set if type 3774 // text is set. Otherwise, a INVALID_ARGUMENT error is returned. 3775 Searchable bool `json:"searchable,omitempty"` 3776 // Text: The textual values of this custom attribute. For example, `["yellow", 3777 // "green"]` when the key is "color". Empty string is not allowed. Otherwise, 3778 // an INVALID_ARGUMENT error is returned. Exactly one of text or numbers should 3779 // be set. Otherwise, an INVALID_ARGUMENT error is returned. 3780 Text []string `json:"text,omitempty"` 3781 // ForceSendFields is a list of field names (e.g. "Indexable") to 3782 // unconditionally include in API requests. By default, fields with empty or 3783 // default values are omitted from API requests. See 3784 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3785 // details. 3786 ForceSendFields []string `json:"-"` 3787 // NullFields is a list of field names (e.g. "Indexable") to include in API 3788 // requests with the JSON null value. By default, fields with empty values are 3789 // omitted from API requests. See 3790 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3791 NullFields []string `json:"-"` 3792 } 3793 3794 func (s *GoogleCloudRetailV2betaCustomAttribute) MarshalJSON() ([]byte, error) { 3795 type NoMethod GoogleCloudRetailV2betaCustomAttribute 3796 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3797 } 3798 3799 func (s *GoogleCloudRetailV2betaCustomAttribute) UnmarshalJSON(data []byte) error { 3800 type NoMethod GoogleCloudRetailV2betaCustomAttribute 3801 var s1 struct { 3802 Numbers []gensupport.JSONFloat64 `json:"numbers"` 3803 *NoMethod 3804 } 3805 s1.NoMethod = (*NoMethod)(s) 3806 if err := json.Unmarshal(data, &s1); err != nil { 3807 return err 3808 } 3809 s.Numbers = make([]float64, len(s1.Numbers)) 3810 for i := range s1.Numbers { 3811 s.Numbers[i] = float64(s1.Numbers[i]) 3812 } 3813 return nil 3814 } 3815 3816 // GoogleCloudRetailV2betaExperimentInfo: Metadata for active A/B testing 3817 // Experiment. 3818 type GoogleCloudRetailV2betaExperimentInfo struct { 3819 // Experiment: The fully qualified resource name of the experiment that 3820 // provides the serving config under test, should an active experiment exist. 3821 // For example: 3822 // `projects/*/locations/global/catalogs/default_catalog/experiments/experiment_ 3823 // id` 3824 Experiment string `json:"experiment,omitempty"` 3825 // ServingConfigExperiment: A/B test between existing Cloud Retail Search 3826 // ServingConfigs. 3827 ServingConfigExperiment *GoogleCloudRetailV2betaExperimentInfoServingConfigExperiment `json:"servingConfigExperiment,omitempty"` 3828 // ForceSendFields is a list of field names (e.g. "Experiment") to 3829 // unconditionally include in API requests. By default, fields with empty or 3830 // default values are omitted from API requests. See 3831 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3832 // details. 3833 ForceSendFields []string `json:"-"` 3834 // NullFields is a list of field names (e.g. "Experiment") to include in API 3835 // requests with the JSON null value. By default, fields with empty values are 3836 // omitted from API requests. See 3837 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3838 NullFields []string `json:"-"` 3839 } 3840 3841 func (s *GoogleCloudRetailV2betaExperimentInfo) MarshalJSON() ([]byte, error) { 3842 type NoMethod GoogleCloudRetailV2betaExperimentInfo 3843 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3844 } 3845 3846 // GoogleCloudRetailV2betaExperimentInfoServingConfigExperiment: Metadata for 3847 // active serving config A/B tests. 3848 type GoogleCloudRetailV2betaExperimentInfoServingConfigExperiment struct { 3849 // ExperimentServingConfig: The fully qualified resource name of the serving 3850 // config Experiment.VariantArm.serving_config_id responsible for generating 3851 // the search response. For example: 3852 // `projects/*/locations/*/catalogs/*/servingConfigs/*`. 3853 ExperimentServingConfig string `json:"experimentServingConfig,omitempty"` 3854 // OriginalServingConfig: The fully qualified resource name of the original 3855 // SearchRequest.placement in the search request prior to reassignment by 3856 // experiment API. For example: 3857 // `projects/*/locations/*/catalogs/*/servingConfigs/*`. 3858 OriginalServingConfig string `json:"originalServingConfig,omitempty"` 3859 // ForceSendFields is a list of field names (e.g. "ExperimentServingConfig") to 3860 // unconditionally include in API requests. By default, fields with empty or 3861 // default values are omitted from API requests. See 3862 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3863 // details. 3864 ForceSendFields []string `json:"-"` 3865 // NullFields is a list of field names (e.g. "ExperimentServingConfig") to 3866 // include in API requests with the JSON null value. By default, fields with 3867 // empty values are omitted from API requests. See 3868 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3869 NullFields []string `json:"-"` 3870 } 3871 3872 func (s *GoogleCloudRetailV2betaExperimentInfoServingConfigExperiment) MarshalJSON() ([]byte, error) { 3873 type NoMethod GoogleCloudRetailV2betaExperimentInfoServingConfigExperiment 3874 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3875 } 3876 3877 // GoogleCloudRetailV2betaExportAnalyticsMetricsRequest: Request message for 3878 // the `ExportAnalyticsMetrics` method. 3879 type GoogleCloudRetailV2betaExportAnalyticsMetricsRequest struct { 3880 // Filter: A filtering expression to specify restrictions on returned metrics. 3881 // The expression is a sequence of terms. Each term applies a restriction to 3882 // the returned metrics. Use this expression to restrict results to a specific 3883 // time range. Currently we expect only one types of fields: * `timestamp`: 3884 // This can be specified twice, once with a less than operator and once with a 3885 // greater than operator. The `timestamp` restriction should result in one, 3886 // contiguous, valid, `timestamp` range. Some examples of valid filters 3887 // expressions: * Example 1: `timestamp > "2012-04-23T18:25:43.511Z" timestamp 3888 // < "2012-04-23T18:30:43.511Z" * Example 2: `timestamp > 3889 // "2012-04-23T18:25:43.511Z" 3890 Filter string `json:"filter,omitempty"` 3891 // OutputConfig: Required. The output location of the data. 3892 OutputConfig *GoogleCloudRetailV2betaOutputConfig `json:"outputConfig,omitempty"` 3893 // ForceSendFields is a list of field names (e.g. "Filter") to unconditionally 3894 // include in API requests. By default, fields with empty or default values are 3895 // omitted from API requests. See 3896 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3897 // details. 3898 ForceSendFields []string `json:"-"` 3899 // NullFields is a list of field names (e.g. "Filter") to include in API 3900 // requests with the JSON null value. By default, fields with empty values are 3901 // omitted from API requests. See 3902 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3903 NullFields []string `json:"-"` 3904 } 3905 3906 func (s *GoogleCloudRetailV2betaExportAnalyticsMetricsRequest) MarshalJSON() ([]byte, error) { 3907 type NoMethod GoogleCloudRetailV2betaExportAnalyticsMetricsRequest 3908 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3909 } 3910 3911 // GoogleCloudRetailV2betaExportAnalyticsMetricsResponse: Response of the 3912 // ExportAnalyticsMetricsRequest. If the long running operation was successful, 3913 // then this message is returned by the google.longrunning.Operations.response 3914 // field if the operation was successful. 3915 type GoogleCloudRetailV2betaExportAnalyticsMetricsResponse struct { 3916 // ErrorSamples: A sample of errors encountered while processing the request. 3917 ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` 3918 // ErrorsConfig: This field is never set. 3919 ErrorsConfig *GoogleCloudRetailV2betaExportErrorsConfig `json:"errorsConfig,omitempty"` 3920 // OutputResult: Output result indicating where the data were exported to. 3921 OutputResult *GoogleCloudRetailV2betaOutputResult `json:"outputResult,omitempty"` 3922 // ForceSendFields is a list of field names (e.g. "ErrorSamples") to 3923 // unconditionally include in API requests. By default, fields with empty or 3924 // default values are omitted from API requests. See 3925 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3926 // details. 3927 ForceSendFields []string `json:"-"` 3928 // NullFields is a list of field names (e.g. "ErrorSamples") to include in API 3929 // requests with the JSON null value. By default, fields with empty values are 3930 // omitted from API requests. See 3931 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3932 NullFields []string `json:"-"` 3933 } 3934 3935 func (s *GoogleCloudRetailV2betaExportAnalyticsMetricsResponse) MarshalJSON() ([]byte, error) { 3936 type NoMethod GoogleCloudRetailV2betaExportAnalyticsMetricsResponse 3937 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3938 } 3939 3940 // GoogleCloudRetailV2betaExportErrorsConfig: Configuration of destination for 3941 // Export related errors. 3942 type GoogleCloudRetailV2betaExportErrorsConfig struct { 3943 // GcsPrefix: Google Cloud Storage path for import errors. This must be an 3944 // empty, existing Cloud Storage bucket. Export errors will be written to a 3945 // file in this bucket, one per line, as a JSON-encoded `google.rpc.Status` 3946 // message. 3947 GcsPrefix string `json:"gcsPrefix,omitempty"` 3948 // ForceSendFields is a list of field names (e.g. "GcsPrefix") to 3949 // unconditionally include in API requests. By default, fields with empty or 3950 // default values are omitted from API requests. See 3951 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3952 // details. 3953 ForceSendFields []string `json:"-"` 3954 // NullFields is a list of field names (e.g. "GcsPrefix") to include in API 3955 // requests with the JSON null value. By default, fields with empty values are 3956 // omitted from API requests. See 3957 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3958 NullFields []string `json:"-"` 3959 } 3960 3961 func (s *GoogleCloudRetailV2betaExportErrorsConfig) MarshalJSON() ([]byte, error) { 3962 type NoMethod GoogleCloudRetailV2betaExportErrorsConfig 3963 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3964 } 3965 3966 // GoogleCloudRetailV2betaExportMetadata: Metadata related to the progress of 3967 // the Export operation. This is returned by the 3968 // google.longrunning.Operation.metadata field. 3969 type GoogleCloudRetailV2betaExportMetadata struct { 3970 // CreateTime: Operation create time. 3971 CreateTime string `json:"createTime,omitempty"` 3972 // UpdateTime: Operation last update time. If the operation is done, this is 3973 // also the finish time. 3974 UpdateTime string `json:"updateTime,omitempty"` 3975 // ForceSendFields is a list of field names (e.g. "CreateTime") to 3976 // unconditionally include in API requests. By default, fields with empty or 3977 // default values are omitted from API requests. See 3978 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3979 // details. 3980 ForceSendFields []string `json:"-"` 3981 // NullFields is a list of field names (e.g. "CreateTime") to include in API 3982 // requests with the JSON null value. By default, fields with empty values are 3983 // omitted from API requests. See 3984 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3985 NullFields []string `json:"-"` 3986 } 3987 3988 func (s *GoogleCloudRetailV2betaExportMetadata) MarshalJSON() ([]byte, error) { 3989 type NoMethod GoogleCloudRetailV2betaExportMetadata 3990 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3991 } 3992 3993 // GoogleCloudRetailV2betaExportProductsResponse: Response of the 3994 // ExportProductsRequest. If the long running operation is done, then this 3995 // message is returned by the google.longrunning.Operations.response field if 3996 // the operation was successful. 3997 type GoogleCloudRetailV2betaExportProductsResponse struct { 3998 // ErrorSamples: A sample of errors encountered while processing the request. 3999 ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` 4000 // ErrorsConfig: This field is never set. 4001 ErrorsConfig *GoogleCloudRetailV2betaExportErrorsConfig `json:"errorsConfig,omitempty"` 4002 // OutputResult: Output result indicating where the data were exported to. 4003 OutputResult *GoogleCloudRetailV2betaOutputResult `json:"outputResult,omitempty"` 4004 // ForceSendFields is a list of field names (e.g. "ErrorSamples") to 4005 // unconditionally include in API requests. By default, fields with empty or 4006 // default values are omitted from API requests. See 4007 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4008 // details. 4009 ForceSendFields []string `json:"-"` 4010 // NullFields is a list of field names (e.g. "ErrorSamples") to include in API 4011 // requests with the JSON null value. By default, fields with empty values are 4012 // omitted from API requests. See 4013 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4014 NullFields []string `json:"-"` 4015 } 4016 4017 func (s *GoogleCloudRetailV2betaExportProductsResponse) MarshalJSON() ([]byte, error) { 4018 type NoMethod GoogleCloudRetailV2betaExportProductsResponse 4019 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4020 } 4021 4022 // GoogleCloudRetailV2betaExportUserEventsResponse: Response of the 4023 // ExportUserEventsRequest. If the long running operation was successful, then 4024 // this message is returned by the google.longrunning.Operations.response field 4025 // if the operation was successful. 4026 type GoogleCloudRetailV2betaExportUserEventsResponse struct { 4027 // ErrorSamples: A sample of errors encountered while processing the request. 4028 ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` 4029 // ErrorsConfig: This field is never set. 4030 ErrorsConfig *GoogleCloudRetailV2betaExportErrorsConfig `json:"errorsConfig,omitempty"` 4031 // OutputResult: Output result indicating where the data were exported to. 4032 OutputResult *GoogleCloudRetailV2betaOutputResult `json:"outputResult,omitempty"` 4033 // ForceSendFields is a list of field names (e.g. "ErrorSamples") to 4034 // unconditionally include in API requests. By default, fields with empty or 4035 // default values are omitted from API requests. See 4036 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4037 // details. 4038 ForceSendFields []string `json:"-"` 4039 // NullFields is a list of field names (e.g. "ErrorSamples") to include in API 4040 // requests with the JSON null value. By default, fields with empty values are 4041 // omitted from API requests. See 4042 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4043 NullFields []string `json:"-"` 4044 } 4045 4046 func (s *GoogleCloudRetailV2betaExportUserEventsResponse) MarshalJSON() ([]byte, error) { 4047 type NoMethod GoogleCloudRetailV2betaExportUserEventsResponse 4048 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4049 } 4050 4051 // GoogleCloudRetailV2betaFulfillmentInfo: Fulfillment information, such as the 4052 // store IDs for in-store pickup or region IDs for different shipping methods. 4053 type GoogleCloudRetailV2betaFulfillmentInfo struct { 4054 // PlaceIds: The IDs for this type, such as the store IDs for 4055 // FulfillmentInfo.type.pickup-in-store or the region IDs for 4056 // FulfillmentInfo.type.same-day-delivery. A maximum of 3000 values are 4057 // allowed. Each value must be a string with a length limit of 30 characters, 4058 // matching the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". 4059 // Otherwise, an INVALID_ARGUMENT error is returned. 4060 PlaceIds []string `json:"placeIds,omitempty"` 4061 // Type: The fulfillment type, including commonly used types (such as pickup in 4062 // store and same day delivery), and custom types. Customers have to map custom 4063 // types to their display names before rendering UI. Supported values: * 4064 // "pickup-in-store" * "ship-to-store" * "same-day-delivery" * 4065 // "next-day-delivery" * "custom-type-1" * "custom-type-2" * "custom-type-3" * 4066 // "custom-type-4" * "custom-type-5" If this field is set to an invalid value 4067 // other than these, an INVALID_ARGUMENT error is returned. 4068 Type string `json:"type,omitempty"` 4069 // ForceSendFields is a list of field names (e.g. "PlaceIds") to 4070 // unconditionally include in API requests. By default, fields with empty or 4071 // default values are omitted from API requests. See 4072 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4073 // details. 4074 ForceSendFields []string `json:"-"` 4075 // NullFields is a list of field names (e.g. "PlaceIds") to include in API 4076 // requests with the JSON null value. By default, fields with empty values are 4077 // omitted from API requests. See 4078 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4079 NullFields []string `json:"-"` 4080 } 4081 4082 func (s *GoogleCloudRetailV2betaFulfillmentInfo) MarshalJSON() ([]byte, error) { 4083 type NoMethod GoogleCloudRetailV2betaFulfillmentInfo 4084 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4085 } 4086 4087 // GoogleCloudRetailV2betaGcsOutputResult: A Gcs output result. 4088 type GoogleCloudRetailV2betaGcsOutputResult struct { 4089 // OutputUri: The uri of Gcs output 4090 OutputUri string `json:"outputUri,omitempty"` 4091 // ForceSendFields is a list of field names (e.g. "OutputUri") to 4092 // unconditionally include in API requests. By default, fields with empty or 4093 // default values are omitted from API requests. See 4094 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4095 // details. 4096 ForceSendFields []string `json:"-"` 4097 // NullFields is a list of field names (e.g. "OutputUri") to include in API 4098 // requests with the JSON null value. By default, fields with empty values are 4099 // omitted from API requests. See 4100 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4101 NullFields []string `json:"-"` 4102 } 4103 4104 func (s *GoogleCloudRetailV2betaGcsOutputResult) MarshalJSON() ([]byte, error) { 4105 type NoMethod GoogleCloudRetailV2betaGcsOutputResult 4106 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4107 } 4108 4109 // GoogleCloudRetailV2betaGcsSource: Google Cloud Storage location for input 4110 // content. 4111 type GoogleCloudRetailV2betaGcsSource struct { 4112 // DataSchema: The schema to use when parsing the data from the source. 4113 // Supported values for product imports: * `product` (default): One JSON 4114 // Product per line. Each product must have a valid Product.id. * 4115 // `product_merchant_center`: See Importing catalog data from Merchant Center 4116 // (https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc). 4117 // Supported values for user events imports: * `user_event` (default): One JSON 4118 // UserEvent per line. * `user_event_ga360`: Using 4119 // https://support.google.com/analytics/answer/3437719. Supported values for 4120 // control imports: * `control` (default): One JSON Control per line. Supported 4121 // values for catalog attribute imports: * `catalog_attribute` (default): One 4122 // CSV CatalogAttribute per line. 4123 DataSchema string `json:"dataSchema,omitempty"` 4124 // InputUris: Required. Google Cloud Storage URIs to input files. URI can be up 4125 // to 2000 characters long. URIs can match the full object path (for example, 4126 // `gs://bucket/directory/object.json`) or a pattern matching one or more 4127 // files, such as `gs://bucket/directory/*.json`. A request can contain at most 4128 // 100 files, and each file can be up to 2 GB. See Importing product 4129 // information 4130 // (https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog) for 4131 // the expected file format and setup instructions. 4132 InputUris []string `json:"inputUris,omitempty"` 4133 // ForceSendFields is a list of field names (e.g. "DataSchema") to 4134 // unconditionally include in API requests. By default, fields with empty or 4135 // default values are omitted from API requests. See 4136 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4137 // details. 4138 ForceSendFields []string `json:"-"` 4139 // NullFields is a list of field names (e.g. "DataSchema") to include in API 4140 // requests with the JSON null value. By default, fields with empty values are 4141 // omitted from API requests. See 4142 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4143 NullFields []string `json:"-"` 4144 } 4145 4146 func (s *GoogleCloudRetailV2betaGcsSource) MarshalJSON() ([]byte, error) { 4147 type NoMethod GoogleCloudRetailV2betaGcsSource 4148 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4149 } 4150 4151 // GoogleCloudRetailV2betaGetDefaultBranchResponse: Response message of 4152 // CatalogService.GetDefaultBranch. 4153 type GoogleCloudRetailV2betaGetDefaultBranchResponse struct { 4154 // Branch: Full resource name of the branch id currently set as default branch. 4155 Branch string `json:"branch,omitempty"` 4156 // Note: This corresponds to SetDefaultBranchRequest.note field, when this 4157 // branch was set as default. 4158 Note string `json:"note,omitempty"` 4159 // SetTime: The time when this branch is set to default. 4160 SetTime string `json:"setTime,omitempty"` 4161 4162 // ServerResponse contains the HTTP response code and headers from the server. 4163 googleapi.ServerResponse `json:"-"` 4164 // ForceSendFields is a list of field names (e.g. "Branch") to unconditionally 4165 // include in API requests. By default, fields with empty or default values are 4166 // omitted from API requests. See 4167 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4168 // details. 4169 ForceSendFields []string `json:"-"` 4170 // NullFields is a list of field names (e.g. "Branch") to include in API 4171 // requests with the JSON null value. By default, fields with empty values are 4172 // omitted from API requests. See 4173 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4174 NullFields []string `json:"-"` 4175 } 4176 4177 func (s *GoogleCloudRetailV2betaGetDefaultBranchResponse) MarshalJSON() ([]byte, error) { 4178 type NoMethod GoogleCloudRetailV2betaGetDefaultBranchResponse 4179 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4180 } 4181 4182 // GoogleCloudRetailV2betaImage: Product image. Recommendations AI and Retail 4183 // Search do not use product images to improve prediction and search results. 4184 // However, product images can be returned in results, and are shown in 4185 // prediction or search previews in the console. 4186 type GoogleCloudRetailV2betaImage struct { 4187 // Height: Height of the image in number of pixels. This field must be 4188 // nonnegative. Otherwise, an INVALID_ARGUMENT error is returned. 4189 Height int64 `json:"height,omitempty"` 4190 // Uri: Required. URI of the image. This field must be a valid UTF-8 encoded 4191 // URI with a length limit of 5,000 characters. Otherwise, an INVALID_ARGUMENT 4192 // error is returned. Google Merchant Center property image_link 4193 // (https://support.google.com/merchants/answer/6324350). Schema.org property 4194 // Product.image (https://schema.org/image). 4195 Uri string `json:"uri,omitempty"` 4196 // Width: Width of the image in number of pixels. This field must be 4197 // nonnegative. Otherwise, an INVALID_ARGUMENT error is returned. 4198 Width int64 `json:"width,omitempty"` 4199 // ForceSendFields is a list of field names (e.g. "Height") to unconditionally 4200 // include in API requests. By default, fields with empty or default values are 4201 // omitted from API requests. See 4202 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4203 // details. 4204 ForceSendFields []string `json:"-"` 4205 // NullFields is a list of field names (e.g. "Height") to include in API 4206 // requests with the JSON null value. By default, fields with empty values are 4207 // omitted from API requests. See 4208 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4209 NullFields []string `json:"-"` 4210 } 4211 4212 func (s *GoogleCloudRetailV2betaImage) MarshalJSON() ([]byte, error) { 4213 type NoMethod GoogleCloudRetailV2betaImage 4214 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4215 } 4216 4217 // GoogleCloudRetailV2betaImportCompletionDataRequest: Request message for 4218 // ImportCompletionData methods. 4219 type GoogleCloudRetailV2betaImportCompletionDataRequest struct { 4220 // InputConfig: Required. The desired input location of the data. 4221 InputConfig *GoogleCloudRetailV2betaCompletionDataInputConfig `json:"inputConfig,omitempty"` 4222 // NotificationPubsubTopic: Pub/Sub topic for receiving notification. If this 4223 // field is set, when the import is finished, a notification is sent to 4224 // specified Pub/Sub topic. The message data is JSON string of a Operation. 4225 // Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. 4226 NotificationPubsubTopic string `json:"notificationPubsubTopic,omitempty"` 4227 // ForceSendFields is a list of field names (e.g. "InputConfig") to 4228 // unconditionally include in API requests. By default, fields with empty or 4229 // default values are omitted from API requests. See 4230 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4231 // details. 4232 ForceSendFields []string `json:"-"` 4233 // NullFields is a list of field names (e.g. "InputConfig") to include in API 4234 // requests with the JSON null value. By default, fields with empty values are 4235 // omitted from API requests. See 4236 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4237 NullFields []string `json:"-"` 4238 } 4239 4240 func (s *GoogleCloudRetailV2betaImportCompletionDataRequest) MarshalJSON() ([]byte, error) { 4241 type NoMethod GoogleCloudRetailV2betaImportCompletionDataRequest 4242 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4243 } 4244 4245 // GoogleCloudRetailV2betaImportCompletionDataResponse: Response of the 4246 // ImportCompletionDataRequest. If the long running operation is done, this 4247 // message is returned by the google.longrunning.Operations.response field if 4248 // the operation is successful. 4249 type GoogleCloudRetailV2betaImportCompletionDataResponse struct { 4250 // ErrorSamples: A sample of errors encountered while processing the request. 4251 ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` 4252 // ForceSendFields is a list of field names (e.g. "ErrorSamples") to 4253 // unconditionally include in API requests. By default, fields with empty or 4254 // default values are omitted from API requests. See 4255 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4256 // details. 4257 ForceSendFields []string `json:"-"` 4258 // NullFields is a list of field names (e.g. "ErrorSamples") to include in API 4259 // requests with the JSON null value. By default, fields with empty values are 4260 // omitted from API requests. See 4261 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4262 NullFields []string `json:"-"` 4263 } 4264 4265 func (s *GoogleCloudRetailV2betaImportCompletionDataResponse) MarshalJSON() ([]byte, error) { 4266 type NoMethod GoogleCloudRetailV2betaImportCompletionDataResponse 4267 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4268 } 4269 4270 // GoogleCloudRetailV2betaImportErrorsConfig: Configuration of destination for 4271 // Import related errors. 4272 type GoogleCloudRetailV2betaImportErrorsConfig struct { 4273 // GcsPrefix: Google Cloud Storage prefix for import errors. This must be an 4274 // empty, existing Cloud Storage directory. Import errors are written to 4275 // sharded files in this directory, one per line, as a JSON-encoded 4276 // `google.rpc.Status` message. 4277 GcsPrefix string `json:"gcsPrefix,omitempty"` 4278 // ForceSendFields is a list of field names (e.g. "GcsPrefix") to 4279 // unconditionally include in API requests. By default, fields with empty or 4280 // default values are omitted from API requests. See 4281 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4282 // details. 4283 ForceSendFields []string `json:"-"` 4284 // NullFields is a list of field names (e.g. "GcsPrefix") to include in API 4285 // requests with the JSON null value. By default, fields with empty values are 4286 // omitted from API requests. See 4287 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4288 NullFields []string `json:"-"` 4289 } 4290 4291 func (s *GoogleCloudRetailV2betaImportErrorsConfig) MarshalJSON() ([]byte, error) { 4292 type NoMethod GoogleCloudRetailV2betaImportErrorsConfig 4293 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4294 } 4295 4296 // GoogleCloudRetailV2betaImportMetadata: Metadata related to the progress of 4297 // the Import operation. This is returned by the 4298 // google.longrunning.Operation.metadata field. 4299 type GoogleCloudRetailV2betaImportMetadata struct { 4300 // CreateTime: Operation create time. 4301 CreateTime string `json:"createTime,omitempty"` 4302 // FailureCount: Count of entries that encountered errors while processing. 4303 FailureCount int64 `json:"failureCount,omitempty,string"` 4304 // NotificationPubsubTopic: Pub/Sub topic for receiving notification. If this 4305 // field is set, when the import is finished, a notification is sent to 4306 // specified Pub/Sub topic. The message data is JSON string of a Operation. 4307 // Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. 4308 NotificationPubsubTopic string `json:"notificationPubsubTopic,omitempty"` 4309 // RequestId: Deprecated. This field is never set. 4310 RequestId string `json:"requestId,omitempty"` 4311 // SuccessCount: Count of entries that were processed successfully. 4312 SuccessCount int64 `json:"successCount,omitempty,string"` 4313 // UpdateTime: Operation last update time. If the operation is done, this is 4314 // also the finish time. 4315 UpdateTime string `json:"updateTime,omitempty"` 4316 // ForceSendFields is a list of field names (e.g. "CreateTime") to 4317 // unconditionally include in API requests. By default, fields with empty or 4318 // default values are omitted from API requests. See 4319 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4320 // details. 4321 ForceSendFields []string `json:"-"` 4322 // NullFields is a list of field names (e.g. "CreateTime") to include in API 4323 // requests with the JSON null value. By default, fields with empty values are 4324 // omitted from API requests. See 4325 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4326 NullFields []string `json:"-"` 4327 } 4328 4329 func (s *GoogleCloudRetailV2betaImportMetadata) MarshalJSON() ([]byte, error) { 4330 type NoMethod GoogleCloudRetailV2betaImportMetadata 4331 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4332 } 4333 4334 // GoogleCloudRetailV2betaImportProductsRequest: Request message for Import 4335 // methods. 4336 type GoogleCloudRetailV2betaImportProductsRequest struct { 4337 // ErrorsConfig: The desired location of errors incurred during the Import. 4338 ErrorsConfig *GoogleCloudRetailV2betaImportErrorsConfig `json:"errorsConfig,omitempty"` 4339 // InputConfig: Required. The desired input location of the data. 4340 InputConfig *GoogleCloudRetailV2betaProductInputConfig `json:"inputConfig,omitempty"` 4341 // NotificationPubsubTopic: Full Pub/Sub topic name for receiving notification. 4342 // If this field is set, when the import is finished, a notification is sent to 4343 // specified Pub/Sub topic. The message data is JSON string of a Operation. 4344 // Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. It has 4345 // to be within the same project as ImportProductsRequest.parent. Make sure 4346 // that both `cloud-retail-customer-data-access@system.gserviceaccount.com` and 4347 // `service-@gcp-sa-retail.iam.gserviceaccount.com` have the 4348 // `pubsub.topics.publish` IAM permission on the topic. Only supported when 4349 // ImportProductsRequest.reconciliation_mode is set to `FULL`. 4350 NotificationPubsubTopic string `json:"notificationPubsubTopic,omitempty"` 4351 // ReconciliationMode: The mode of reconciliation between existing products and 4352 // the products to be imported. Defaults to ReconciliationMode.INCREMENTAL. 4353 // 4354 // Possible values: 4355 // "RECONCILIATION_MODE_UNSPECIFIED" - Defaults to INCREMENTAL. 4356 // "INCREMENTAL" - Inserts new products or updates existing products. 4357 // "FULL" - Calculates diff and replaces the entire product dataset. Existing 4358 // products may be deleted if they are not present in the source location. 4359 ReconciliationMode string `json:"reconciliationMode,omitempty"` 4360 // RequestId: Deprecated. This field has no effect. 4361 RequestId string `json:"requestId,omitempty"` 4362 // UpdateMask: Indicates which fields in the provided imported `products` to 4363 // update. If not set, all fields are updated. If provided, only the existing 4364 // product fields are updated. Missing products will not be created. 4365 UpdateMask string `json:"updateMask,omitempty"` 4366 // ForceSendFields is a list of field names (e.g. "ErrorsConfig") to 4367 // unconditionally include in API requests. By default, fields with empty or 4368 // default values are omitted from API requests. See 4369 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4370 // details. 4371 ForceSendFields []string `json:"-"` 4372 // NullFields is a list of field names (e.g. "ErrorsConfig") to include in API 4373 // requests with the JSON null value. By default, fields with empty values are 4374 // omitted from API requests. See 4375 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4376 NullFields []string `json:"-"` 4377 } 4378 4379 func (s *GoogleCloudRetailV2betaImportProductsRequest) MarshalJSON() ([]byte, error) { 4380 type NoMethod GoogleCloudRetailV2betaImportProductsRequest 4381 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4382 } 4383 4384 // GoogleCloudRetailV2betaImportProductsResponse: Response of the 4385 // ImportProductsRequest. If the long running operation is done, then this 4386 // message is returned by the google.longrunning.Operations.response field if 4387 // the operation was successful. 4388 type GoogleCloudRetailV2betaImportProductsResponse struct { 4389 // ErrorSamples: A sample of errors encountered while processing the request. 4390 ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` 4391 // ErrorsConfig: Echoes the destination for the complete errors in the request 4392 // if set. 4393 ErrorsConfig *GoogleCloudRetailV2betaImportErrorsConfig `json:"errorsConfig,omitempty"` 4394 // ForceSendFields is a list of field names (e.g. "ErrorSamples") to 4395 // unconditionally include in API requests. By default, fields with empty or 4396 // default values are omitted from API requests. See 4397 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4398 // details. 4399 ForceSendFields []string `json:"-"` 4400 // NullFields is a list of field names (e.g. "ErrorSamples") to include in API 4401 // requests with the JSON null value. By default, fields with empty values are 4402 // omitted from API requests. See 4403 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4404 NullFields []string `json:"-"` 4405 } 4406 4407 func (s *GoogleCloudRetailV2betaImportProductsResponse) MarshalJSON() ([]byte, error) { 4408 type NoMethod GoogleCloudRetailV2betaImportProductsResponse 4409 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4410 } 4411 4412 // GoogleCloudRetailV2betaImportUserEventsRequest: Request message for the 4413 // ImportUserEvents request. 4414 type GoogleCloudRetailV2betaImportUserEventsRequest struct { 4415 // ErrorsConfig: The desired location of errors incurred during the Import. 4416 // Cannot be set for inline user event imports. 4417 ErrorsConfig *GoogleCloudRetailV2betaImportErrorsConfig `json:"errorsConfig,omitempty"` 4418 // InputConfig: Required. The desired input location of the data. 4419 InputConfig *GoogleCloudRetailV2betaUserEventInputConfig `json:"inputConfig,omitempty"` 4420 // ForceSendFields is a list of field names (e.g. "ErrorsConfig") to 4421 // unconditionally include in API requests. By default, fields with empty or 4422 // default values are omitted from API requests. See 4423 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4424 // details. 4425 ForceSendFields []string `json:"-"` 4426 // NullFields is a list of field names (e.g. "ErrorsConfig") to include in API 4427 // requests with the JSON null value. By default, fields with empty values are 4428 // omitted from API requests. See 4429 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4430 NullFields []string `json:"-"` 4431 } 4432 4433 func (s *GoogleCloudRetailV2betaImportUserEventsRequest) MarshalJSON() ([]byte, error) { 4434 type NoMethod GoogleCloudRetailV2betaImportUserEventsRequest 4435 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4436 } 4437 4438 // GoogleCloudRetailV2betaImportUserEventsResponse: Response of the 4439 // ImportUserEventsRequest. If the long running operation was successful, then 4440 // this message is returned by the google.longrunning.Operations.response field 4441 // if the operation was successful. 4442 type GoogleCloudRetailV2betaImportUserEventsResponse struct { 4443 // ErrorSamples: A sample of errors encountered while processing the request. 4444 ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` 4445 // ErrorsConfig: Echoes the destination for the complete errors if this field 4446 // was set in the request. 4447 ErrorsConfig *GoogleCloudRetailV2betaImportErrorsConfig `json:"errorsConfig,omitempty"` 4448 // ImportSummary: Aggregated statistics of user event import status. 4449 ImportSummary *GoogleCloudRetailV2betaUserEventImportSummary `json:"importSummary,omitempty"` 4450 // ForceSendFields is a list of field names (e.g. "ErrorSamples") to 4451 // unconditionally include in API requests. By default, fields with empty or 4452 // default values are omitted from API requests. See 4453 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4454 // details. 4455 ForceSendFields []string `json:"-"` 4456 // NullFields is a list of field names (e.g. "ErrorSamples") to include in API 4457 // requests with the JSON null value. By default, fields with empty values are 4458 // omitted from API requests. See 4459 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4460 NullFields []string `json:"-"` 4461 } 4462 4463 func (s *GoogleCloudRetailV2betaImportUserEventsResponse) MarshalJSON() ([]byte, error) { 4464 type NoMethod GoogleCloudRetailV2betaImportUserEventsResponse 4465 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4466 } 4467 4468 // GoogleCloudRetailV2betaInterval: A floating point interval. 4469 type GoogleCloudRetailV2betaInterval struct { 4470 // ExclusiveMaximum: Exclusive upper bound. 4471 ExclusiveMaximum float64 `json:"exclusiveMaximum,omitempty"` 4472 // ExclusiveMinimum: Exclusive lower bound. 4473 ExclusiveMinimum float64 `json:"exclusiveMinimum,omitempty"` 4474 // Maximum: Inclusive upper bound. 4475 Maximum float64 `json:"maximum,omitempty"` 4476 // Minimum: Inclusive lower bound. 4477 Minimum float64 `json:"minimum,omitempty"` 4478 // ForceSendFields is a list of field names (e.g. "ExclusiveMaximum") to 4479 // unconditionally include in API requests. By default, fields with empty or 4480 // default values are omitted from API requests. See 4481 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4482 // details. 4483 ForceSendFields []string `json:"-"` 4484 // NullFields is a list of field names (e.g. "ExclusiveMaximum") to include in 4485 // API requests with the JSON null value. By default, fields with empty values 4486 // are omitted from API requests. See 4487 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4488 NullFields []string `json:"-"` 4489 } 4490 4491 func (s *GoogleCloudRetailV2betaInterval) MarshalJSON() ([]byte, error) { 4492 type NoMethod GoogleCloudRetailV2betaInterval 4493 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4494 } 4495 4496 func (s *GoogleCloudRetailV2betaInterval) UnmarshalJSON(data []byte) error { 4497 type NoMethod GoogleCloudRetailV2betaInterval 4498 var s1 struct { 4499 ExclusiveMaximum gensupport.JSONFloat64 `json:"exclusiveMaximum"` 4500 ExclusiveMinimum gensupport.JSONFloat64 `json:"exclusiveMinimum"` 4501 Maximum gensupport.JSONFloat64 `json:"maximum"` 4502 Minimum gensupport.JSONFloat64 `json:"minimum"` 4503 *NoMethod 4504 } 4505 s1.NoMethod = (*NoMethod)(s) 4506 if err := json.Unmarshal(data, &s1); err != nil { 4507 return err 4508 } 4509 s.ExclusiveMaximum = float64(s1.ExclusiveMaximum) 4510 s.ExclusiveMinimum = float64(s1.ExclusiveMinimum) 4511 s.Maximum = float64(s1.Maximum) 4512 s.Minimum = float64(s1.Minimum) 4513 return nil 4514 } 4515 4516 // GoogleCloudRetailV2betaListCatalogsResponse: Response for 4517 // CatalogService.ListCatalogs method. 4518 type GoogleCloudRetailV2betaListCatalogsResponse struct { 4519 // Catalogs: All the customer's Catalogs. 4520 Catalogs []*GoogleCloudRetailV2betaCatalog `json:"catalogs,omitempty"` 4521 // NextPageToken: A token that can be sent as ListCatalogsRequest.page_token to 4522 // retrieve the next page. If this field is omitted, there are no subsequent 4523 // pages. 4524 NextPageToken string `json:"nextPageToken,omitempty"` 4525 4526 // ServerResponse contains the HTTP response code and headers from the server. 4527 googleapi.ServerResponse `json:"-"` 4528 // ForceSendFields is a list of field names (e.g. "Catalogs") to 4529 // unconditionally include in API requests. By default, fields with empty or 4530 // default values are omitted from API requests. See 4531 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4532 // details. 4533 ForceSendFields []string `json:"-"` 4534 // NullFields is a list of field names (e.g. "Catalogs") to include in API 4535 // requests with the JSON null value. By default, fields with empty values are 4536 // omitted from API requests. See 4537 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4538 NullFields []string `json:"-"` 4539 } 4540 4541 func (s *GoogleCloudRetailV2betaListCatalogsResponse) MarshalJSON() ([]byte, error) { 4542 type NoMethod GoogleCloudRetailV2betaListCatalogsResponse 4543 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4544 } 4545 4546 // GoogleCloudRetailV2betaListControlsResponse: Response for ListControls 4547 // method. 4548 type GoogleCloudRetailV2betaListControlsResponse struct { 4549 // Controls: All the Controls for a given catalog. 4550 Controls []*GoogleCloudRetailV2betaControl `json:"controls,omitempty"` 4551 // NextPageToken: Pagination token, if not returned indicates the last page. 4552 NextPageToken string `json:"nextPageToken,omitempty"` 4553 4554 // ServerResponse contains the HTTP response code and headers from the server. 4555 googleapi.ServerResponse `json:"-"` 4556 // ForceSendFields is a list of field names (e.g. "Controls") to 4557 // unconditionally include in API requests. By default, fields with empty or 4558 // default values are omitted from API requests. See 4559 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4560 // details. 4561 ForceSendFields []string `json:"-"` 4562 // NullFields is a list of field names (e.g. "Controls") to include in API 4563 // requests with the JSON null value. By default, fields with empty values are 4564 // omitted from API requests. See 4565 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4566 NullFields []string `json:"-"` 4567 } 4568 4569 func (s *GoogleCloudRetailV2betaListControlsResponse) MarshalJSON() ([]byte, error) { 4570 type NoMethod GoogleCloudRetailV2betaListControlsResponse 4571 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4572 } 4573 4574 // GoogleCloudRetailV2betaListModelsResponse: Response to a ListModelRequest. 4575 type GoogleCloudRetailV2betaListModelsResponse struct { 4576 // Models: List of Models. 4577 Models []*GoogleCloudRetailV2betaModel `json:"models,omitempty"` 4578 // NextPageToken: Pagination token, if not returned indicates the last page. 4579 NextPageToken string `json:"nextPageToken,omitempty"` 4580 4581 // ServerResponse contains the HTTP response code and headers from the server. 4582 googleapi.ServerResponse `json:"-"` 4583 // ForceSendFields is a list of field names (e.g. "Models") to unconditionally 4584 // include in API requests. By default, fields with empty or default values are 4585 // omitted from API requests. See 4586 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4587 // details. 4588 ForceSendFields []string `json:"-"` 4589 // NullFields is a list of field names (e.g. "Models") to include in API 4590 // requests with the JSON null value. By default, fields with empty values are 4591 // omitted from API requests. See 4592 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4593 NullFields []string `json:"-"` 4594 } 4595 4596 func (s *GoogleCloudRetailV2betaListModelsResponse) MarshalJSON() ([]byte, error) { 4597 type NoMethod GoogleCloudRetailV2betaListModelsResponse 4598 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4599 } 4600 4601 // GoogleCloudRetailV2betaListProductsResponse: Response message for 4602 // ProductService.ListProducts method. 4603 type GoogleCloudRetailV2betaListProductsResponse struct { 4604 // NextPageToken: A token that can be sent as ListProductsRequest.page_token to 4605 // retrieve the next page. If this field is omitted, there are no subsequent 4606 // pages. 4607 NextPageToken string `json:"nextPageToken,omitempty"` 4608 // Products: The Products. 4609 Products []*GoogleCloudRetailV2betaProduct `json:"products,omitempty"` 4610 4611 // ServerResponse contains the HTTP response code and headers from the server. 4612 googleapi.ServerResponse `json:"-"` 4613 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 4614 // unconditionally include in API requests. By default, fields with empty or 4615 // default values are omitted from API requests. See 4616 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4617 // details. 4618 ForceSendFields []string `json:"-"` 4619 // NullFields is a list of field names (e.g. "NextPageToken") to include in API 4620 // requests with the JSON null value. By default, fields with empty values are 4621 // omitted from API requests. See 4622 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4623 NullFields []string `json:"-"` 4624 } 4625 4626 func (s *GoogleCloudRetailV2betaListProductsResponse) MarshalJSON() ([]byte, error) { 4627 type NoMethod GoogleCloudRetailV2betaListProductsResponse 4628 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4629 } 4630 4631 // GoogleCloudRetailV2betaListServingConfigsResponse: Response for 4632 // ListServingConfigs method. 4633 type GoogleCloudRetailV2betaListServingConfigsResponse struct { 4634 // NextPageToken: Pagination token, if not returned indicates the last page. 4635 NextPageToken string `json:"nextPageToken,omitempty"` 4636 // ServingConfigs: All the ServingConfigs for a given catalog. 4637 ServingConfigs []*GoogleCloudRetailV2betaServingConfig `json:"servingConfigs,omitempty"` 4638 4639 // ServerResponse contains the HTTP response code and headers from the server. 4640 googleapi.ServerResponse `json:"-"` 4641 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 4642 // unconditionally include in API requests. By default, fields with empty or 4643 // default values are omitted from API requests. See 4644 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4645 // details. 4646 ForceSendFields []string `json:"-"` 4647 // NullFields is a list of field names (e.g. "NextPageToken") to include in API 4648 // requests with the JSON null value. By default, fields with empty values are 4649 // omitted from API requests. See 4650 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4651 NullFields []string `json:"-"` 4652 } 4653 4654 func (s *GoogleCloudRetailV2betaListServingConfigsResponse) MarshalJSON() ([]byte, error) { 4655 type NoMethod GoogleCloudRetailV2betaListServingConfigsResponse 4656 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4657 } 4658 4659 // GoogleCloudRetailV2betaLocalInventory: The inventory information at a place 4660 // (e.g. a store) identified by a place ID. 4661 type GoogleCloudRetailV2betaLocalInventory struct { 4662 // Attributes: Additional local inventory attributes, for example, store name, 4663 // promotion tags, etc. This field needs to pass all below criteria, otherwise 4664 // an INVALID_ARGUMENT error is returned: * At most 30 attributes are allowed. 4665 // * The key must be a UTF-8 encoded string with a length limit of 32 4666 // characters. * The key must match the pattern: `a-zA-Z0-9*`. For example, 4667 // key0LikeThis or KEY_1_LIKE_THIS. * The attribute values must be of the same 4668 // type (text or number). * Only 1 value is allowed for each attribute. * For 4669 // text values, the length limit is 256 UTF-8 characters. * The attribute does 4670 // not support search. The `searchable` field should be unset or set to false. 4671 // * The max summed total bytes of custom attribute keys and values per product 4672 // is 5MiB. 4673 Attributes map[string]GoogleCloudRetailV2betaCustomAttribute `json:"attributes,omitempty"` 4674 // FulfillmentTypes: Input only. Supported fulfillment types. Valid fulfillment 4675 // type values include commonly used types (such as pickup in store and same 4676 // day delivery), and custom types. Customers have to map custom types to their 4677 // display names before rendering UI. Supported values: * "pickup-in-store" * 4678 // "ship-to-store" * "same-day-delivery" * "next-day-delivery" * 4679 // "custom-type-1" * "custom-type-2" * "custom-type-3" * "custom-type-4" * 4680 // "custom-type-5" If this field is set to an invalid value other than these, 4681 // an INVALID_ARGUMENT error is returned. All the elements must be distinct. 4682 // Otherwise, an INVALID_ARGUMENT error is returned. 4683 FulfillmentTypes []string `json:"fulfillmentTypes,omitempty"` 4684 // PlaceId: The place ID for the current set of inventory information. 4685 PlaceId string `json:"placeId,omitempty"` 4686 // PriceInfo: Product price and cost information. Google Merchant Center 4687 // property price (https://support.google.com/merchants/answer/6324371). 4688 PriceInfo *GoogleCloudRetailV2betaPriceInfo `json:"priceInfo,omitempty"` 4689 // ForceSendFields is a list of field names (e.g. "Attributes") to 4690 // unconditionally include in API requests. By default, fields with empty or 4691 // default values are omitted from API requests. See 4692 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4693 // details. 4694 ForceSendFields []string `json:"-"` 4695 // NullFields is a list of field names (e.g. "Attributes") to include in API 4696 // requests with the JSON null value. By default, fields with empty values are 4697 // omitted from API requests. See 4698 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4699 NullFields []string `json:"-"` 4700 } 4701 4702 func (s *GoogleCloudRetailV2betaLocalInventory) MarshalJSON() ([]byte, error) { 4703 type NoMethod GoogleCloudRetailV2betaLocalInventory 4704 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4705 } 4706 4707 // GoogleCloudRetailV2betaMerchantCenterAccountLink: Represents a link between 4708 // a Merchant Center account and a branch. After a link is established, 4709 // products from the linked Merchant Center account are streamed to the linked 4710 // branch. 4711 type GoogleCloudRetailV2betaMerchantCenterAccountLink struct { 4712 // BranchId: Required. The branch ID (e.g. 0/1/2) within the catalog that 4713 // products from merchant_center_account_id are streamed to. When updating this 4714 // field, an empty value will use the currently configured default branch. 4715 // However, changing the default branch later on won't change the linked branch 4716 // here. A single branch ID can only have one linked Merchant Center account 4717 // ID. 4718 BranchId string `json:"branchId,omitempty"` 4719 // FeedFilters: Criteria for the Merchant Center feeds to be ingested via the 4720 // link. All offers will be ingested if the list is empty. Otherwise the offers 4721 // will be ingested from selected feeds. 4722 FeedFilters []*GoogleCloudRetailV2betaMerchantCenterAccountLinkMerchantCenterFeedFilter `json:"feedFilters,omitempty"` 4723 // FeedLabel: The FeedLabel used to perform filtering. Note: this replaces 4724 // region_id 4725 // (https://developers.google.com/shopping-content/reference/rest/v2.1/products#Product.FIELDS.feed_label). 4726 // Example value: `US`. Example value: `FeedLabel1`. 4727 FeedLabel string `json:"feedLabel,omitempty"` 4728 // Id: Output only. Immutable. MerchantCenterAccountLink identifier, which is 4729 // the final component of name. This field is auto generated and follows the 4730 // convention: `BranchId_MerchantCenterAccountId`. 4731 // `projects/*/locations/global/catalogs/default_catalog/merchantCenterAccountLi 4732 // nks/id_1`. 4733 Id string `json:"id,omitempty"` 4734 // LanguageCode: Language of the title/description and other string attributes. 4735 // Use language tags defined by BCP 47 4736 // (https://www.rfc-editor.org/rfc/bcp/bcp47.txt). ISO 639-1. This specifies 4737 // the language of offers in Merchant Center that will be accepted. If empty, 4738 // no language filtering will be performed. Example value: `en`. 4739 LanguageCode string `json:"languageCode,omitempty"` 4740 // MerchantCenterAccountId: Required. The linked Merchant center account id 4741 // (https://developers.google.com/shopping-content/guides/accountstatuses). The 4742 // account must be a standalone account or a sub-account of a MCA. 4743 MerchantCenterAccountId int64 `json:"merchantCenterAccountId,omitempty,string"` 4744 // Name: Output only. Immutable. Full resource name of the Merchant Center 4745 // Account Link, such as 4746 // `projects/*/locations/global/catalogs/default_catalog/merchantCenterAccountLi 4747 // nks/merchant_center_account_link`. 4748 Name string `json:"name,omitempty"` 4749 // ProjectId: Output only. Google Cloud project ID. 4750 ProjectId string `json:"projectId,omitempty"` 4751 // Source: Optional. An optional arbitrary string that could be used as a tag 4752 // for tracking link source. 4753 Source string `json:"source,omitempty"` 4754 // State: Output only. Represents the state of the link. 4755 // 4756 // Possible values: 4757 // "STATE_UNSPECIFIED" - Default value. 4758 // "PENDING" - Link is created and LRO is not complete. 4759 // "ACTIVE" - Link is active. 4760 // "FAILED" - Link creation failed. 4761 State string `json:"state,omitempty"` 4762 // ForceSendFields is a list of field names (e.g. "BranchId") to 4763 // unconditionally include in API requests. By default, fields with empty or 4764 // default values are omitted from API requests. See 4765 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4766 // details. 4767 ForceSendFields []string `json:"-"` 4768 // NullFields is a list of field names (e.g. "BranchId") to include in API 4769 // requests with the JSON null value. By default, fields with empty values are 4770 // omitted from API requests. See 4771 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4772 NullFields []string `json:"-"` 4773 } 4774 4775 func (s *GoogleCloudRetailV2betaMerchantCenterAccountLink) MarshalJSON() ([]byte, error) { 4776 type NoMethod GoogleCloudRetailV2betaMerchantCenterAccountLink 4777 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4778 } 4779 4780 // GoogleCloudRetailV2betaMerchantCenterAccountLinkMerchantCenterFeedFilter: 4781 // Merchant Center Feed filter criterion. 4782 type GoogleCloudRetailV2betaMerchantCenterAccountLinkMerchantCenterFeedFilter struct { 4783 // PrimaryFeedId: Merchant Center primary feed ID. 4784 PrimaryFeedId int64 `json:"primaryFeedId,omitempty,string"` 4785 // PrimaryFeedName: Merchant Center primary feed name. The name is used for the 4786 // display purposes only. 4787 PrimaryFeedName string `json:"primaryFeedName,omitempty"` 4788 // ForceSendFields is a list of field names (e.g. "PrimaryFeedId") to 4789 // unconditionally include in API requests. By default, fields with empty or 4790 // default values are omitted from API requests. See 4791 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4792 // details. 4793 ForceSendFields []string `json:"-"` 4794 // NullFields is a list of field names (e.g. "PrimaryFeedId") to include in API 4795 // requests with the JSON null value. By default, fields with empty values are 4796 // omitted from API requests. See 4797 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4798 NullFields []string `json:"-"` 4799 } 4800 4801 func (s *GoogleCloudRetailV2betaMerchantCenterAccountLinkMerchantCenterFeedFilter) MarshalJSON() ([]byte, error) { 4802 type NoMethod GoogleCloudRetailV2betaMerchantCenterAccountLinkMerchantCenterFeedFilter 4803 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4804 } 4805 4806 // GoogleCloudRetailV2betaMerchantCenterFeedFilter: Merchant Center Feed filter 4807 // criterion. 4808 type GoogleCloudRetailV2betaMerchantCenterFeedFilter struct { 4809 // PrimaryFeedId: Merchant Center primary feed ID. 4810 PrimaryFeedId int64 `json:"primaryFeedId,omitempty,string"` 4811 // PrimaryFeedName: Merchant Center primary feed name. The name is used for the 4812 // display purposes only. 4813 PrimaryFeedName string `json:"primaryFeedName,omitempty"` 4814 // ForceSendFields is a list of field names (e.g. "PrimaryFeedId") to 4815 // unconditionally include in API requests. By default, fields with empty or 4816 // default values are omitted from API requests. See 4817 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4818 // details. 4819 ForceSendFields []string `json:"-"` 4820 // NullFields is a list of field names (e.g. "PrimaryFeedId") to include in API 4821 // requests with the JSON null value. By default, fields with empty values are 4822 // omitted from API requests. See 4823 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4824 NullFields []string `json:"-"` 4825 } 4826 4827 func (s *GoogleCloudRetailV2betaMerchantCenterFeedFilter) MarshalJSON() ([]byte, error) { 4828 type NoMethod GoogleCloudRetailV2betaMerchantCenterFeedFilter 4829 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4830 } 4831 4832 // GoogleCloudRetailV2betaMerchantCenterLink: Represents a link between a 4833 // Merchant Center account and a branch. After a link is established, products 4834 // from the linked Merchant Center account are streamed to the linked branch. 4835 type GoogleCloudRetailV2betaMerchantCenterLink struct { 4836 // BranchId: The branch ID (e.g. 0/1/2) within this catalog that products from 4837 // merchant_center_account_id are streamed to. When updating this field, an 4838 // empty value will use the currently configured default branch. However, 4839 // changing the default branch later on won't change the linked branch here. A 4840 // single branch ID can only have one linked Merchant Center account ID. 4841 BranchId string `json:"branchId,omitempty"` 4842 // Destinations: String representing the destination to import for, all if left 4843 // empty. List of possible values is given in Included destination 4844 // (https://support.google.com/merchants/answer/7501026). List of allowed 4845 // string values: "Shopping_ads", "Buy_on_google_listings", "Display_ads", 4846 // "Local_inventory _ads", "Free_listings", "Free_local_listings" NOTE: The 4847 // string values are case sensitive. 4848 Destinations []string `json:"destinations,omitempty"` 4849 // Feeds: Criteria for the Merchant Center feeds to be ingested via the link. 4850 // All offers will be ingested if the list is empty. Otherwise the offers will 4851 // be ingested from selected feeds. 4852 Feeds []*GoogleCloudRetailV2betaMerchantCenterFeedFilter `json:"feeds,omitempty"` 4853 // LanguageCode: Language of the title/description and other string attributes. 4854 // Use language tags defined by BCP 47 4855 // (https://www.rfc-editor.org/rfc/bcp/bcp47.txt). ISO 639-1. This specifies 4856 // the language of offers in Merchant Center that will be accepted. If empty no 4857 // language filtering will be performed. Example value: `en`. 4858 LanguageCode string `json:"languageCode,omitempty"` 4859 // MerchantCenterAccountId: Required. The linked Merchant Center account ID 4860 // (https://developers.google.com/shopping-content/guides/accountstatuses). The 4861 // account must be a standalone account or a sub-account of a MCA. 4862 MerchantCenterAccountId int64 `json:"merchantCenterAccountId,omitempty,string"` 4863 // RegionCode: Region code of offers to accept. 2-letter Uppercase ISO 3166-1 4864 // alpha-2 code. List of values can be found here 4865 // (https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry) 4866 // under the `region` tag. If left blank no region filtering will be performed. 4867 // Example value: `US`. 4868 RegionCode string `json:"regionCode,omitempty"` 4869 // ForceSendFields is a list of field names (e.g. "BranchId") to 4870 // unconditionally include in API requests. By default, fields with empty or 4871 // default values are omitted from API requests. See 4872 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4873 // details. 4874 ForceSendFields []string `json:"-"` 4875 // NullFields is a list of field names (e.g. "BranchId") to include in API 4876 // requests with the JSON null value. By default, fields with empty values are 4877 // omitted from API requests. See 4878 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4879 NullFields []string `json:"-"` 4880 } 4881 4882 func (s *GoogleCloudRetailV2betaMerchantCenterLink) MarshalJSON() ([]byte, error) { 4883 type NoMethod GoogleCloudRetailV2betaMerchantCenterLink 4884 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4885 } 4886 4887 // GoogleCloudRetailV2betaMerchantCenterLinkingConfig: Configures Merchant 4888 // Center linking. Links contained in the config will be used to sync data from 4889 // a Merchant Center account to a Cloud Retail branch. 4890 type GoogleCloudRetailV2betaMerchantCenterLinkingConfig struct { 4891 // Links: Links between Merchant Center accounts and branches. 4892 Links []*GoogleCloudRetailV2betaMerchantCenterLink `json:"links,omitempty"` 4893 // ForceSendFields is a list of field names (e.g. "Links") to unconditionally 4894 // include in API requests. By default, fields with empty or default values are 4895 // omitted from API requests. See 4896 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4897 // details. 4898 ForceSendFields []string `json:"-"` 4899 // NullFields is a list of field names (e.g. "Links") to include in API 4900 // requests with the JSON null value. By default, fields with empty values are 4901 // omitted from API requests. See 4902 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4903 NullFields []string `json:"-"` 4904 } 4905 4906 func (s *GoogleCloudRetailV2betaMerchantCenterLinkingConfig) MarshalJSON() ([]byte, error) { 4907 type NoMethod GoogleCloudRetailV2betaMerchantCenterLinkingConfig 4908 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4909 } 4910 4911 // GoogleCloudRetailV2betaModel: Metadata that describes the training and 4912 // serving parameters of a Model. A Model can be associated with a 4913 // ServingConfig and then queried through the Predict API. 4914 type GoogleCloudRetailV2betaModel struct { 4915 // CreateTime: Output only. Timestamp the Recommendation Model was created at. 4916 CreateTime string `json:"createTime,omitempty"` 4917 // DataState: Output only. The state of data requirements for this model: 4918 // `DATA_OK` and `DATA_ERROR`. Recommendation model cannot be trained if the 4919 // data is in `DATA_ERROR` state. Recommendation model can have `DATA_ERROR` 4920 // state even if serving state is `ACTIVE`: models were trained successfully 4921 // before, but cannot be refreshed because model no longer has sufficient data 4922 // for training. 4923 // 4924 // Possible values: 4925 // "DATA_STATE_UNSPECIFIED" - Unspecified default value, should never be 4926 // explicitly set. 4927 // "DATA_OK" - The model has sufficient training data. 4928 // "DATA_ERROR" - The model does not have sufficient training data. Error 4929 // messages can be queried via Stackdriver. 4930 DataState string `json:"dataState,omitempty"` 4931 // DisplayName: Required. The display name of the model. Should be human 4932 // readable, used to display Recommendation Models in the Retail Cloud Console 4933 // Dashboard. UTF-8 encoded string with limit of 1024 characters. 4934 DisplayName string `json:"displayName,omitempty"` 4935 // FilteringOption: Optional. If `RECOMMENDATIONS_FILTERING_ENABLED`, 4936 // recommendation filtering by attributes is enabled for the model. 4937 // 4938 // Possible values: 4939 // "RECOMMENDATIONS_FILTERING_OPTION_UNSPECIFIED" - Value used when unset. In 4940 // this case, server behavior defaults to RECOMMENDATIONS_FILTERING_DISABLED. 4941 // "RECOMMENDATIONS_FILTERING_DISABLED" - Recommendation filtering is 4942 // disabled. 4943 // "RECOMMENDATIONS_FILTERING_ENABLED" - Recommendation filtering is enabled. 4944 FilteringOption string `json:"filteringOption,omitempty"` 4945 // LastTuneTime: Output only. The timestamp when the latest successful tune 4946 // finished. 4947 LastTuneTime string `json:"lastTuneTime,omitempty"` 4948 // ModelFeaturesConfig: Optional. Additional model features config. 4949 ModelFeaturesConfig *GoogleCloudRetailV2betaModelModelFeaturesConfig `json:"modelFeaturesConfig,omitempty"` 4950 // Name: Required. The fully qualified resource name of the model. Format: 4951 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/mode 4952 // ls/{model_id}` catalog_id has char limit of 50. recommendation_model_id has 4953 // char limit of 40. 4954 Name string `json:"name,omitempty"` 4955 // OptimizationObjective: Optional. The optimization objective e.g. `cvr`. 4956 // Currently supported values: `ctr`, `cvr`, `revenue-per-order`. If not 4957 // specified, we choose default based on model type. Default depends on type of 4958 // recommendation: `recommended-for-you` => `ctr` `others-you-may-like` => 4959 // `ctr` `frequently-bought-together` => `revenue_per_order` This field 4960 // together with optimization_objective describe model metadata to use to 4961 // control model training and serving. See 4962 // https://cloud.google.com/retail/docs/models for more details on what the 4963 // model metadata control and which combination of parameters are valid. For 4964 // invalid combinations of parameters (e.g. type = `frequently-bought-together` 4965 // and optimization_objective = `ctr`), you receive an error 400 if you try to 4966 // create/update a recommendation with this set of knobs. 4967 OptimizationObjective string `json:"optimizationObjective,omitempty"` 4968 // PeriodicTuningState: Optional. The state of periodic tuning. The period we 4969 // use is 3 months - to do a one-off tune earlier use the `TuneModel` method. 4970 // Default value is `PERIODIC_TUNING_ENABLED`. 4971 // 4972 // Possible values: 4973 // "PERIODIC_TUNING_STATE_UNSPECIFIED" - Unspecified default value, should 4974 // never be explicitly set. 4975 // "PERIODIC_TUNING_DISABLED" - The model has periodic tuning disabled. 4976 // Tuning can be reenabled by calling the `EnableModelPeriodicTuning` method or 4977 // by calling the `TuneModel` method. 4978 // "ALL_TUNING_DISABLED" - The model cannot be tuned with periodic tuning OR 4979 // the `TuneModel` method. Hide the options in customer UI and reject any 4980 // requests through the backend self serve API. 4981 // "PERIODIC_TUNING_ENABLED" - The model has periodic tuning enabled. Tuning 4982 // can be disabled by calling the `DisableModelPeriodicTuning` method. 4983 PeriodicTuningState string `json:"periodicTuningState,omitempty"` 4984 // ServingConfigLists: Output only. The list of valid serving configs 4985 // associated with the PageOptimizationConfig. 4986 ServingConfigLists []*GoogleCloudRetailV2betaModelServingConfigList `json:"servingConfigLists,omitempty"` 4987 // ServingState: Output only. The serving state of the model: `ACTIVE`, 4988 // `NOT_ACTIVE`. 4989 // 4990 // Possible values: 4991 // "SERVING_STATE_UNSPECIFIED" - Unspecified serving state. 4992 // "INACTIVE" - The model is not serving. 4993 // "ACTIVE" - The model is serving and can be queried. 4994 // "TUNED" - The model is trained on tuned hyperparameters and can be 4995 // queried. 4996 ServingState string `json:"servingState,omitempty"` 4997 // TrainingState: Optional. The training state that the model is in (e.g. 4998 // `TRAINING` or `PAUSED`). Since part of the cost of running the service is 4999 // frequency of training - this can be used to determine when to train model in 5000 // order to control cost. If not specified: the default value for `CreateModel` 5001 // method is `TRAINING`. The default value for `UpdateModel` method is to keep 5002 // the state the same as before. 5003 // 5004 // Possible values: 5005 // "TRAINING_STATE_UNSPECIFIED" - Unspecified training state. 5006 // "PAUSED" - The model training is paused. 5007 // "TRAINING" - The model is training. 5008 TrainingState string `json:"trainingState,omitempty"` 5009 // TuningOperation: Output only. The tune operation associated with the model. 5010 // Can be used to determine if there is an ongoing tune for this 5011 // recommendation. Empty field implies no tune is goig on. 5012 TuningOperation string `json:"tuningOperation,omitempty"` 5013 // Type: Required. The type of model e.g. `home-page`. Currently supported 5014 // values: `recommended-for-you`, `others-you-may-like`, 5015 // `frequently-bought-together`, `page-optimization`, `similar-items`, 5016 // `buy-it-again`, `on-sale-items`, and `recently-viewed`(readonly value). This 5017 // field together with optimization_objective describe model metadata to use to 5018 // control model training and serving. See 5019 // https://cloud.google.com/retail/docs/models for more details on what the 5020 // model metadata control and which combination of parameters are valid. For 5021 // invalid combinations of parameters (e.g. type = `frequently-bought-together` 5022 // and optimization_objective = `ctr`), you receive an error 400 if you try to 5023 // create/update a recommendation with this set of knobs. 5024 Type string `json:"type,omitempty"` 5025 // UpdateTime: Output only. Timestamp the Recommendation Model was last 5026 // updated. E.g. if a Recommendation Model was paused - this would be the time 5027 // the pause was initiated. 5028 UpdateTime string `json:"updateTime,omitempty"` 5029 5030 // ServerResponse contains the HTTP response code and headers from the server. 5031 googleapi.ServerResponse `json:"-"` 5032 // ForceSendFields is a list of field names (e.g. "CreateTime") to 5033 // unconditionally include in API requests. By default, fields with empty or 5034 // default values are omitted from API requests. See 5035 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5036 // details. 5037 ForceSendFields []string `json:"-"` 5038 // NullFields is a list of field names (e.g. "CreateTime") to include in API 5039 // requests with the JSON null value. By default, fields with empty values are 5040 // omitted from API requests. See 5041 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5042 NullFields []string `json:"-"` 5043 } 5044 5045 func (s *GoogleCloudRetailV2betaModel) MarshalJSON() ([]byte, error) { 5046 type NoMethod GoogleCloudRetailV2betaModel 5047 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5048 } 5049 5050 // GoogleCloudRetailV2betaModelFrequentlyBoughtTogetherFeaturesConfig: 5051 // Additional configs for the frequently-bought-together model type. 5052 type GoogleCloudRetailV2betaModelFrequentlyBoughtTogetherFeaturesConfig struct { 5053 // ContextProductsType: Optional. Specifies the context of the model when it is 5054 // used in predict requests. Can only be set for the 5055 // `frequently-bought-together` type. If it isn't specified, it defaults to 5056 // MULTIPLE_CONTEXT_PRODUCTS. 5057 // 5058 // Possible values: 5059 // "CONTEXT_PRODUCTS_TYPE_UNSPECIFIED" - Unspecified default value, should 5060 // never be explicitly set. Defaults to MULTIPLE_CONTEXT_PRODUCTS. 5061 // "SINGLE_CONTEXT_PRODUCT" - Use only a single product as context for the 5062 // recommendation. Typically used on pages like add-to-cart or product details. 5063 // "MULTIPLE_CONTEXT_PRODUCTS" - Use one or multiple products as context for 5064 // the recommendation. Typically used on shopping cart pages. 5065 ContextProductsType string `json:"contextProductsType,omitempty"` 5066 // ForceSendFields is a list of field names (e.g. "ContextProductsType") to 5067 // unconditionally include in API requests. By default, fields with empty or 5068 // default values are omitted from API requests. See 5069 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5070 // details. 5071 ForceSendFields []string `json:"-"` 5072 // NullFields is a list of field names (e.g. "ContextProductsType") to include 5073 // in API requests with the JSON null value. By default, fields with empty 5074 // values are omitted from API requests. See 5075 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5076 NullFields []string `json:"-"` 5077 } 5078 5079 func (s *GoogleCloudRetailV2betaModelFrequentlyBoughtTogetherFeaturesConfig) MarshalJSON() ([]byte, error) { 5080 type NoMethod GoogleCloudRetailV2betaModelFrequentlyBoughtTogetherFeaturesConfig 5081 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5082 } 5083 5084 // GoogleCloudRetailV2betaModelModelFeaturesConfig: Additional model features 5085 // config. 5086 type GoogleCloudRetailV2betaModelModelFeaturesConfig struct { 5087 // FrequentlyBoughtTogetherConfig: Additional configs for 5088 // frequently-bought-together models. 5089 FrequentlyBoughtTogetherConfig *GoogleCloudRetailV2betaModelFrequentlyBoughtTogetherFeaturesConfig `json:"frequentlyBoughtTogetherConfig,omitempty"` 5090 // ForceSendFields is a list of field names (e.g. 5091 // "FrequentlyBoughtTogetherConfig") to unconditionally include in API 5092 // requests. By default, fields with empty or default values are omitted from 5093 // API requests. See 5094 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5095 // details. 5096 ForceSendFields []string `json:"-"` 5097 // NullFields is a list of field names (e.g. "FrequentlyBoughtTogetherConfig") 5098 // to include in API requests with the JSON null value. By default, fields with 5099 // empty values are omitted from API requests. See 5100 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5101 NullFields []string `json:"-"` 5102 } 5103 5104 func (s *GoogleCloudRetailV2betaModelModelFeaturesConfig) MarshalJSON() ([]byte, error) { 5105 type NoMethod GoogleCloudRetailV2betaModelModelFeaturesConfig 5106 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5107 } 5108 5109 // GoogleCloudRetailV2betaModelServingConfigList: Represents an ordered 5110 // combination of valid serving configs, which can be used for 5111 // `PAGE_OPTIMIZATION` recommendations. 5112 type GoogleCloudRetailV2betaModelServingConfigList struct { 5113 // ServingConfigIds: Optional. A set of valid serving configs that may be used 5114 // for `PAGE_OPTIMIZATION`. 5115 ServingConfigIds []string `json:"servingConfigIds,omitempty"` 5116 // ForceSendFields is a list of field names (e.g. "ServingConfigIds") to 5117 // unconditionally include in API requests. By default, fields with empty or 5118 // default values are omitted from API requests. See 5119 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5120 // details. 5121 ForceSendFields []string `json:"-"` 5122 // NullFields is a list of field names (e.g. "ServingConfigIds") to include in 5123 // API requests with the JSON null value. By default, fields with empty values 5124 // are omitted from API requests. See 5125 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5126 NullFields []string `json:"-"` 5127 } 5128 5129 func (s *GoogleCloudRetailV2betaModelServingConfigList) MarshalJSON() ([]byte, error) { 5130 type NoMethod GoogleCloudRetailV2betaModelServingConfigList 5131 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5132 } 5133 5134 // GoogleCloudRetailV2betaOutputConfig: The output configuration setting. 5135 type GoogleCloudRetailV2betaOutputConfig struct { 5136 // BigqueryDestination: The BigQuery location where the output is to be written 5137 // to. 5138 BigqueryDestination *GoogleCloudRetailV2betaOutputConfigBigQueryDestination `json:"bigqueryDestination,omitempty"` 5139 // GcsDestination: The Google Cloud Storage location where the output is to be 5140 // written to. 5141 GcsDestination *GoogleCloudRetailV2betaOutputConfigGcsDestination `json:"gcsDestination,omitempty"` 5142 // ForceSendFields is a list of field names (e.g. "BigqueryDestination") to 5143 // unconditionally include in API requests. By default, fields with empty or 5144 // default values are omitted from API requests. See 5145 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5146 // details. 5147 ForceSendFields []string `json:"-"` 5148 // NullFields is a list of field names (e.g. "BigqueryDestination") to include 5149 // in API requests with the JSON null value. By default, fields with empty 5150 // values are omitted from API requests. See 5151 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5152 NullFields []string `json:"-"` 5153 } 5154 5155 func (s *GoogleCloudRetailV2betaOutputConfig) MarshalJSON() ([]byte, error) { 5156 type NoMethod GoogleCloudRetailV2betaOutputConfig 5157 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5158 } 5159 5160 // GoogleCloudRetailV2betaOutputConfigBigQueryDestination: The BigQuery output 5161 // destination configuration. 5162 type GoogleCloudRetailV2betaOutputConfigBigQueryDestination struct { 5163 // DatasetId: Required. The ID of a BigQuery Dataset. 5164 DatasetId string `json:"datasetId,omitempty"` 5165 // TableIdPrefix: Required. The prefix of exported BigQuery tables. 5166 TableIdPrefix string `json:"tableIdPrefix,omitempty"` 5167 // TableType: Required. Describes the table type. The following values are 5168 // supported: * `table`: A BigQuery native table. * `view`: A virtual table 5169 // defined by a SQL query. 5170 TableType string `json:"tableType,omitempty"` 5171 // ForceSendFields is a list of field names (e.g. "DatasetId") to 5172 // unconditionally include in API requests. By default, fields with empty or 5173 // default values are omitted from API requests. See 5174 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5175 // details. 5176 ForceSendFields []string `json:"-"` 5177 // NullFields is a list of field names (e.g. "DatasetId") to include in API 5178 // requests with the JSON null value. By default, fields with empty values are 5179 // omitted from API requests. See 5180 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5181 NullFields []string `json:"-"` 5182 } 5183 5184 func (s *GoogleCloudRetailV2betaOutputConfigBigQueryDestination) MarshalJSON() ([]byte, error) { 5185 type NoMethod GoogleCloudRetailV2betaOutputConfigBigQueryDestination 5186 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5187 } 5188 5189 // GoogleCloudRetailV2betaOutputConfigGcsDestination: The Google Cloud Storage 5190 // output destination configuration. 5191 type GoogleCloudRetailV2betaOutputConfigGcsDestination struct { 5192 // OutputUriPrefix: Required. The output uri prefix for saving output data to 5193 // json files. Some mapping examples are as follows: output_uri_prefix sample 5194 // output(assuming the object is foo.json) ======================== 5195 // ============================================= gs://bucket/ 5196 // gs://bucket/foo.json gs://bucket/folder/ gs://bucket/folder/foo.json 5197 // gs://bucket/folder/item_ gs://bucket/folder/item_foo.json 5198 OutputUriPrefix string `json:"outputUriPrefix,omitempty"` 5199 // ForceSendFields is a list of field names (e.g. "OutputUriPrefix") to 5200 // unconditionally include in API requests. By default, fields with empty or 5201 // default values are omitted from API requests. See 5202 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5203 // details. 5204 ForceSendFields []string `json:"-"` 5205 // NullFields is a list of field names (e.g. "OutputUriPrefix") to include in 5206 // API requests with the JSON null value. By default, fields with empty values 5207 // are omitted from API requests. See 5208 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5209 NullFields []string `json:"-"` 5210 } 5211 5212 func (s *GoogleCloudRetailV2betaOutputConfigGcsDestination) MarshalJSON() ([]byte, error) { 5213 type NoMethod GoogleCloudRetailV2betaOutputConfigGcsDestination 5214 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5215 } 5216 5217 // GoogleCloudRetailV2betaOutputResult: Output result that stores the 5218 // information about where the exported data is stored. 5219 type GoogleCloudRetailV2betaOutputResult struct { 5220 // BigqueryResult: The BigQuery location where the result is stored. 5221 BigqueryResult []*GoogleCloudRetailV2betaBigQueryOutputResult `json:"bigqueryResult,omitempty"` 5222 // GcsResult: The Google Cloud Storage location where the result is stored. 5223 GcsResult []*GoogleCloudRetailV2betaGcsOutputResult `json:"gcsResult,omitempty"` 5224 // ForceSendFields is a list of field names (e.g. "BigqueryResult") to 5225 // unconditionally include in API requests. By default, fields with empty or 5226 // default values are omitted from API requests. See 5227 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5228 // details. 5229 ForceSendFields []string `json:"-"` 5230 // NullFields is a list of field names (e.g. "BigqueryResult") to include in 5231 // API requests with the JSON null value. By default, fields with empty values 5232 // are omitted from API requests. See 5233 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5234 NullFields []string `json:"-"` 5235 } 5236 5237 func (s *GoogleCloudRetailV2betaOutputResult) MarshalJSON() ([]byte, error) { 5238 type NoMethod GoogleCloudRetailV2betaOutputResult 5239 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5240 } 5241 5242 // GoogleCloudRetailV2betaPauseModelRequest: Request for pausing training of a 5243 // model. 5244 type GoogleCloudRetailV2betaPauseModelRequest struct { 5245 } 5246 5247 // GoogleCloudRetailV2betaPredictRequest: Request message for Predict method. 5248 type GoogleCloudRetailV2betaPredictRequest struct { 5249 // Filter: Filter for restricting prediction results with a length limit of 5250 // 5,000 characters. Accepts values for tags and the `filterOutOfStockItems` 5251 // flag. * Tag expressions. Restricts predictions to products that match all of 5252 // the specified tags. Boolean operators `OR` and `NOT` are supported if the 5253 // expression is enclosed in parentheses, and must be separated from the tag 5254 // values by a space. `-"tagA" is also supported and is equivalent to `NOT 5255 // "tagA". Tag values must be double quoted UTF-8 encoded strings with a size 5256 // limit of 1,000 characters. Note: "Recently viewed" models don't support tag 5257 // filtering at the moment. * filterOutOfStockItems. Restricts predictions to 5258 // products that do not have a stockState value of OUT_OF_STOCK. Examples: * 5259 // tag=("Red" OR "Blue") tag="New-Arrival" tag=(NOT "promotional") * 5260 // filterOutOfStockItems tag=(-"promotional") * filterOutOfStockItems If your 5261 // filter blocks all prediction results, the API will return *no* results. If 5262 // instead you want empty result sets to return generic (unfiltered) popular 5263 // products, set `strictFiltering` to False in `PredictRequest.params`. Note 5264 // that the API will never return items with storageStatus of "EXPIRED" or 5265 // "DELETED" regardless of filter choices. If `filterSyntaxV2` is set to true 5266 // under the `params` field, then attribute-based expressions are expected 5267 // instead of the above described tag-based syntax. Examples: * (colors: 5268 // ANY("Red", "Blue")) AND NOT (categories: ANY("Phones")) * (availability: 5269 // ANY("IN_STOCK")) AND (colors: ANY("Red") OR categories: ANY("Phones")) For 5270 // more information, see Filter recommendations 5271 // (https://cloud.google.com/retail/docs/filter-recs). 5272 Filter string `json:"filter,omitempty"` 5273 // Labels: The labels applied to a resource must meet the following 5274 // requirements: * Each resource can have multiple labels, up to a maximum of 5275 // 64. * Each label must be a key-value pair. * Keys have a minimum length of 1 5276 // character and a maximum length of 63 characters and cannot be empty. Values 5277 // can be empty and have a maximum length of 63 characters. * Keys and values 5278 // can contain only lowercase letters, numeric characters, underscores, and 5279 // dashes. All characters must use UTF-8 encoding, and international characters 5280 // are allowed. * The key portion of a label must be unique. However, you can 5281 // use the same key with multiple resources. * Keys must start with a lowercase 5282 // letter or international character. See Google Cloud Document 5283 // (https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) 5284 // for more details. 5285 Labels map[string]string `json:"labels,omitempty"` 5286 // PageSize: Maximum number of results to return. Set this property to the 5287 // number of prediction results needed. If zero, the service will choose a 5288 // reasonable default. The maximum allowed value is 100. Values above 100 will 5289 // be coerced to 100. 5290 PageSize int64 `json:"pageSize,omitempty"` 5291 // PageToken: This field is not used; leave it unset. 5292 PageToken string `json:"pageToken,omitempty"` 5293 // Params: Additional domain specific parameters for the predictions. Allowed 5294 // values: * `returnProduct`: Boolean. If set to true, the associated product 5295 // object will be returned in the `results.metadata` field in the prediction 5296 // response. * `returnScore`: Boolean. If set to true, the prediction 'score' 5297 // corresponding to each returned product will be set in the `results.metadata` 5298 // field in the prediction response. The given 'score' indicates the 5299 // probability of a product being clicked/purchased given the user's context 5300 // and history. * `strictFiltering`: Boolean. True by default. If set to false, 5301 // the service will return generic (unfiltered) popular products instead of 5302 // empty if your filter blocks all prediction results. * `priceRerankLevel`: 5303 // String. Default empty. If set to be non-empty, then it needs to be one of 5304 // {'no-price-reranking', 'low-price-reranking', 'medium-price-reranking', 5305 // 'high-price-reranking'}. This gives request-level control and adjusts 5306 // prediction results based on product price. * `diversityLevel`: String. 5307 // Default empty. If set to be non-empty, then it needs to be one of 5308 // {'no-diversity', 'low-diversity', 'medium-diversity', 'high-diversity', 5309 // 'auto-diversity'}. This gives request-level control and adjusts prediction 5310 // results based on product category. * `filterSyntaxV2`: Boolean. False by 5311 // default. If set to true, the `filter` field is interpreteted according to 5312 // the new, attribute-based syntax. 5313 Params googleapi.RawMessage `json:"params,omitempty"` 5314 // UserEvent: Required. Context about the user, what they are looking at and 5315 // what action they took to trigger the predict request. Note that this user 5316 // event detail won't be ingested to userEvent logs. Thus, a separate userEvent 5317 // write request is required for event logging. Don't set UserEvent.visitor_id 5318 // or UserInfo.user_id to the same fixed ID for different users. If you are 5319 // trying to receive non-personalized recommendations (not recommended; this 5320 // can negatively impact model performance), instead set UserEvent.visitor_id 5321 // to a random unique ID and leave UserInfo.user_id unset. 5322 UserEvent *GoogleCloudRetailV2betaUserEvent `json:"userEvent,omitempty"` 5323 // ValidateOnly: Use validate only mode for this prediction query. If set to 5324 // true, a dummy model will be used that returns arbitrary products. Note that 5325 // the validate only mode should only be used for testing the API, or if the 5326 // model is not ready. 5327 ValidateOnly bool `json:"validateOnly,omitempty"` 5328 // ForceSendFields is a list of field names (e.g. "Filter") to unconditionally 5329 // include in API requests. By default, fields with empty or default values are 5330 // omitted from API requests. See 5331 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5332 // details. 5333 ForceSendFields []string `json:"-"` 5334 // NullFields is a list of field names (e.g. "Filter") to include in API 5335 // requests with the JSON null value. By default, fields with empty values are 5336 // omitted from API requests. See 5337 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5338 NullFields []string `json:"-"` 5339 } 5340 5341 func (s *GoogleCloudRetailV2betaPredictRequest) MarshalJSON() ([]byte, error) { 5342 type NoMethod GoogleCloudRetailV2betaPredictRequest 5343 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5344 } 5345 5346 // GoogleCloudRetailV2betaPredictResponse: Response message for predict method. 5347 type GoogleCloudRetailV2betaPredictResponse struct { 5348 // AttributionToken: A unique attribution token. This should be included in the 5349 // UserEvent logs resulting from this recommendation, which enables accurate 5350 // attribution of recommendation model performance. 5351 AttributionToken string `json:"attributionToken,omitempty"` 5352 // MissingIds: IDs of products in the request that were missing from the 5353 // inventory. 5354 MissingIds []string `json:"missingIds,omitempty"` 5355 // Results: A list of recommended products. The order represents the ranking 5356 // (from the most relevant product to the least). 5357 Results []*GoogleCloudRetailV2betaPredictResponsePredictionResult `json:"results,omitempty"` 5358 // ValidateOnly: True if the validateOnly property was set in the request. 5359 ValidateOnly bool `json:"validateOnly,omitempty"` 5360 5361 // ServerResponse contains the HTTP response code and headers from the server. 5362 googleapi.ServerResponse `json:"-"` 5363 // ForceSendFields is a list of field names (e.g. "AttributionToken") to 5364 // unconditionally include in API requests. By default, fields with empty or 5365 // default values are omitted from API requests. See 5366 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5367 // details. 5368 ForceSendFields []string `json:"-"` 5369 // NullFields is a list of field names (e.g. "AttributionToken") to include in 5370 // API requests with the JSON null value. By default, fields with empty values 5371 // are omitted from API requests. See 5372 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5373 NullFields []string `json:"-"` 5374 } 5375 5376 func (s *GoogleCloudRetailV2betaPredictResponse) MarshalJSON() ([]byte, error) { 5377 type NoMethod GoogleCloudRetailV2betaPredictResponse 5378 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5379 } 5380 5381 // GoogleCloudRetailV2betaPredictResponsePredictionResult: PredictionResult 5382 // represents the recommendation prediction results. 5383 type GoogleCloudRetailV2betaPredictResponsePredictionResult struct { 5384 // Id: ID of the recommended product 5385 Id string `json:"id,omitempty"` 5386 // Metadata: Additional product metadata / annotations. Possible values: * 5387 // `product`: JSON representation of the product. Is set if `returnProduct` is 5388 // set to true in `PredictRequest.params`. * `score`: Prediction score in 5389 // double value. Is set if `returnScore` is set to true in 5390 // `PredictRequest.params`. 5391 Metadata googleapi.RawMessage `json:"metadata,omitempty"` 5392 // ForceSendFields is a list of field names (e.g. "Id") to unconditionally 5393 // include in API requests. By default, fields with empty or default values are 5394 // omitted from API requests. See 5395 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5396 // details. 5397 ForceSendFields []string `json:"-"` 5398 // NullFields is a list of field names (e.g. "Id") to include in API requests 5399 // with the JSON null value. By default, fields with empty values are omitted 5400 // from API requests. See 5401 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5402 NullFields []string `json:"-"` 5403 } 5404 5405 func (s *GoogleCloudRetailV2betaPredictResponsePredictionResult) MarshalJSON() ([]byte, error) { 5406 type NoMethod GoogleCloudRetailV2betaPredictResponsePredictionResult 5407 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5408 } 5409 5410 // GoogleCloudRetailV2betaPriceInfo: The price information of a Product. 5411 type GoogleCloudRetailV2betaPriceInfo struct { 5412 // Cost: The costs associated with the sale of a particular product. Used for 5413 // gross profit reporting. * Profit = price - cost Google Merchant Center 5414 // property cost_of_goods_sold 5415 // (https://support.google.com/merchants/answer/9017895). 5416 Cost float64 `json:"cost,omitempty"` 5417 // CurrencyCode: The 3-letter currency code defined in ISO 4217 5418 // (https://www.iso.org/iso-4217-currency-codes.html). If this field is an 5419 // unrecognizable currency code, an INVALID_ARGUMENT error is returned. The 5420 // Product.Type.VARIANT Products with the same Product.primary_product_id must 5421 // share the same currency_code. Otherwise, a FAILED_PRECONDITION error is 5422 // returned. 5423 CurrencyCode string `json:"currencyCode,omitempty"` 5424 // OriginalPrice: Price of the product without any discount. If zero, by 5425 // default set to be the price. If set, original_price should be greater than 5426 // or equal to price, otherwise an INVALID_ARGUMENT error is thrown. 5427 OriginalPrice float64 `json:"originalPrice,omitempty"` 5428 // Price: Price of the product. Google Merchant Center property price 5429 // (https://support.google.com/merchants/answer/6324371). Schema.org property 5430 // Offer.price (https://schema.org/price). 5431 Price float64 `json:"price,omitempty"` 5432 // PriceEffectiveTime: The timestamp when the price starts to be effective. 5433 // This can be set as a future timestamp, and the price is only used for search 5434 // after price_effective_time. If so, the original_price must be set and 5435 // original_price is used before price_effective_time. Do not set if price is 5436 // always effective because it will cause additional latency during search. 5437 PriceEffectiveTime string `json:"priceEffectiveTime,omitempty"` 5438 // PriceExpireTime: The timestamp when the price stops to be effective. The 5439 // price is used for search before price_expire_time. If this field is set, the 5440 // original_price must be set and original_price is used after 5441 // price_expire_time. Do not set if price is always effective because it will 5442 // cause additional latency during search. 5443 PriceExpireTime string `json:"priceExpireTime,omitempty"` 5444 // PriceRange: Output only. The price range of all the child 5445 // Product.Type.VARIANT Products grouped together on the Product.Type.PRIMARY 5446 // Product. Only populated for Product.Type.PRIMARY Products. Note: This field 5447 // is OUTPUT_ONLY for ProductService.GetProduct. Do not set this field in API 5448 // requests. 5449 PriceRange *GoogleCloudRetailV2betaPriceInfoPriceRange `json:"priceRange,omitempty"` 5450 // ForceSendFields is a list of field names (e.g. "Cost") to unconditionally 5451 // include in API requests. By default, fields with empty or default values are 5452 // omitted from API requests. See 5453 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5454 // details. 5455 ForceSendFields []string `json:"-"` 5456 // NullFields is a list of field names (e.g. "Cost") to include in API requests 5457 // with the JSON null value. By default, fields with empty values are omitted 5458 // from API requests. See 5459 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5460 NullFields []string `json:"-"` 5461 } 5462 5463 func (s *GoogleCloudRetailV2betaPriceInfo) MarshalJSON() ([]byte, error) { 5464 type NoMethod GoogleCloudRetailV2betaPriceInfo 5465 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5466 } 5467 5468 func (s *GoogleCloudRetailV2betaPriceInfo) UnmarshalJSON(data []byte) error { 5469 type NoMethod GoogleCloudRetailV2betaPriceInfo 5470 var s1 struct { 5471 Cost gensupport.JSONFloat64 `json:"cost"` 5472 OriginalPrice gensupport.JSONFloat64 `json:"originalPrice"` 5473 Price gensupport.JSONFloat64 `json:"price"` 5474 *NoMethod 5475 } 5476 s1.NoMethod = (*NoMethod)(s) 5477 if err := json.Unmarshal(data, &s1); err != nil { 5478 return err 5479 } 5480 s.Cost = float64(s1.Cost) 5481 s.OriginalPrice = float64(s1.OriginalPrice) 5482 s.Price = float64(s1.Price) 5483 return nil 5484 } 5485 5486 // GoogleCloudRetailV2betaPriceInfoPriceRange: The price range of all variant 5487 // Product having the same Product.primary_product_id. 5488 type GoogleCloudRetailV2betaPriceInfoPriceRange struct { 5489 // OriginalPrice: The inclusive Product.pricing_info.original_price internal of 5490 // all variant Product having the same Product.primary_product_id. 5491 OriginalPrice *GoogleCloudRetailV2betaInterval `json:"originalPrice,omitempty"` 5492 // Price: The inclusive Product.pricing_info.price interval of all variant 5493 // Product having the same Product.primary_product_id. 5494 Price *GoogleCloudRetailV2betaInterval `json:"price,omitempty"` 5495 // ForceSendFields is a list of field names (e.g. "OriginalPrice") to 5496 // unconditionally include in API requests. By default, fields with empty or 5497 // default values are omitted from API requests. See 5498 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5499 // details. 5500 ForceSendFields []string `json:"-"` 5501 // NullFields is a list of field names (e.g. "OriginalPrice") to include in API 5502 // requests with the JSON null value. By default, fields with empty values are 5503 // omitted from API requests. See 5504 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5505 NullFields []string `json:"-"` 5506 } 5507 5508 func (s *GoogleCloudRetailV2betaPriceInfoPriceRange) MarshalJSON() ([]byte, error) { 5509 type NoMethod GoogleCloudRetailV2betaPriceInfoPriceRange 5510 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5511 } 5512 5513 // GoogleCloudRetailV2betaProduct: Product captures all metadata information of 5514 // items to be recommended or searched. 5515 type GoogleCloudRetailV2betaProduct struct { 5516 // Attributes: Highly encouraged. Extra product attributes to be included. For 5517 // example, for products, this could include the store name, vendor, style, 5518 // color, etc. These are very strong signals for recommendation model, thus we 5519 // highly recommend providing the attributes here. Features that can take on 5520 // one of a limited number of possible values. Two types of features can be set 5521 // are: Textual features. some examples would be the brand/maker of a product, 5522 // or country of a customer. Numerical features. Some examples would be the 5523 // height/weight of a product, or age of a customer. For example: `{ "vendor": 5524 // {"text": ["vendor123", "vendor456"]}, "lengths_cm": {"numbers":[2.3, 15.4]}, 5525 // "heights_cm": {"numbers":[8.1, 6.4]} }`. This field needs to pass all below 5526 // criteria, otherwise an INVALID_ARGUMENT error is returned: * Max entries 5527 // count: 200. * The key must be a UTF-8 encoded string with a length limit of 5528 // 128 characters. * For indexable attribute, the key must match the pattern: 5529 // `a-zA-Z0-9*`. For example, `key0LikeThis` or `KEY_1_LIKE_THIS`. * For text 5530 // attributes, at most 400 values are allowed. Empty values are not allowed. 5531 // Each value must be a non-empty UTF-8 encoded string with a length limit of 5532 // 256 characters. * For number attributes, at most 400 values are allowed. 5533 Attributes map[string]GoogleCloudRetailV2betaCustomAttribute `json:"attributes,omitempty"` 5534 // Audience: The target group associated with a given audience (e.g. male, 5535 // veterans, car owners, musicians, etc.) of the product. 5536 Audience *GoogleCloudRetailV2betaAudience `json:"audience,omitempty"` 5537 // Availability: The online availability of the Product. Default to 5538 // Availability.IN_STOCK. Corresponding properties: Google Merchant Center 5539 // property availability (https://support.google.com/merchants/answer/6324448). 5540 // Schema.org property Offer.availability (https://schema.org/availability). 5541 // 5542 // Possible values: 5543 // "AVAILABILITY_UNSPECIFIED" - Default product availability. Default to 5544 // Availability.IN_STOCK if unset. 5545 // "IN_STOCK" - Product in stock. 5546 // "OUT_OF_STOCK" - Product out of stock. 5547 // "PREORDER" - Product that is in pre-order state. 5548 // "BACKORDER" - Product that is back-ordered (i.e. temporarily out of 5549 // stock). 5550 Availability string `json:"availability,omitempty"` 5551 // AvailableQuantity: The available quantity of the item. 5552 AvailableQuantity int64 `json:"availableQuantity,omitempty"` 5553 // AvailableTime: The timestamp when this Product becomes available for 5554 // SearchService.Search. Note that this is only applicable to Type.PRIMARY and 5555 // Type.COLLECTION, and ignored for Type.VARIANT. 5556 AvailableTime string `json:"availableTime,omitempty"` 5557 // Brands: The brands of the product. A maximum of 30 brands are allowed unless 5558 // overridden through the Google Cloud console. Each brand must be a UTF-8 5559 // encoded string with a length limit of 1,000 characters. Otherwise, an 5560 // INVALID_ARGUMENT error is returned. Corresponding properties: Google 5561 // Merchant Center property brand 5562 // (https://support.google.com/merchants/answer/6324351). Schema.org property 5563 // Product.brand (https://schema.org/brand). 5564 Brands []string `json:"brands,omitempty"` 5565 // Categories: Product categories. This field is repeated for supporting one 5566 // product belonging to several parallel categories. Strongly recommended using 5567 // the full path for better search / recommendation quality. To represent full 5568 // path of category, use '>' sign to separate different hierarchies. If '>' is 5569 // part of the category name, replace it with other character(s). For example, 5570 // if a shoes product belongs to both ["Shoes & Accessories" -> "Shoes"] and 5571 // ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be 5572 // represented as: "categories": [ "Shoes & Accessories > Shoes", "Sports & 5573 // Fitness > Athletic Clothing > Shoes" ] Must be set for Type.PRIMARY Product 5574 // otherwise an INVALID_ARGUMENT error is returned. At most 250 values are 5575 // allowed per Product unless overridden through the Google Cloud console. 5576 // Empty values are not allowed. Each value must be a UTF-8 encoded string with 5577 // a length limit of 5,000 characters. Otherwise, an INVALID_ARGUMENT error is 5578 // returned. Corresponding properties: Google Merchant Center property 5579 // google_product_category. Schema.org property [Product.category] 5580 // (https://schema.org/category). [mc_google_product_category]: 5581 // https://support.google.com/merchants/answer/6324436 5582 Categories []string `json:"categories,omitempty"` 5583 // CollectionMemberIds: The id of the collection members when type is 5584 // Type.COLLECTION. Non-existent product ids are allowed. The type of the 5585 // members must be either Type.PRIMARY or Type.VARIANT otherwise an 5586 // INVALID_ARGUMENT error is thrown. Should not set it for other types. A 5587 // maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is 5588 // return. 5589 CollectionMemberIds []string `json:"collectionMemberIds,omitempty"` 5590 // ColorInfo: The color of the product. Corresponding properties: Google 5591 // Merchant Center property color 5592 // (https://support.google.com/merchants/answer/6324487). Schema.org property 5593 // Product.color (https://schema.org/color). 5594 ColorInfo *GoogleCloudRetailV2betaColorInfo `json:"colorInfo,omitempty"` 5595 // Conditions: The condition of the product. Strongly encouraged to use the 5596 // standard values: "new", "refurbished", "used". A maximum of 1 value is 5597 // allowed per Product. Each value must be a UTF-8 encoded string with a length 5598 // limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. 5599 // Corresponding properties: Google Merchant Center property condition 5600 // (https://support.google.com/merchants/answer/6324469). Schema.org property 5601 // Offer.itemCondition (https://schema.org/itemCondition). 5602 Conditions []string `json:"conditions,omitempty"` 5603 // Description: Product description. This field must be a UTF-8 encoded string 5604 // with a length limit of 5,000 characters. Otherwise, an INVALID_ARGUMENT 5605 // error is returned. Corresponding properties: Google Merchant Center property 5606 // description (https://support.google.com/merchants/answer/6324468). 5607 // Schema.org property Product.description (https://schema.org/description). 5608 Description string `json:"description,omitempty"` 5609 // ExpireTime: Note that this field is applied in the following ways: * If the 5610 // Product is already expired when it is uploaded, this product is not indexed 5611 // for search. * If the Product is not expired when it is uploaded, only the 5612 // Type.PRIMARY's and Type.COLLECTION's expireTime is respected, and 5613 // Type.VARIANT's expireTime is not used. In general, we suggest the users to 5614 // delete the stale products explicitly, instead of using this field to 5615 // determine staleness. expire_time must be later than available_time and 5616 // publish_time, otherwise an INVALID_ARGUMENT error is thrown. Corresponding 5617 // properties: Google Merchant Center property expiration_date 5618 // (https://support.google.com/merchants/answer/6324499). 5619 ExpireTime string `json:"expireTime,omitempty"` 5620 // FulfillmentInfo: Fulfillment information, such as the store IDs for in-store 5621 // pickup or region IDs for different shipping methods. All the elements must 5622 // have distinct FulfillmentInfo.type. Otherwise, an INVALID_ARGUMENT error is 5623 // returned. 5624 FulfillmentInfo []*GoogleCloudRetailV2betaFulfillmentInfo `json:"fulfillmentInfo,omitempty"` 5625 // Gtin: The Global Trade Item Number (GTIN) of the product. This field must be 5626 // a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an 5627 // INVALID_ARGUMENT error is returned. This field must be a Unigram. Otherwise, 5628 // an INVALID_ARGUMENT error is returned. Corresponding properties: Google 5629 // Merchant Center property gtin 5630 // (https://support.google.com/merchants/answer/6324461). Schema.org property 5631 // Product.isbn (https://schema.org/isbn), Product.gtin8 5632 // (https://schema.org/gtin8), Product.gtin12 (https://schema.org/gtin12), 5633 // Product.gtin13 (https://schema.org/gtin13), or Product.gtin14 5634 // (https://schema.org/gtin14). If the value is not a valid GTIN, an 5635 // INVALID_ARGUMENT error is returned. 5636 Gtin string `json:"gtin,omitempty"` 5637 // Id: Immutable. Product identifier, which is the final component of name. For 5638 // example, this field is "id_1", if name is 5639 // `projects/*/locations/global/catalogs/default_catalog/branches/default_branch 5640 // /products/id_1`. This field must be a UTF-8 encoded string with a length 5641 // limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. 5642 // Corresponding properties: Google Merchant Center property id 5643 // (https://support.google.com/merchants/answer/6324405). Schema.org property 5644 // Product.sku (https://schema.org/sku). 5645 Id string `json:"id,omitempty"` 5646 // Images: Product images for the product. We highly recommend putting the main 5647 // image first. A maximum of 300 images are allowed. Corresponding properties: 5648 // Google Merchant Center property image_link 5649 // (https://support.google.com/merchants/answer/6324350). Schema.org property 5650 // Product.image (https://schema.org/image). 5651 Images []*GoogleCloudRetailV2betaImage `json:"images,omitempty"` 5652 // LanguageCode: Language of the title/description and other string attributes. 5653 // Use language tags defined by BCP 47 5654 // (https://www.rfc-editor.org/rfc/bcp/bcp47.txt). For product prediction, this 5655 // field is ignored and the model automatically detects the text language. The 5656 // Product can include text in different languages, but duplicating Products to 5657 // provide text in multiple languages can result in degraded model performance. 5658 // For product search this field is in use. It defaults to "en-US" if unset. 5659 LanguageCode string `json:"languageCode,omitempty"` 5660 // LocalInventories: Output only. A list of local inventories specific to 5661 // different places. This field can be managed by 5662 // ProductService.AddLocalInventories and ProductService.RemoveLocalInventories 5663 // APIs if fine-grained, high-volume updates are necessary. 5664 LocalInventories []*GoogleCloudRetailV2betaLocalInventory `json:"localInventories,omitempty"` 5665 // Materials: The material of the product. For example, "leather", "wooden". A 5666 // maximum of 20 values are allowed. Each value must be a UTF-8 encoded string 5667 // with a length limit of 200 characters. Otherwise, an INVALID_ARGUMENT error 5668 // is returned. Corresponding properties: Google Merchant Center property 5669 // material (https://support.google.com/merchants/answer/6324410). Schema.org 5670 // property Product.material (https://schema.org/material). 5671 Materials []string `json:"materials,omitempty"` 5672 // Name: Immutable. Full resource name of the product, such as 5673 // `projects/*/locations/global/catalogs/default_catalog/branches/default_branch 5674 // /products/product_id`. 5675 Name string `json:"name,omitempty"` 5676 // Patterns: The pattern or graphic print of the product. For example, 5677 // "striped", "polka dot", "paisley". A maximum of 20 values are allowed per 5678 // Product. Each value must be a UTF-8 encoded string with a length limit of 5679 // 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. 5680 // Corresponding properties: Google Merchant Center property pattern 5681 // (https://support.google.com/merchants/answer/6324483). Schema.org property 5682 // Product.pattern (https://schema.org/pattern). 5683 Patterns []string `json:"patterns,omitempty"` 5684 // PriceInfo: Product price and cost information. Corresponding properties: 5685 // Google Merchant Center property price 5686 // (https://support.google.com/merchants/answer/6324371). 5687 PriceInfo *GoogleCloudRetailV2betaPriceInfo `json:"priceInfo,omitempty"` 5688 // PrimaryProductId: Variant group identifier. Must be an id, with the same 5689 // parent branch with this product. Otherwise, an error is thrown. For 5690 // Type.PRIMARY Products, this field can only be empty or set to the same value 5691 // as id. For VARIANT Products, this field cannot be empty. A maximum of 2,000 5692 // products are allowed to share the same Type.PRIMARY Product. Otherwise, an 5693 // INVALID_ARGUMENT error is returned. Corresponding properties: Google 5694 // Merchant Center property item_group_id 5695 // (https://support.google.com/merchants/answer/6324507). Schema.org property 5696 // Product.inProductGroupWithID (https://schema.org/inProductGroupWithID). 5697 PrimaryProductId string `json:"primaryProductId,omitempty"` 5698 // Promotions: The promotions applied to the product. A maximum of 10 values 5699 // are allowed per Product. Only Promotion.promotion_id will be used, other 5700 // fields will be ignored if set. 5701 Promotions []*GoogleCloudRetailV2betaPromotion `json:"promotions,omitempty"` 5702 // PublishTime: The timestamp when the product is published by the retailer for 5703 // the first time, which indicates the freshness of the products. Note that 5704 // this field is different from available_time, given it purely describes 5705 // product freshness regardless of when it is available on search and 5706 // recommendation. 5707 PublishTime string `json:"publishTime,omitempty"` 5708 // Rating: The rating of this product. 5709 Rating *GoogleCloudRetailV2betaRating `json:"rating,omitempty"` 5710 // RetrievableFields: Indicates which fields in the Products are returned in 5711 // SearchResponse. Supported fields for all types: * audience * availability * 5712 // brands * color_info * conditions * gtin * materials * name * patterns * 5713 // price_info * rating * sizes * title * uri Supported fields only for 5714 // Type.PRIMARY and Type.COLLECTION: * categories * description * images 5715 // Supported fields only for Type.VARIANT: * Only the first image in images To 5716 // mark attributes as retrievable, include paths of the form "attributes.key" 5717 // where "key" is the key of a custom attribute, as specified in attributes. 5718 // For Type.PRIMARY and Type.COLLECTION, the following fields are always 5719 // returned in SearchResponse by default: * name For Type.VARIANT, the 5720 // following fields are always returned in by default: * name * color_info The 5721 // maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is 5722 // returned. Note: Returning more fields in SearchResponse can increase 5723 // response payload size and serving latency. This field is deprecated. Use the 5724 // retrievable site-wide control instead. 5725 RetrievableFields string `json:"retrievableFields,omitempty"` 5726 // Sizes: The size of the product. To represent different size systems or size 5727 // types, consider using this format: [[[size_system:]size_type:]size_value]. 5728 // For example, in "US:MENS:M", "US" represents size system; "MENS" represents 5729 // size type; "M" represents size value. In "GIRLS:27", size system is empty; 5730 // "GIRLS" represents size type; "27" represents size value. In "32 inches", 5731 // both size system and size type are empty, while size value is "32 inches". A 5732 // maximum of 20 values are allowed per Product. Each value must be a UTF-8 5733 // encoded string with a length limit of 128 characters. Otherwise, an 5734 // INVALID_ARGUMENT error is returned. Corresponding properties: Google 5735 // Merchant Center property size 5736 // (https://support.google.com/merchants/answer/6324492), size_type 5737 // (https://support.google.com/merchants/answer/6324497), and size_system 5738 // (https://support.google.com/merchants/answer/6324502). Schema.org property 5739 // Product.size (https://schema.org/size). 5740 Sizes []string `json:"sizes,omitempty"` 5741 // Tags: Custom tags associated with the product. At most 250 values are 5742 // allowed per Product. This value must be a UTF-8 encoded string with a length 5743 // limit of 1,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. 5744 // This tag can be used for filtering recommendation results by passing the tag 5745 // as part of the PredictRequest.filter. Corresponding properties: Google 5746 // Merchant Center property custom_label_0–4 5747 // (https://support.google.com/merchants/answer/6324473). 5748 Tags []string `json:"tags,omitempty"` 5749 // Title: Required. Product title. This field must be a UTF-8 encoded string 5750 // with a length limit of 1,000 characters. Otherwise, an INVALID_ARGUMENT 5751 // error is returned. Corresponding properties: Google Merchant Center property 5752 // title (https://support.google.com/merchants/answer/6324415). Schema.org 5753 // property Product.name (https://schema.org/name). 5754 Title string `json:"title,omitempty"` 5755 // Ttl: Input only. The TTL (time to live) of the product. Note that this is 5756 // only applicable to Type.PRIMARY and Type.COLLECTION, and ignored for 5757 // Type.VARIANT. In general, we suggest the users to delete the stale products 5758 // explicitly, instead of using this field to determine staleness. If it is 5759 // set, it must be a non-negative value, and expire_time is set as current 5760 // timestamp plus ttl. The derived expire_time is returned in the output and 5761 // ttl is left blank when retrieving the Product. If it is set, the product is 5762 // not available for SearchService.Search after current timestamp plus ttl. 5763 // However, the product can still be retrieved by ProductService.GetProduct and 5764 // ProductService.ListProducts. 5765 Ttl string `json:"ttl,omitempty"` 5766 // Type: Immutable. The type of the product. Default to 5767 // Catalog.product_level_config.ingestion_product_type if unset. 5768 // 5769 // Possible values: 5770 // "TYPE_UNSPECIFIED" - Default value. Default to 5771 // Catalog.product_level_config.ingestion_product_type if unset. 5772 // "PRIMARY" - The primary type. As the primary unit for predicting, indexing 5773 // and search serving, a Type.PRIMARY Product is grouped with multiple 5774 // Type.VARIANT Products. 5775 // "VARIANT" - The variant type. Type.VARIANT Products usually share some 5776 // common attributes on the same Type.PRIMARY Products, but they have variant 5777 // attributes like different colors, sizes and prices, etc. 5778 // "COLLECTION" - The collection type. Collection products are bundled 5779 // Type.PRIMARY Products or Type.VARIANT Products that are sold together, such 5780 // as a jewelry set with necklaces, earrings and rings, etc. 5781 Type string `json:"type,omitempty"` 5782 // Uri: Canonical URL directly linking to the product detail page. It is 5783 // strongly recommended to provide a valid uri for the product, otherwise the 5784 // service performance could be significantly degraded. This field must be a 5785 // UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, an 5786 // INVALID_ARGUMENT error is returned. Corresponding properties: Google 5787 // Merchant Center property link 5788 // (https://support.google.com/merchants/answer/6324416). Schema.org property 5789 // Offer.url (https://schema.org/url). 5790 Uri string `json:"uri,omitempty"` 5791 // Variants: Output only. Product variants grouped together on primary product 5792 // which share similar product attributes. It's automatically grouped by 5793 // primary_product_id for all the product variants. Only populated for 5794 // Type.PRIMARY Products. Note: This field is OUTPUT_ONLY for 5795 // ProductService.GetProduct. Do not set this field in API requests. 5796 Variants []*GoogleCloudRetailV2betaProduct `json:"variants,omitempty"` 5797 5798 // ServerResponse contains the HTTP response code and headers from the server. 5799 googleapi.ServerResponse `json:"-"` 5800 // ForceSendFields is a list of field names (e.g. "Attributes") to 5801 // unconditionally include in API requests. By default, fields with empty or 5802 // default values are omitted from API requests. See 5803 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5804 // details. 5805 ForceSendFields []string `json:"-"` 5806 // NullFields is a list of field names (e.g. "Attributes") to include in API 5807 // requests with the JSON null value. By default, fields with empty values are 5808 // omitted from API requests. See 5809 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5810 NullFields []string `json:"-"` 5811 } 5812 5813 func (s *GoogleCloudRetailV2betaProduct) MarshalJSON() ([]byte, error) { 5814 type NoMethod GoogleCloudRetailV2betaProduct 5815 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5816 } 5817 5818 // GoogleCloudRetailV2betaProductDetail: Detailed product information 5819 // associated with a user event. 5820 type GoogleCloudRetailV2betaProductDetail struct { 5821 // Product: Required. Product information. Required field(s): * Product.id 5822 // Optional override field(s): * Product.price_info If any supported optional 5823 // fields are provided, we will treat them as a full override when looking up 5824 // product information from the catalog. Thus, it is important to ensure that 5825 // the overriding fields are accurate and complete. All other product fields 5826 // are ignored and instead populated via catalog lookup after event ingestion. 5827 Product *GoogleCloudRetailV2betaProduct `json:"product,omitempty"` 5828 // Quantity: Quantity of the product associated with the user event. For 5829 // example, this field will be 2 if two products are added to the shopping cart 5830 // for `purchase-complete` event. Required for `add-to-cart` and 5831 // `purchase-complete` event types. 5832 Quantity int64 `json:"quantity,omitempty"` 5833 // ForceSendFields is a list of field names (e.g. "Product") to unconditionally 5834 // include in API requests. By default, fields with empty or default values are 5835 // omitted from API requests. See 5836 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5837 // details. 5838 ForceSendFields []string `json:"-"` 5839 // NullFields is a list of field names (e.g. "Product") to include in API 5840 // requests with the JSON null value. By default, fields with empty values are 5841 // omitted from API requests. See 5842 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5843 NullFields []string `json:"-"` 5844 } 5845 5846 func (s *GoogleCloudRetailV2betaProductDetail) MarshalJSON() ([]byte, error) { 5847 type NoMethod GoogleCloudRetailV2betaProductDetail 5848 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5849 } 5850 5851 // GoogleCloudRetailV2betaProductInlineSource: The inline source for the input 5852 // config for ImportProducts method. 5853 type GoogleCloudRetailV2betaProductInlineSource struct { 5854 // Products: Required. A list of products to update/create. Each product must 5855 // have a valid Product.id. Recommended max of 100 items. 5856 Products []*GoogleCloudRetailV2betaProduct `json:"products,omitempty"` 5857 // ForceSendFields is a list of field names (e.g. "Products") to 5858 // unconditionally include in API requests. By default, fields with empty or 5859 // default values are omitted from API requests. See 5860 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5861 // details. 5862 ForceSendFields []string `json:"-"` 5863 // NullFields is a list of field names (e.g. "Products") to include in API 5864 // requests with the JSON null value. By default, fields with empty values are 5865 // omitted from API requests. See 5866 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5867 NullFields []string `json:"-"` 5868 } 5869 5870 func (s *GoogleCloudRetailV2betaProductInlineSource) MarshalJSON() ([]byte, error) { 5871 type NoMethod GoogleCloudRetailV2betaProductInlineSource 5872 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5873 } 5874 5875 // GoogleCloudRetailV2betaProductInputConfig: The input config source for 5876 // products. 5877 type GoogleCloudRetailV2betaProductInputConfig struct { 5878 // BigQuerySource: BigQuery input source. 5879 BigQuerySource *GoogleCloudRetailV2betaBigQuerySource `json:"bigQuerySource,omitempty"` 5880 // GcsSource: Google Cloud Storage location for the input content. 5881 GcsSource *GoogleCloudRetailV2betaGcsSource `json:"gcsSource,omitempty"` 5882 // ProductInlineSource: The Inline source for the input content for products. 5883 ProductInlineSource *GoogleCloudRetailV2betaProductInlineSource `json:"productInlineSource,omitempty"` 5884 // ForceSendFields is a list of field names (e.g. "BigQuerySource") to 5885 // unconditionally include in API requests. By default, fields with empty or 5886 // default values are omitted from API requests. See 5887 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5888 // details. 5889 ForceSendFields []string `json:"-"` 5890 // NullFields is a list of field names (e.g. "BigQuerySource") to include in 5891 // API requests with the JSON null value. By default, fields with empty values 5892 // are omitted from API requests. See 5893 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5894 NullFields []string `json:"-"` 5895 } 5896 5897 func (s *GoogleCloudRetailV2betaProductInputConfig) MarshalJSON() ([]byte, error) { 5898 type NoMethod GoogleCloudRetailV2betaProductInputConfig 5899 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5900 } 5901 5902 // GoogleCloudRetailV2betaProductLevelConfig: Configures what level the product 5903 // should be uploaded with regards to how users will be send events and how 5904 // predictions will be made. 5905 type GoogleCloudRetailV2betaProductLevelConfig struct { 5906 // IngestionProductType: The type of Products allowed to be ingested into the 5907 // catalog. Acceptable values are: * `primary` (default): You can ingest 5908 // Products of all types. When ingesting a Product, its type will default to 5909 // Product.Type.PRIMARY if unset. * `variant` (incompatible with Retail 5910 // Search): You can only ingest Product.Type.VARIANT Products. This means 5911 // Product.primary_product_id cannot be empty. If this field is set to an 5912 // invalid value other than these, an INVALID_ARGUMENT error is returned. If 5913 // this field is `variant` and merchant_center_product_id_field is 5914 // `itemGroupId`, an INVALID_ARGUMENT error is returned. See Product levels 5915 // (https://cloud.google.com/retail/docs/catalog#product-levels) for more 5916 // details. 5917 IngestionProductType string `json:"ingestionProductType,omitempty"` 5918 // MerchantCenterProductIdField: Which field of Merchant Center Product 5919 // (/bigquery-transfer/docs/merchant-center-products-schema) should be imported 5920 // as Product.id. Acceptable values are: * `offerId` (default): Import 5921 // `offerId` as the product ID. * `itemGroupId`: Import `itemGroupId` as the 5922 // product ID. Notice that Retail API will choose one item from the ones with 5923 // the same `itemGroupId`, and use it to represent the item group. If this 5924 // field is set to an invalid value other than these, an INVALID_ARGUMENT error 5925 // is returned. If this field is `itemGroupId` and ingestion_product_type is 5926 // `variant`, an INVALID_ARGUMENT error is returned. See Product levels 5927 // (https://cloud.google.com/retail/docs/catalog#product-levels) for more 5928 // details. 5929 MerchantCenterProductIdField string `json:"merchantCenterProductIdField,omitempty"` 5930 // ForceSendFields is a list of field names (e.g. "IngestionProductType") to 5931 // unconditionally include in API requests. By default, fields with empty or 5932 // default values are omitted from API requests. See 5933 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5934 // details. 5935 ForceSendFields []string `json:"-"` 5936 // NullFields is a list of field names (e.g. "IngestionProductType") to include 5937 // in API requests with the JSON null value. By default, fields with empty 5938 // values are omitted from API requests. See 5939 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5940 NullFields []string `json:"-"` 5941 } 5942 5943 func (s *GoogleCloudRetailV2betaProductLevelConfig) MarshalJSON() ([]byte, error) { 5944 type NoMethod GoogleCloudRetailV2betaProductLevelConfig 5945 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5946 } 5947 5948 // GoogleCloudRetailV2betaPromotion: Promotion specification. 5949 type GoogleCloudRetailV2betaPromotion struct { 5950 // PromotionId: Promotion identifier, which is the final component of name. For 5951 // example, this field is "free_gift", if name is 5952 // `projects/*/locations/global/catalogs/default_catalog/promotions/free_gift`. 5953 // The value must be a UTF-8 encoded string with a length limit of 128 5954 // characters, and match the pattern: `a-zA-Z*`. For example, id0LikeThis or 5955 // ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is returned. 5956 // Corresponds to Google Merchant Center property promotion_id 5957 // (https://support.google.com/merchants/answer/7050148). 5958 PromotionId string `json:"promotionId,omitempty"` 5959 // ForceSendFields is a list of field names (e.g. "PromotionId") to 5960 // unconditionally include in API requests. By default, fields with empty or 5961 // default values are omitted from API requests. See 5962 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5963 // details. 5964 ForceSendFields []string `json:"-"` 5965 // NullFields is a list of field names (e.g. "PromotionId") to include in API 5966 // requests with the JSON null value. By default, fields with empty values are 5967 // omitted from API requests. See 5968 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5969 NullFields []string `json:"-"` 5970 } 5971 5972 func (s *GoogleCloudRetailV2betaPromotion) MarshalJSON() ([]byte, error) { 5973 type NoMethod GoogleCloudRetailV2betaPromotion 5974 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5975 } 5976 5977 // GoogleCloudRetailV2betaPurchaseTransaction: A transaction represents the 5978 // entire purchase transaction. 5979 type GoogleCloudRetailV2betaPurchaseTransaction struct { 5980 // Cost: All the costs associated with the products. These can be manufacturing 5981 // costs, shipping expenses not borne by the end user, or any other costs, such 5982 // that: * Profit = revenue - tax - cost 5983 Cost float64 `json:"cost,omitempty"` 5984 // CurrencyCode: Required. Currency code. Use three-character ISO-4217 code. 5985 CurrencyCode string `json:"currencyCode,omitempty"` 5986 // Id: The transaction ID with a length limit of 128 characters. 5987 Id string `json:"id,omitempty"` 5988 // Revenue: Required. Total non-zero revenue or grand total associated with the 5989 // transaction. This value include shipping, tax, or other adjustments to total 5990 // revenue that you want to include as part of your revenue calculations. 5991 Revenue float64 `json:"revenue,omitempty"` 5992 // Tax: All the taxes associated with the transaction. 5993 Tax float64 `json:"tax,omitempty"` 5994 // ForceSendFields is a list of field names (e.g. "Cost") to unconditionally 5995 // include in API requests. By default, fields with empty or default values are 5996 // omitted from API requests. See 5997 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5998 // details. 5999 ForceSendFields []string `json:"-"` 6000 // NullFields is a list of field names (e.g. "Cost") to include in API requests 6001 // with the JSON null value. By default, fields with empty values are omitted 6002 // from API requests. See 6003 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6004 NullFields []string `json:"-"` 6005 } 6006 6007 func (s *GoogleCloudRetailV2betaPurchaseTransaction) MarshalJSON() ([]byte, error) { 6008 type NoMethod GoogleCloudRetailV2betaPurchaseTransaction 6009 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6010 } 6011 6012 func (s *GoogleCloudRetailV2betaPurchaseTransaction) UnmarshalJSON(data []byte) error { 6013 type NoMethod GoogleCloudRetailV2betaPurchaseTransaction 6014 var s1 struct { 6015 Cost gensupport.JSONFloat64 `json:"cost"` 6016 Revenue gensupport.JSONFloat64 `json:"revenue"` 6017 Tax gensupport.JSONFloat64 `json:"tax"` 6018 *NoMethod 6019 } 6020 s1.NoMethod = (*NoMethod)(s) 6021 if err := json.Unmarshal(data, &s1); err != nil { 6022 return err 6023 } 6024 s.Cost = float64(s1.Cost) 6025 s.Revenue = float64(s1.Revenue) 6026 s.Tax = float64(s1.Tax) 6027 return nil 6028 } 6029 6030 // GoogleCloudRetailV2betaPurgeMetadata: Metadata related to the progress of 6031 // the Purge operation. This will be returned by the 6032 // google.longrunning.Operation.metadata field. 6033 type GoogleCloudRetailV2betaPurgeMetadata struct { 6034 } 6035 6036 // GoogleCloudRetailV2betaPurgeProductsMetadata: Metadata related to the 6037 // progress of the PurgeProducts operation. This will be returned by the 6038 // google.longrunning.Operation.metadata field. 6039 type GoogleCloudRetailV2betaPurgeProductsMetadata struct { 6040 // CreateTime: Operation create time. 6041 CreateTime string `json:"createTime,omitempty"` 6042 // FailureCount: Count of entries that encountered errors while processing. 6043 FailureCount int64 `json:"failureCount,omitempty,string"` 6044 // SuccessCount: Count of entries that were deleted successfully. 6045 SuccessCount int64 `json:"successCount,omitempty,string"` 6046 // UpdateTime: Operation last update time. If the operation is done, this is 6047 // also the finish time. 6048 UpdateTime string `json:"updateTime,omitempty"` 6049 // ForceSendFields is a list of field names (e.g. "CreateTime") to 6050 // unconditionally include in API requests. By default, fields with empty or 6051 // default values are omitted from API requests. See 6052 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6053 // details. 6054 ForceSendFields []string `json:"-"` 6055 // NullFields is a list of field names (e.g. "CreateTime") to include in API 6056 // requests with the JSON null value. By default, fields with empty values are 6057 // omitted from API requests. See 6058 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6059 NullFields []string `json:"-"` 6060 } 6061 6062 func (s *GoogleCloudRetailV2betaPurgeProductsMetadata) MarshalJSON() ([]byte, error) { 6063 type NoMethod GoogleCloudRetailV2betaPurgeProductsMetadata 6064 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6065 } 6066 6067 // GoogleCloudRetailV2betaPurgeProductsRequest: Request message for 6068 // PurgeProducts method. 6069 type GoogleCloudRetailV2betaPurgeProductsRequest struct { 6070 // Filter: Required. The filter string to specify the products to be deleted 6071 // with a length limit of 5,000 characters. Empty string filter is not allowed. 6072 // "*" implies delete all items in a branch. The eligible fields for filtering 6073 // are: * `availability`: Double quoted Product.availability string. * 6074 // `create_time` : in ISO 8601 "zulu" format. Supported syntax: * Comparators 6075 // (">", "<", ">=", "<=", "="). Examples: * create_time <= 6076 // "2015-02-13T17:05:46Z" * availability = "IN_STOCK" * Conjunctions ("AND") 6077 // Examples: * create_time <= "2015-02-13T17:05:46Z" AND availability = 6078 // "PREORDER" * Disjunctions ("OR") Examples: * create_time <= 6079 // "2015-02-13T17:05:46Z" OR availability = "IN_STOCK" * Can support nested 6080 // queries. Examples: * (create_time <= "2015-02-13T17:05:46Z" AND availability 6081 // = "PREORDER") OR (create_time >= "2015-02-14T13:03:32Z" AND availability = 6082 // "IN_STOCK") * Filter Limits: * Filter should not contain more than 6 6083 // conditions. * Max nesting depth should not exceed 2 levels. Examples 6084 // queries: * Delete back order products created before a timestamp. 6085 // create_time <= "2015-02-13T17:05:46Z" OR availability = "BACKORDER" 6086 Filter string `json:"filter,omitempty"` 6087 // Force: Actually perform the purge. If `force` is set to false, the method 6088 // will return the expected purge count without deleting any products. 6089 Force bool `json:"force,omitempty"` 6090 // ForceSendFields is a list of field names (e.g. "Filter") to unconditionally 6091 // include in API requests. By default, fields with empty or default values are 6092 // omitted from API requests. See 6093 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6094 // details. 6095 ForceSendFields []string `json:"-"` 6096 // NullFields is a list of field names (e.g. "Filter") to include in API 6097 // requests with the JSON null value. By default, fields with empty values are 6098 // omitted from API requests. See 6099 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6100 NullFields []string `json:"-"` 6101 } 6102 6103 func (s *GoogleCloudRetailV2betaPurgeProductsRequest) MarshalJSON() ([]byte, error) { 6104 type NoMethod GoogleCloudRetailV2betaPurgeProductsRequest 6105 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6106 } 6107 6108 // GoogleCloudRetailV2betaPurgeProductsResponse: Response of the 6109 // PurgeProductsRequest. If the long running operation is successfully done, 6110 // then this message is returned by the google.longrunning.Operations.response 6111 // field. 6112 type GoogleCloudRetailV2betaPurgeProductsResponse struct { 6113 // PurgeCount: The total count of products purged as a result of the operation. 6114 PurgeCount int64 `json:"purgeCount,omitempty,string"` 6115 // PurgeSample: A sample of the product names that will be deleted. Only 6116 // populated if `force` is set to false. A max of 100 names will be returned 6117 // and the names are chosen at random. 6118 PurgeSample []string `json:"purgeSample,omitempty"` 6119 // ForceSendFields is a list of field names (e.g. "PurgeCount") to 6120 // unconditionally include in API requests. By default, fields with empty or 6121 // default values are omitted from API requests. See 6122 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6123 // details. 6124 ForceSendFields []string `json:"-"` 6125 // NullFields is a list of field names (e.g. "PurgeCount") to include in API 6126 // requests with the JSON null value. By default, fields with empty values are 6127 // omitted from API requests. See 6128 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6129 NullFields []string `json:"-"` 6130 } 6131 6132 func (s *GoogleCloudRetailV2betaPurgeProductsResponse) MarshalJSON() ([]byte, error) { 6133 type NoMethod GoogleCloudRetailV2betaPurgeProductsResponse 6134 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6135 } 6136 6137 // GoogleCloudRetailV2betaPurgeUserEventsRequest: Request message for 6138 // PurgeUserEvents method. 6139 type GoogleCloudRetailV2betaPurgeUserEventsRequest struct { 6140 // Filter: Required. The filter string to specify the events to be deleted with 6141 // a length limit of 5,000 characters. Empty string filter is not allowed. The 6142 // eligible fields for filtering are: * `eventType`: Double quoted 6143 // UserEvent.event_type string. * `eventTime`: in ISO 8601 "zulu" format. * 6144 // `visitorId`: Double quoted string. Specifying this will delete all events 6145 // associated with a visitor. * `userId`: Double quoted string. Specifying this 6146 // will delete all events associated with a user. Examples: * Deleting all 6147 // events in a time range: `eventTime > "2012-04-23T18:25:43.511Z" eventTime < 6148 // "2012-04-23T18:30:43.511Z" * Deleting specific eventType in time range: 6149 // `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view" * 6150 // Deleting all events for a specific visitor: `visitorId = "visitor1024" The 6151 // filtering fields are assumed to have an implicit AND. 6152 Filter string `json:"filter,omitempty"` 6153 // Force: Actually perform the purge. If `force` is set to false, the method 6154 // will return the expected purge count without deleting any user events. 6155 Force bool `json:"force,omitempty"` 6156 // ForceSendFields is a list of field names (e.g. "Filter") to unconditionally 6157 // include in API requests. By default, fields with empty or default values are 6158 // omitted from API requests. See 6159 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6160 // details. 6161 ForceSendFields []string `json:"-"` 6162 // NullFields is a list of field names (e.g. "Filter") to include in API 6163 // requests with the JSON null value. By default, fields with empty values are 6164 // omitted from API requests. See 6165 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6166 NullFields []string `json:"-"` 6167 } 6168 6169 func (s *GoogleCloudRetailV2betaPurgeUserEventsRequest) MarshalJSON() ([]byte, error) { 6170 type NoMethod GoogleCloudRetailV2betaPurgeUserEventsRequest 6171 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6172 } 6173 6174 // GoogleCloudRetailV2betaPurgeUserEventsResponse: Response of the 6175 // PurgeUserEventsRequest. If the long running operation is successfully done, 6176 // then this message is returned by the google.longrunning.Operations.response 6177 // field. 6178 type GoogleCloudRetailV2betaPurgeUserEventsResponse struct { 6179 // PurgedEventsCount: The total count of events purged as a result of the 6180 // operation. 6181 PurgedEventsCount int64 `json:"purgedEventsCount,omitempty,string"` 6182 // ForceSendFields is a list of field names (e.g. "PurgedEventsCount") to 6183 // unconditionally include in API requests. By default, fields with empty or 6184 // default values are omitted from API requests. See 6185 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6186 // details. 6187 ForceSendFields []string `json:"-"` 6188 // NullFields is a list of field names (e.g. "PurgedEventsCount") to include in 6189 // API requests with the JSON null value. By default, fields with empty values 6190 // are omitted from API requests. See 6191 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6192 NullFields []string `json:"-"` 6193 } 6194 6195 func (s *GoogleCloudRetailV2betaPurgeUserEventsResponse) MarshalJSON() ([]byte, error) { 6196 type NoMethod GoogleCloudRetailV2betaPurgeUserEventsResponse 6197 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6198 } 6199 6200 // GoogleCloudRetailV2betaRating: The rating of a Product. 6201 type GoogleCloudRetailV2betaRating struct { 6202 // AverageRating: The average rating of the Product. The rating is scaled at 6203 // 1-5. Otherwise, an INVALID_ARGUMENT error is returned. 6204 AverageRating float64 `json:"averageRating,omitempty"` 6205 // RatingCount: The total number of ratings. This value is independent of the 6206 // value of rating_histogram. This value must be nonnegative. Otherwise, an 6207 // INVALID_ARGUMENT error is returned. 6208 RatingCount int64 `json:"ratingCount,omitempty"` 6209 // RatingHistogram: List of rating counts per rating value (index = rating - 6210 // 1). The list is empty if there is no rating. If the list is non-empty, its 6211 // size is always 5. Otherwise, an INVALID_ARGUMENT error is returned. For 6212 // example, [41, 14, 13, 47, 303]. It means that the Product got 41 ratings 6213 // with 1 star, 14 ratings with 2 star, and so on. 6214 RatingHistogram []int64 `json:"ratingHistogram,omitempty"` 6215 // ForceSendFields is a list of field names (e.g. "AverageRating") to 6216 // unconditionally include in API requests. By default, fields with empty or 6217 // default values are omitted from API requests. See 6218 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6219 // details. 6220 ForceSendFields []string `json:"-"` 6221 // NullFields is a list of field names (e.g. "AverageRating") to include in API 6222 // requests with the JSON null value. By default, fields with empty values are 6223 // omitted from API requests. See 6224 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6225 NullFields []string `json:"-"` 6226 } 6227 6228 func (s *GoogleCloudRetailV2betaRating) MarshalJSON() ([]byte, error) { 6229 type NoMethod GoogleCloudRetailV2betaRating 6230 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6231 } 6232 6233 func (s *GoogleCloudRetailV2betaRating) UnmarshalJSON(data []byte) error { 6234 type NoMethod GoogleCloudRetailV2betaRating 6235 var s1 struct { 6236 AverageRating gensupport.JSONFloat64 `json:"averageRating"` 6237 *NoMethod 6238 } 6239 s1.NoMethod = (*NoMethod)(s) 6240 if err := json.Unmarshal(data, &s1); err != nil { 6241 return err 6242 } 6243 s.AverageRating = float64(s1.AverageRating) 6244 return nil 6245 } 6246 6247 // GoogleCloudRetailV2betaRejoinUserEventsMetadata: Metadata for 6248 // `RejoinUserEvents` method. 6249 type GoogleCloudRetailV2betaRejoinUserEventsMetadata struct { 6250 } 6251 6252 // GoogleCloudRetailV2betaRejoinUserEventsRequest: Request message for 6253 // RejoinUserEvents method. 6254 type GoogleCloudRetailV2betaRejoinUserEventsRequest struct { 6255 // UserEventRejoinScope: The type of the user event rejoin to define the scope 6256 // and range of the user events to be rejoined with the latest product catalog. 6257 // Defaults to `USER_EVENT_REJOIN_SCOPE_UNSPECIFIED` if this field is not set, 6258 // or set to an invalid integer value. 6259 // 6260 // Possible values: 6261 // "USER_EVENT_REJOIN_SCOPE_UNSPECIFIED" - Rejoin all events with the latest 6262 // product catalog, including both joined events and unjoined events. 6263 // "JOINED_EVENTS" - Only rejoin joined events with the latest product 6264 // catalog. 6265 // "UNJOINED_EVENTS" - Only rejoin unjoined events with the latest product 6266 // catalog. 6267 UserEventRejoinScope string `json:"userEventRejoinScope,omitempty"` 6268 // ForceSendFields is a list of field names (e.g. "UserEventRejoinScope") to 6269 // unconditionally include in API requests. By default, fields with empty or 6270 // default values are omitted from API requests. See 6271 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6272 // details. 6273 ForceSendFields []string `json:"-"` 6274 // NullFields is a list of field names (e.g. "UserEventRejoinScope") to include 6275 // in API requests with the JSON null value. By default, fields with empty 6276 // values are omitted from API requests. See 6277 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6278 NullFields []string `json:"-"` 6279 } 6280 6281 func (s *GoogleCloudRetailV2betaRejoinUserEventsRequest) MarshalJSON() ([]byte, error) { 6282 type NoMethod GoogleCloudRetailV2betaRejoinUserEventsRequest 6283 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6284 } 6285 6286 // GoogleCloudRetailV2betaRejoinUserEventsResponse: Response message for 6287 // `RejoinUserEvents` method. 6288 type GoogleCloudRetailV2betaRejoinUserEventsResponse struct { 6289 // RejoinedUserEventsCount: Number of user events that were joined with latest 6290 // product catalog. 6291 RejoinedUserEventsCount int64 `json:"rejoinedUserEventsCount,omitempty,string"` 6292 // ForceSendFields is a list of field names (e.g. "RejoinedUserEventsCount") to 6293 // unconditionally include in API requests. By default, fields with empty or 6294 // default values are omitted from API requests. See 6295 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6296 // details. 6297 ForceSendFields []string `json:"-"` 6298 // NullFields is a list of field names (e.g. "RejoinedUserEventsCount") to 6299 // include in API requests with the JSON null value. By default, fields with 6300 // empty values are omitted from API requests. See 6301 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6302 NullFields []string `json:"-"` 6303 } 6304 6305 func (s *GoogleCloudRetailV2betaRejoinUserEventsResponse) MarshalJSON() ([]byte, error) { 6306 type NoMethod GoogleCloudRetailV2betaRejoinUserEventsResponse 6307 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6308 } 6309 6310 // GoogleCloudRetailV2betaRemoveCatalogAttributeRequest: Request for 6311 // CatalogService.RemoveCatalogAttribute method. 6312 type GoogleCloudRetailV2betaRemoveCatalogAttributeRequest struct { 6313 // Key: Required. The attribute name key of the CatalogAttribute to remove. 6314 Key string `json:"key,omitempty"` 6315 // ForceSendFields is a list of field names (e.g. "Key") to unconditionally 6316 // include in API requests. By default, fields with empty or default values are 6317 // omitted from API requests. See 6318 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6319 // details. 6320 ForceSendFields []string `json:"-"` 6321 // NullFields is a list of field names (e.g. "Key") to include in API requests 6322 // with the JSON null value. By default, fields with empty values are omitted 6323 // from API requests. See 6324 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6325 NullFields []string `json:"-"` 6326 } 6327 6328 func (s *GoogleCloudRetailV2betaRemoveCatalogAttributeRequest) MarshalJSON() ([]byte, error) { 6329 type NoMethod GoogleCloudRetailV2betaRemoveCatalogAttributeRequest 6330 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6331 } 6332 6333 // GoogleCloudRetailV2betaRemoveControlRequest: Request for RemoveControl 6334 // method. 6335 type GoogleCloudRetailV2betaRemoveControlRequest struct { 6336 // ControlId: Required. The id of the control to apply. Assumed to be in the 6337 // same catalog as the serving config. 6338 ControlId string `json:"controlId,omitempty"` 6339 // ForceSendFields is a list of field names (e.g. "ControlId") to 6340 // unconditionally include in API requests. By default, fields with empty or 6341 // default values are omitted from API requests. See 6342 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6343 // details. 6344 ForceSendFields []string `json:"-"` 6345 // NullFields is a list of field names (e.g. "ControlId") to include in API 6346 // requests with the JSON null value. By default, fields with empty values are 6347 // omitted from API requests. See 6348 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6349 NullFields []string `json:"-"` 6350 } 6351 6352 func (s *GoogleCloudRetailV2betaRemoveControlRequest) MarshalJSON() ([]byte, error) { 6353 type NoMethod GoogleCloudRetailV2betaRemoveControlRequest 6354 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6355 } 6356 6357 // GoogleCloudRetailV2betaRemoveFulfillmentPlacesMetadata: Metadata related to 6358 // the progress of the RemoveFulfillmentPlaces operation. Currently empty 6359 // because there is no meaningful metadata populated from the 6360 // ProductService.RemoveFulfillmentPlaces method. 6361 type GoogleCloudRetailV2betaRemoveFulfillmentPlacesMetadata struct { 6362 } 6363 6364 // GoogleCloudRetailV2betaRemoveFulfillmentPlacesRequest: Request message for 6365 // ProductService.RemoveFulfillmentPlaces method. 6366 type GoogleCloudRetailV2betaRemoveFulfillmentPlacesRequest struct { 6367 // AllowMissing: If set to true, and the Product is not found, the fulfillment 6368 // information will still be processed and retained for at most 1 day and 6369 // processed once the Product is created. If set to false, a NOT_FOUND error is 6370 // returned if the Product is not found. 6371 AllowMissing bool `json:"allowMissing,omitempty"` 6372 // PlaceIds: Required. The IDs for this type, such as the store IDs for 6373 // "pickup-in-store" or the region IDs for "same-day-delivery", to be removed 6374 // for this type. At least 1 value is required, and a maximum of 2000 values 6375 // are allowed. Each value must be a string with a length limit of 10 6376 // characters, matching the pattern `[a-zA-Z0-9_-]+`, such as "store1" or 6377 // "REGION-2". Otherwise, an INVALID_ARGUMENT error is returned. 6378 PlaceIds []string `json:"placeIds,omitempty"` 6379 // RemoveTime: The time when the fulfillment updates are issued, used to 6380 // prevent out-of-order updates on fulfillment information. If not provided, 6381 // the internal system time will be used. 6382 RemoveTime string `json:"removeTime,omitempty"` 6383 // Type: Required. The fulfillment type, including commonly used types (such as 6384 // pickup in store and same day delivery), and custom types. Supported values: 6385 // * "pickup-in-store" * "ship-to-store" * "same-day-delivery" * 6386 // "next-day-delivery" * "custom-type-1" * "custom-type-2" * "custom-type-3" * 6387 // "custom-type-4" * "custom-type-5" If this field is set to an invalid value 6388 // other than these, an INVALID_ARGUMENT error is returned. This field directly 6389 // corresponds to Product.fulfillment_info.type. 6390 Type string `json:"type,omitempty"` 6391 // ForceSendFields is a list of field names (e.g. "AllowMissing") to 6392 // unconditionally include in API requests. By default, fields with empty or 6393 // default values are omitted from API requests. See 6394 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6395 // details. 6396 ForceSendFields []string `json:"-"` 6397 // NullFields is a list of field names (e.g. "AllowMissing") to include in API 6398 // requests with the JSON null value. By default, fields with empty values are 6399 // omitted from API requests. See 6400 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6401 NullFields []string `json:"-"` 6402 } 6403 6404 func (s *GoogleCloudRetailV2betaRemoveFulfillmentPlacesRequest) MarshalJSON() ([]byte, error) { 6405 type NoMethod GoogleCloudRetailV2betaRemoveFulfillmentPlacesRequest 6406 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6407 } 6408 6409 // GoogleCloudRetailV2betaRemoveFulfillmentPlacesResponse: Response of the 6410 // RemoveFulfillmentPlacesRequest. Currently empty because there is no 6411 // meaningful response populated from the 6412 // ProductService.RemoveFulfillmentPlaces method. 6413 type GoogleCloudRetailV2betaRemoveFulfillmentPlacesResponse struct { 6414 } 6415 6416 // GoogleCloudRetailV2betaRemoveLocalInventoriesMetadata: Metadata related to 6417 // the progress of the RemoveLocalInventories operation. Currently empty 6418 // because there is no meaningful metadata populated from the 6419 // ProductService.RemoveLocalInventories method. 6420 type GoogleCloudRetailV2betaRemoveLocalInventoriesMetadata struct { 6421 } 6422 6423 // GoogleCloudRetailV2betaRemoveLocalInventoriesRequest: Request message for 6424 // ProductService.RemoveLocalInventories method. 6425 type GoogleCloudRetailV2betaRemoveLocalInventoriesRequest struct { 6426 // AllowMissing: If set to true, and the Product is not found, the local 6427 // inventory removal request will still be processed and retained for at most 1 6428 // day and processed once the Product is created. If set to false, a NOT_FOUND 6429 // error is returned if the Product is not found. 6430 AllowMissing bool `json:"allowMissing,omitempty"` 6431 // PlaceIds: Required. A list of place IDs to have their inventory deleted. At 6432 // most 3000 place IDs are allowed per request. 6433 PlaceIds []string `json:"placeIds,omitempty"` 6434 // RemoveTime: The time when the inventory deletions are issued. Used to 6435 // prevent out-of-order updates and deletions on local inventory fields. If not 6436 // provided, the internal system time will be used. 6437 RemoveTime string `json:"removeTime,omitempty"` 6438 // ForceSendFields is a list of field names (e.g. "AllowMissing") to 6439 // unconditionally include in API requests. By default, fields with empty or 6440 // default values are omitted from API requests. See 6441 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6442 // details. 6443 ForceSendFields []string `json:"-"` 6444 // NullFields is a list of field names (e.g. "AllowMissing") to include in API 6445 // requests with the JSON null value. By default, fields with empty values are 6446 // omitted from API requests. See 6447 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6448 NullFields []string `json:"-"` 6449 } 6450 6451 func (s *GoogleCloudRetailV2betaRemoveLocalInventoriesRequest) MarshalJSON() ([]byte, error) { 6452 type NoMethod GoogleCloudRetailV2betaRemoveLocalInventoriesRequest 6453 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6454 } 6455 6456 // GoogleCloudRetailV2betaRemoveLocalInventoriesResponse: Response of the 6457 // ProductService.RemoveLocalInventories API. Currently empty because there is 6458 // no meaningful response populated from the 6459 // ProductService.RemoveLocalInventories method. 6460 type GoogleCloudRetailV2betaRemoveLocalInventoriesResponse struct { 6461 } 6462 6463 // GoogleCloudRetailV2betaReplaceCatalogAttributeRequest: Request for 6464 // CatalogService.ReplaceCatalogAttribute method. 6465 type GoogleCloudRetailV2betaReplaceCatalogAttributeRequest struct { 6466 // CatalogAttribute: Required. The updated CatalogAttribute. 6467 CatalogAttribute *GoogleCloudRetailV2betaCatalogAttribute `json:"catalogAttribute,omitempty"` 6468 // UpdateMask: Indicates which fields in the provided CatalogAttribute to 6469 // update. The following are NOT supported: * CatalogAttribute.key If not set, 6470 // all supported fields are updated. 6471 UpdateMask string `json:"updateMask,omitempty"` 6472 // ForceSendFields is a list of field names (e.g. "CatalogAttribute") to 6473 // unconditionally include in API requests. By default, fields with empty or 6474 // default values are omitted from API requests. See 6475 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6476 // details. 6477 ForceSendFields []string `json:"-"` 6478 // NullFields is a list of field names (e.g. "CatalogAttribute") to include in 6479 // API requests with the JSON null value. By default, fields with empty values 6480 // are omitted from API requests. See 6481 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6482 NullFields []string `json:"-"` 6483 } 6484 6485 func (s *GoogleCloudRetailV2betaReplaceCatalogAttributeRequest) MarshalJSON() ([]byte, error) { 6486 type NoMethod GoogleCloudRetailV2betaReplaceCatalogAttributeRequest 6487 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6488 } 6489 6490 // GoogleCloudRetailV2betaResumeModelRequest: Request for resuming training of 6491 // a model. 6492 type GoogleCloudRetailV2betaResumeModelRequest struct { 6493 } 6494 6495 // GoogleCloudRetailV2betaRule: A rule is a condition-action pair * A condition 6496 // defines when a rule is to be triggered. * An action specifies what occurs on 6497 // that trigger. Currently rules only work for controls with 6498 // SOLUTION_TYPE_SEARCH. 6499 type GoogleCloudRetailV2betaRule struct { 6500 // BoostAction: A boost action. 6501 BoostAction *GoogleCloudRetailV2betaRuleBoostAction `json:"boostAction,omitempty"` 6502 // Condition: Required. The condition that triggers the rule. If the condition 6503 // is empty, the rule will always apply. 6504 Condition *GoogleCloudRetailV2betaCondition `json:"condition,omitempty"` 6505 // DoNotAssociateAction: Prevents term from being associated with other terms. 6506 DoNotAssociateAction *GoogleCloudRetailV2betaRuleDoNotAssociateAction `json:"doNotAssociateAction,omitempty"` 6507 // FilterAction: Filters results. 6508 FilterAction *GoogleCloudRetailV2betaRuleFilterAction `json:"filterAction,omitempty"` 6509 // ForceReturnFacetAction: Force returns an attribute as a facet in the 6510 // request. 6511 ForceReturnFacetAction *GoogleCloudRetailV2betaRuleForceReturnFacetAction `json:"forceReturnFacetAction,omitempty"` 6512 // IgnoreAction: Ignores specific terms from query during search. 6513 IgnoreAction *GoogleCloudRetailV2betaRuleIgnoreAction `json:"ignoreAction,omitempty"` 6514 // OnewaySynonymsAction: Treats specific term as a synonym with a group of 6515 // terms. Group of terms will not be treated as synonyms with the specific 6516 // term. 6517 OnewaySynonymsAction *GoogleCloudRetailV2betaRuleOnewaySynonymsAction `json:"onewaySynonymsAction,omitempty"` 6518 // RedirectAction: Redirects a shopper to a specific page. 6519 RedirectAction *GoogleCloudRetailV2betaRuleRedirectAction `json:"redirectAction,omitempty"` 6520 // RemoveFacetAction: Remove an attribute as a facet in the request (if 6521 // present). 6522 RemoveFacetAction *GoogleCloudRetailV2betaRuleRemoveFacetAction `json:"removeFacetAction,omitempty"` 6523 // ReplacementAction: Replaces specific terms in the query. 6524 ReplacementAction *GoogleCloudRetailV2betaRuleReplacementAction `json:"replacementAction,omitempty"` 6525 // TwowaySynonymsAction: Treats a set of terms as synonyms of one another. 6526 TwowaySynonymsAction *GoogleCloudRetailV2betaRuleTwowaySynonymsAction `json:"twowaySynonymsAction,omitempty"` 6527 // ForceSendFields is a list of field names (e.g. "BoostAction") to 6528 // unconditionally include in API requests. By default, fields with empty or 6529 // default values are omitted from API requests. See 6530 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6531 // details. 6532 ForceSendFields []string `json:"-"` 6533 // NullFields is a list of field names (e.g. "BoostAction") to include in API 6534 // requests with the JSON null value. By default, fields with empty values are 6535 // omitted from API requests. See 6536 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6537 NullFields []string `json:"-"` 6538 } 6539 6540 func (s *GoogleCloudRetailV2betaRule) MarshalJSON() ([]byte, error) { 6541 type NoMethod GoogleCloudRetailV2betaRule 6542 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6543 } 6544 6545 // GoogleCloudRetailV2betaRuleBoostAction: A boost action to apply to results 6546 // matching condition specified above. 6547 type GoogleCloudRetailV2betaRuleBoostAction struct { 6548 // Boost: Strength of the condition boost, which must be in [-1, 1]. Negative 6549 // boost means demotion. Default is 0.0. Setting to 1.0 gives the item a big 6550 // promotion. However, it does not necessarily mean that the boosted item will 6551 // be the top result at all times, nor that other items will be excluded. 6552 // Results could still be shown even when none of them matches the condition. 6553 // And results that are significantly more relevant to the search query can 6554 // still trump your heavily favored but irrelevant items. Setting to -1.0 gives 6555 // the item a big demotion. However, results that are deeply relevant might 6556 // still be shown. The item will have an upstream battle to get a fairly high 6557 // ranking, but it is not blocked out completely. Setting to 0.0 means no boost 6558 // applied. The boosting condition is ignored. 6559 Boost float64 `json:"boost,omitempty"` 6560 // ProductsFilter: The filter can have a max size of 5000 characters. An 6561 // expression which specifies which products to apply an action to. The syntax 6562 // and supported fields are the same as a filter expression. See 6563 // SearchRequest.filter for detail syntax and limitations. Examples: * To boost 6564 // products with product ID "product_1" or "product_2", and color "Red" or 6565 // "Blue": *(id: ANY("product_1", "product_2")) * *AND * *(colorFamilies: 6566 // ANY("Red", "Blue")) * 6567 ProductsFilter string `json:"productsFilter,omitempty"` 6568 // ForceSendFields is a list of field names (e.g. "Boost") to unconditionally 6569 // include in API requests. By default, fields with empty or default values are 6570 // omitted from API requests. See 6571 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6572 // details. 6573 ForceSendFields []string `json:"-"` 6574 // NullFields is a list of field names (e.g. "Boost") to include in API 6575 // requests with the JSON null value. By default, fields with empty values are 6576 // omitted from API requests. See 6577 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6578 NullFields []string `json:"-"` 6579 } 6580 6581 func (s *GoogleCloudRetailV2betaRuleBoostAction) MarshalJSON() ([]byte, error) { 6582 type NoMethod GoogleCloudRetailV2betaRuleBoostAction 6583 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6584 } 6585 6586 func (s *GoogleCloudRetailV2betaRuleBoostAction) UnmarshalJSON(data []byte) error { 6587 type NoMethod GoogleCloudRetailV2betaRuleBoostAction 6588 var s1 struct { 6589 Boost gensupport.JSONFloat64 `json:"boost"` 6590 *NoMethod 6591 } 6592 s1.NoMethod = (*NoMethod)(s) 6593 if err := json.Unmarshal(data, &s1); err != nil { 6594 return err 6595 } 6596 s.Boost = float64(s1.Boost) 6597 return nil 6598 } 6599 6600 // GoogleCloudRetailV2betaRuleDoNotAssociateAction: Prevents `query_term` from 6601 // being associated with specified terms during search. Example: Don't 6602 // associate "gShoe" and "cheap". 6603 type GoogleCloudRetailV2betaRuleDoNotAssociateAction struct { 6604 // DoNotAssociateTerms: Cannot contain duplicates or the query term. Can 6605 // specify up to 100 terms. 6606 DoNotAssociateTerms []string `json:"doNotAssociateTerms,omitempty"` 6607 // QueryTerms: Terms from the search query. Will not consider 6608 // do_not_associate_terms for search if in search query. Can specify up to 100 6609 // terms. 6610 QueryTerms []string `json:"queryTerms,omitempty"` 6611 // Terms: Will be [deprecated = true] post migration; 6612 Terms []string `json:"terms,omitempty"` 6613 // ForceSendFields is a list of field names (e.g. "DoNotAssociateTerms") to 6614 // unconditionally include in API requests. By default, fields with empty or 6615 // default values are omitted from API requests. See 6616 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6617 // details. 6618 ForceSendFields []string `json:"-"` 6619 // NullFields is a list of field names (e.g. "DoNotAssociateTerms") to include 6620 // in API requests with the JSON null value. By default, fields with empty 6621 // values are omitted from API requests. See 6622 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6623 NullFields []string `json:"-"` 6624 } 6625 6626 func (s *GoogleCloudRetailV2betaRuleDoNotAssociateAction) MarshalJSON() ([]byte, error) { 6627 type NoMethod GoogleCloudRetailV2betaRuleDoNotAssociateAction 6628 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6629 } 6630 6631 // GoogleCloudRetailV2betaRuleFilterAction: * Rule Condition: - No 6632 // Condition.query_terms provided is a global match. - 1 or more 6633 // Condition.query_terms provided are combined with OR operator. * Action 6634 // Input: The request query and filter that are applied to the retrieved 6635 // products, in addition to any filters already provided with the 6636 // SearchRequest. The AND operator is used to combine the query's existing 6637 // filters with the filter rule(s). NOTE: May result in 0 results when filters 6638 // conflict. * Action Result: Filters the returned objects to be ONLY those 6639 // that passed the filter. 6640 type GoogleCloudRetailV2betaRuleFilterAction struct { 6641 // Filter: A filter to apply on the matching condition results. Supported 6642 // features: * filter must be set. * Filter syntax is identical to 6643 // SearchRequest.filter. For more information, see Filter 6644 // (/retail/docs/filter-and-order#filter). * To filter products with product ID 6645 // "product_1" or "product_2", and color "Red" or "Blue": *(id: 6646 // ANY("product_1", "product_2")) * *AND * *(colorFamilies: ANY("Red", "Blue")) 6647 // * 6648 Filter string `json:"filter,omitempty"` 6649 // ForceSendFields is a list of field names (e.g. "Filter") to unconditionally 6650 // include in API requests. By default, fields with empty or default values are 6651 // omitted from API requests. See 6652 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6653 // details. 6654 ForceSendFields []string `json:"-"` 6655 // NullFields is a list of field names (e.g. "Filter") to include in API 6656 // requests with the JSON null value. By default, fields with empty values are 6657 // omitted from API requests. See 6658 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6659 NullFields []string `json:"-"` 6660 } 6661 6662 func (s *GoogleCloudRetailV2betaRuleFilterAction) MarshalJSON() ([]byte, error) { 6663 type NoMethod GoogleCloudRetailV2betaRuleFilterAction 6664 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6665 } 6666 6667 // GoogleCloudRetailV2betaRuleForceReturnFacetAction: Force returns an 6668 // attribute/facet in the request around a certain position or above. * Rule 6669 // Condition: Must specify non-empty Condition.query_terms (for search only) or 6670 // Condition.page_categories (for browse only), but can't specify both. * 6671 // Action Inputs: attribute name, position * Action Result: Will force return a 6672 // facet key around a certain position or above if the condition is satisfied. 6673 // Example: Suppose the query is "shoes", the Condition.query_terms is "shoes", 6674 // the ForceReturnFacetAction.FacetPositionAdjustment.attribute_name is "size" 6675 // and the ForceReturnFacetAction.FacetPositionAdjustment.position is 8. Two 6676 // cases: a) The facet key "size" is not already in the top 8 slots, then the 6677 // facet "size" will appear at a position close to 8. b) The facet key "size" 6678 // in among the top 8 positions in the request, then it will stay at its 6679 // current rank. 6680 type GoogleCloudRetailV2betaRuleForceReturnFacetAction struct { 6681 // FacetPositionAdjustments: Each instance corresponds to a force return 6682 // attribute for the given condition. There can't be more 3 instances here. 6683 FacetPositionAdjustments []*GoogleCloudRetailV2betaRuleForceReturnFacetActionFacetPositionAdjustment `json:"facetPositionAdjustments,omitempty"` 6684 // ForceSendFields is a list of field names (e.g. "FacetPositionAdjustments") 6685 // to unconditionally include in API requests. By default, fields with empty or 6686 // default values are omitted from API requests. See 6687 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6688 // details. 6689 ForceSendFields []string `json:"-"` 6690 // NullFields is a list of field names (e.g. "FacetPositionAdjustments") to 6691 // include in API requests with the JSON null value. By default, fields with 6692 // empty values are omitted from API requests. See 6693 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6694 NullFields []string `json:"-"` 6695 } 6696 6697 func (s *GoogleCloudRetailV2betaRuleForceReturnFacetAction) MarshalJSON() ([]byte, error) { 6698 type NoMethod GoogleCloudRetailV2betaRuleForceReturnFacetAction 6699 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6700 } 6701 6702 // GoogleCloudRetailV2betaRuleForceReturnFacetActionFacetPositionAdjustment: 6703 // Each facet position adjustment consists of a single attribute name (i.e. 6704 // facet key) along with a specified position. 6705 type GoogleCloudRetailV2betaRuleForceReturnFacetActionFacetPositionAdjustment struct { 6706 // AttributeName: The attribute name to force return as a facet. Each attribute 6707 // name should be a valid attribute name, be non-empty and contain at most 80 6708 // characters long. 6709 AttributeName string `json:"attributeName,omitempty"` 6710 // Position: This is the position in the request as explained above. It should 6711 // be strictly positive be at most 100. 6712 Position int64 `json:"position,omitempty"` 6713 // ForceSendFields is a list of field names (e.g. "AttributeName") to 6714 // unconditionally include in API requests. By default, fields with empty or 6715 // default values are omitted from API requests. See 6716 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6717 // details. 6718 ForceSendFields []string `json:"-"` 6719 // NullFields is a list of field names (e.g. "AttributeName") to include in API 6720 // requests with the JSON null value. By default, fields with empty values are 6721 // omitted from API requests. See 6722 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6723 NullFields []string `json:"-"` 6724 } 6725 6726 func (s *GoogleCloudRetailV2betaRuleForceReturnFacetActionFacetPositionAdjustment) MarshalJSON() ([]byte, error) { 6727 type NoMethod GoogleCloudRetailV2betaRuleForceReturnFacetActionFacetPositionAdjustment 6728 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6729 } 6730 6731 // GoogleCloudRetailV2betaRuleIgnoreAction: Prevents a term in the query from 6732 // being used in search. Example: Don't search for "shoddy". 6733 type GoogleCloudRetailV2betaRuleIgnoreAction struct { 6734 // IgnoreTerms: Terms to ignore in the search query. 6735 IgnoreTerms []string `json:"ignoreTerms,omitempty"` 6736 // ForceSendFields is a list of field names (e.g. "IgnoreTerms") to 6737 // unconditionally include in API requests. By default, fields with empty or 6738 // default values are omitted from API requests. See 6739 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6740 // details. 6741 ForceSendFields []string `json:"-"` 6742 // NullFields is a list of field names (e.g. "IgnoreTerms") to include in API 6743 // requests with the JSON null value. By default, fields with empty values are 6744 // omitted from API requests. See 6745 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6746 NullFields []string `json:"-"` 6747 } 6748 6749 func (s *GoogleCloudRetailV2betaRuleIgnoreAction) MarshalJSON() ([]byte, error) { 6750 type NoMethod GoogleCloudRetailV2betaRuleIgnoreAction 6751 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6752 } 6753 6754 // GoogleCloudRetailV2betaRuleOnewaySynonymsAction: Maps a set of terms to a 6755 // set of synonyms. Set of synonyms will be treated as synonyms of each query 6756 // term only. `query_terms` will not be treated as synonyms of each other. 6757 // Example: "sneakers" will use a synonym of "shoes". "shoes" will not use a 6758 // synonym of "sneakers". 6759 type GoogleCloudRetailV2betaRuleOnewaySynonymsAction struct { 6760 // OnewayTerms: Will be [deprecated = true] post migration; 6761 OnewayTerms []string `json:"onewayTerms,omitempty"` 6762 // QueryTerms: Terms from the search query. Will treat synonyms as their 6763 // synonyms. Not themselves synonyms of the synonyms. Can specify up to 100 6764 // terms. 6765 QueryTerms []string `json:"queryTerms,omitempty"` 6766 // Synonyms: Defines a set of synonyms. Cannot contain duplicates. Can specify 6767 // up to 100 synonyms. 6768 Synonyms []string `json:"synonyms,omitempty"` 6769 // ForceSendFields is a list of field names (e.g. "OnewayTerms") to 6770 // unconditionally include in API requests. By default, fields with empty or 6771 // default values are omitted from API requests. See 6772 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6773 // details. 6774 ForceSendFields []string `json:"-"` 6775 // NullFields is a list of field names (e.g. "OnewayTerms") to include in API 6776 // requests with the JSON null value. By default, fields with empty values are 6777 // omitted from API requests. See 6778 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6779 NullFields []string `json:"-"` 6780 } 6781 6782 func (s *GoogleCloudRetailV2betaRuleOnewaySynonymsAction) MarshalJSON() ([]byte, error) { 6783 type NoMethod GoogleCloudRetailV2betaRuleOnewaySynonymsAction 6784 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6785 } 6786 6787 // GoogleCloudRetailV2betaRuleRedirectAction: Redirects a shopper to a specific 6788 // page. * Rule Condition: Must specify Condition.query_terms. * Action Input: 6789 // Request Query * Action Result: Redirects shopper to provided uri. 6790 type GoogleCloudRetailV2betaRuleRedirectAction struct { 6791 // RedirectUri: URL must have length equal or less than 2000 characters. 6792 RedirectUri string `json:"redirectUri,omitempty"` 6793 // ForceSendFields is a list of field names (e.g. "RedirectUri") to 6794 // unconditionally include in API requests. By default, fields with empty or 6795 // default values are omitted from API requests. See 6796 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6797 // details. 6798 ForceSendFields []string `json:"-"` 6799 // NullFields is a list of field names (e.g. "RedirectUri") to include in API 6800 // requests with the JSON null value. By default, fields with empty values are 6801 // omitted from API requests. See 6802 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6803 NullFields []string `json:"-"` 6804 } 6805 6806 func (s *GoogleCloudRetailV2betaRuleRedirectAction) MarshalJSON() ([]byte, error) { 6807 type NoMethod GoogleCloudRetailV2betaRuleRedirectAction 6808 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6809 } 6810 6811 // GoogleCloudRetailV2betaRuleRemoveFacetAction: Removes an attribute/facet in 6812 // the request if is present. * Rule Condition: Must specify non-empty 6813 // Condition.query_terms (for search only) or Condition.page_categories (for 6814 // browse only), but can't specify both. * Action Input: attribute name * 6815 // Action Result: Will remove the attribute (as a facet) from the request if it 6816 // is present. Example: Suppose the query is "shoes", the Condition.query_terms 6817 // is "shoes" and the attribute name "size", then facet key "size" will be 6818 // removed from the request (if it is present). 6819 type GoogleCloudRetailV2betaRuleRemoveFacetAction struct { 6820 // AttributeNames: The attribute names (i.e. facet keys) to remove from the 6821 // dynamic facets (if present in the request). There can't be more 3 attribute 6822 // names. Each attribute name should be a valid attribute name, be non-empty 6823 // and contain at most 80 characters. 6824 AttributeNames []string `json:"attributeNames,omitempty"` 6825 // ForceSendFields is a list of field names (e.g. "AttributeNames") to 6826 // unconditionally include in API requests. By default, fields with empty or 6827 // default values are omitted from API requests. See 6828 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6829 // details. 6830 ForceSendFields []string `json:"-"` 6831 // NullFields is a list of field names (e.g. "AttributeNames") to include in 6832 // API requests with the JSON null value. By default, fields with empty values 6833 // are omitted from API requests. See 6834 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6835 NullFields []string `json:"-"` 6836 } 6837 6838 func (s *GoogleCloudRetailV2betaRuleRemoveFacetAction) MarshalJSON() ([]byte, error) { 6839 type NoMethod GoogleCloudRetailV2betaRuleRemoveFacetAction 6840 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6841 } 6842 6843 // GoogleCloudRetailV2betaRuleReplacementAction: Replaces a term in the query. 6844 // Multiple replacement candidates can be specified. All `query_terms` will be 6845 // replaced with the replacement term. Example: Replace "gShoe" with "google 6846 // shoe". 6847 type GoogleCloudRetailV2betaRuleReplacementAction struct { 6848 // QueryTerms: Terms from the search query. Will be replaced by replacement 6849 // term. Can specify up to 100 terms. 6850 QueryTerms []string `json:"queryTerms,omitempty"` 6851 // ReplacementTerm: Term that will be used for replacement. 6852 ReplacementTerm string `json:"replacementTerm,omitempty"` 6853 // Term: Will be [deprecated = true] post migration; 6854 Term string `json:"term,omitempty"` 6855 // ForceSendFields is a list of field names (e.g. "QueryTerms") to 6856 // unconditionally include in API requests. By default, fields with empty or 6857 // default values are omitted from API requests. See 6858 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6859 // details. 6860 ForceSendFields []string `json:"-"` 6861 // NullFields is a list of field names (e.g. "QueryTerms") to include in API 6862 // requests with the JSON null value. By default, fields with empty values are 6863 // omitted from API requests. See 6864 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6865 NullFields []string `json:"-"` 6866 } 6867 6868 func (s *GoogleCloudRetailV2betaRuleReplacementAction) MarshalJSON() ([]byte, error) { 6869 type NoMethod GoogleCloudRetailV2betaRuleReplacementAction 6870 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6871 } 6872 6873 // GoogleCloudRetailV2betaRuleTwowaySynonymsAction: Creates a set of terms that 6874 // will be treated as synonyms of each other. Example: synonyms of "sneakers" 6875 // and "shoes": * "sneakers" will use a synonym of "shoes". * "shoes" will use 6876 // a synonym of "sneakers". 6877 type GoogleCloudRetailV2betaRuleTwowaySynonymsAction struct { 6878 // Synonyms: Defines a set of synonyms. Can specify up to 100 synonyms. Must 6879 // specify at least 2 synonyms. 6880 Synonyms []string `json:"synonyms,omitempty"` 6881 // ForceSendFields is a list of field names (e.g. "Synonyms") to 6882 // unconditionally include in API requests. By default, fields with empty or 6883 // default values are omitted from API requests. See 6884 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6885 // details. 6886 ForceSendFields []string `json:"-"` 6887 // NullFields is a list of field names (e.g. "Synonyms") to include in API 6888 // requests with the JSON null value. By default, fields with empty values are 6889 // omitted from API requests. See 6890 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6891 NullFields []string `json:"-"` 6892 } 6893 6894 func (s *GoogleCloudRetailV2betaRuleTwowaySynonymsAction) MarshalJSON() ([]byte, error) { 6895 type NoMethod GoogleCloudRetailV2betaRuleTwowaySynonymsAction 6896 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6897 } 6898 6899 // GoogleCloudRetailV2betaSearchRequest: Request message for 6900 // SearchService.Search method. 6901 type GoogleCloudRetailV2betaSearchRequest struct { 6902 // BoostSpec: Boost specification to boost certain products. For more 6903 // information, see Boost results 6904 // (https://cloud.google.com/retail/docs/boosting). Notice that if both 6905 // ServingConfig.boost_control_ids and SearchRequest.boost_spec are set, the 6906 // boost conditions from both places are evaluated. If a search request matches 6907 // multiple boost conditions, the final boost score is equal to the sum of the 6908 // boost scores from all matched boost conditions. 6909 BoostSpec *GoogleCloudRetailV2betaSearchRequestBoostSpec `json:"boostSpec,omitempty"` 6910 // Branch: The branch resource name, such as 6911 // `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use 6912 // "default_branch" as the branch ID or leave this field empty, to search 6913 // products under the default branch. 6914 Branch string `json:"branch,omitempty"` 6915 // CanonicalFilter: The default filter that is applied when a user performs a 6916 // search without checking any filters on the search page. The filter applied 6917 // to every search request when quality improvement such as query expansion is 6918 // needed. In the case a query does not have a sufficient amount of results 6919 // this filter will be used to determine whether or not to enable the query 6920 // expansion flow. The original filter will still be used for the query 6921 // expanded search. This field is strongly recommended to achieve high search 6922 // quality. For more information about filter syntax, see SearchRequest.filter. 6923 CanonicalFilter string `json:"canonicalFilter,omitempty"` 6924 // DynamicFacetSpec: Deprecated. Refer to 6925 // https://cloud.google.com/retail/docs/configs#dynamic to enable dynamic 6926 // facets. Do not set this field. The specification for dynamically generated 6927 // facets. Notice that only textual facets can be dynamically generated. 6928 DynamicFacetSpec *GoogleCloudRetailV2betaSearchRequestDynamicFacetSpec `json:"dynamicFacetSpec,omitempty"` 6929 // Entity: The entity for customers that may run multiple different entities, 6930 // domains, sites or regions, for example, `Google US`, `Google Ads`, `Waymo`, 6931 // `google.com`, `youtube.com`, etc. If this is set, it should be exactly 6932 // matched with UserEvent.entity to get search results boosted by entity. 6933 Entity string `json:"entity,omitempty"` 6934 // FacetSpecs: Facet specifications for faceted search. If empty, no facets are 6935 // returned. A maximum of 200 values are allowed. Otherwise, an 6936 // INVALID_ARGUMENT error is returned. 6937 FacetSpecs []*GoogleCloudRetailV2betaSearchRequestFacetSpec `json:"facetSpecs,omitempty"` 6938 // Filter: The filter syntax consists of an expression language for 6939 // constructing a predicate from one or more fields of the products being 6940 // filtered. Filter expression is case-sensitive. For more information, see 6941 // Filter (https://cloud.google.com/retail/docs/filter-and-order#filter). If 6942 // this field is unrecognizable, an INVALID_ARGUMENT is returned. 6943 Filter string `json:"filter,omitempty"` 6944 // Labels: The labels applied to a resource must meet the following 6945 // requirements: * Each resource can have multiple labels, up to a maximum of 6946 // 64. * Each label must be a key-value pair. * Keys have a minimum length of 1 6947 // character and a maximum length of 63 characters and cannot be empty. Values 6948 // can be empty and have a maximum length of 63 characters. * Keys and values 6949 // can contain only lowercase letters, numeric characters, underscores, and 6950 // dashes. All characters must use UTF-8 encoding, and international characters 6951 // are allowed. * The key portion of a label must be unique. However, you can 6952 // use the same key with multiple resources. * Keys must start with a lowercase 6953 // letter or international character. For more information, see Requirements 6954 // for labels 6955 // (https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) 6956 // in the Resource Manager documentation. 6957 Labels map[string]string `json:"labels,omitempty"` 6958 // Offset: A 0-indexed integer that specifies the current offset (that is, 6959 // starting result location, amongst the Products deemed by the API as 6960 // relevant) in search results. This field is only considered if page_token is 6961 // unset. If this field is negative, an INVALID_ARGUMENT is returned. 6962 Offset int64 `json:"offset,omitempty"` 6963 // OrderBy: The order in which products are returned. Products can be ordered 6964 // by a field in an Product object. Leave it unset if ordered by relevance. 6965 // OrderBy expression is case-sensitive. For more information, see Order 6966 // (https://cloud.google.com/retail/docs/filter-and-order#order). If this field 6967 // is unrecognizable, an INVALID_ARGUMENT is returned. 6968 OrderBy string `json:"orderBy,omitempty"` 6969 // PageCategories: The categories associated with a category page. Must be set 6970 // for category navigation queries to achieve good search quality. The format 6971 // should be the same as UserEvent.page_categories; To represent full path of 6972 // category, use '>' sign to separate different hierarchies. If '>' is part of 6973 // the category name, replace it with other character(s). Category pages 6974 // include special pages such as sales or promotions. For instance, a special 6975 // sale page may have the category hierarchy: "pageCategories" : ["Sales > 2017 6976 // Black Friday Deals"]. 6977 PageCategories []string `json:"pageCategories,omitempty"` 6978 // PageSize: Maximum number of Products to return. If unspecified, defaults to 6979 // a reasonable value. The maximum allowed value is 120. Values above 120 will 6980 // be coerced to 120. If this field is negative, an INVALID_ARGUMENT is 6981 // returned. 6982 PageSize int64 `json:"pageSize,omitempty"` 6983 // PageToken: A page token SearchResponse.next_page_token, received from a 6984 // previous SearchService.Search call. Provide this to retrieve the subsequent 6985 // page. When paginating, all other parameters provided to SearchService.Search 6986 // must match the call that provided the page token. Otherwise, an 6987 // INVALID_ARGUMENT error is returned. 6988 PageToken string `json:"pageToken,omitempty"` 6989 // PersonalizationSpec: The specification for personalization. Notice that if 6990 // both ServingConfig.personalization_spec and 6991 // SearchRequest.personalization_spec are set. 6992 // SearchRequest.personalization_spec will override 6993 // ServingConfig.personalization_spec. 6994 PersonalizationSpec *GoogleCloudRetailV2betaSearchRequestPersonalizationSpec `json:"personalizationSpec,omitempty"` 6995 // Query: Raw search query. If this field is empty, the request is considered a 6996 // category browsing request and returned results are based on filter and 6997 // page_categories. 6998 Query string `json:"query,omitempty"` 6999 // QueryExpansionSpec: The query expansion specification that specifies the 7000 // conditions under which query expansion occurs. For more information, see 7001 // Query expansion 7002 // (https://cloud.google.com/retail/docs/result-size#query_expansion). 7003 QueryExpansionSpec *GoogleCloudRetailV2betaSearchRequestQueryExpansionSpec `json:"queryExpansionSpec,omitempty"` 7004 // SearchMode: The search mode of the search request. If not specified, a 7005 // single search request triggers both product search and faceted search. 7006 // 7007 // Possible values: 7008 // "SEARCH_MODE_UNSPECIFIED" - Default value. In this case both product 7009 // search and faceted search will be performed. Both 7010 // SearchResponse.SearchResult and SearchResponse.Facet will be returned. 7011 // "PRODUCT_SEARCH_ONLY" - Only product search will be performed. The faceted 7012 // search will be disabled. Only SearchResponse.SearchResult will be returned. 7013 // SearchResponse.Facet will not be returned, even if SearchRequest.facet_specs 7014 // or SearchRequest.dynamic_facet_spec is set. 7015 // "FACETED_SEARCH_ONLY" - Only faceted search will be performed. The product 7016 // search will be disabled. When in this mode, one or both of 7017 // SearchRequest.facet_specs and SearchRequest.dynamic_facet_spec should be 7018 // set. Otherwise, an INVALID_ARGUMENT error is returned. Only 7019 // SearchResponse.Facet will be returned. SearchResponse.SearchResult will not 7020 // be returned. 7021 SearchMode string `json:"searchMode,omitempty"` 7022 // SpellCorrectionSpec: The spell correction specification that specifies the 7023 // mode under which spell correction will take effect. 7024 SpellCorrectionSpec *GoogleCloudRetailV2betaSearchRequestSpellCorrectionSpec `json:"spellCorrectionSpec,omitempty"` 7025 // UserInfo: User information. 7026 UserInfo *GoogleCloudRetailV2betaUserInfo `json:"userInfo,omitempty"` 7027 // VariantRollupKeys: The keys to fetch and rollup the matching variant 7028 // Products attributes, FulfillmentInfo or LocalInventorys attributes. The 7029 // attributes from all the matching variant Products or LocalInventorys are 7030 // merged and de-duplicated. Notice that rollup attributes will lead to extra 7031 // query latency. Maximum number of keys is 30. For FulfillmentInfo, a 7032 // fulfillment type and a fulfillment ID must be provided in the format of 7033 // "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123", 7034 // "pickupInStore" is fulfillment type and "store123" is the store ID. 7035 // Supported keys are: * colorFamilies * price * originalPrice * discount * 7036 // variantId * inventory(place_id,price) * inventory(place_id,original_price) * 7037 // inventory(place_id,attributes.key), where key is any key in the 7038 // Product.local_inventories.attributes map. * attributes.key, where key is any 7039 // key in the Product.attributes map. * pickupInStore.id, where id is any 7040 // FulfillmentInfo.place_ids for FulfillmentInfo.type "pickup-in-store". * 7041 // shipToStore.id, where id is any FulfillmentInfo.place_ids for 7042 // FulfillmentInfo.type "ship-to-store". * sameDayDelivery.id, where id is any 7043 // FulfillmentInfo.place_ids for FulfillmentInfo.type "same-day-delivery". * 7044 // nextDayDelivery.id, where id is any FulfillmentInfo.place_ids for 7045 // FulfillmentInfo.type "next-day-delivery". * customFulfillment1.id, where id 7046 // is any FulfillmentInfo.place_ids for FulfillmentInfo.type "custom-type-1". * 7047 // customFulfillment2.id, where id is any FulfillmentInfo.place_ids for 7048 // FulfillmentInfo.type "custom-type-2". * customFulfillment3.id, where id is 7049 // any FulfillmentInfo.place_ids for FulfillmentInfo.type "custom-type-3". * 7050 // customFulfillment4.id, where id is any FulfillmentInfo.place_ids for 7051 // FulfillmentInfo.type "custom-type-4". * customFulfillment5.id, where id is 7052 // any FulfillmentInfo.place_ids for FulfillmentInfo.type "custom-type-5". If 7053 // this field is set to an invalid value other than these, an INVALID_ARGUMENT 7054 // error is returned. 7055 VariantRollupKeys []string `json:"variantRollupKeys,omitempty"` 7056 // VisitorId: Required. A unique identifier for tracking visitors. For example, 7057 // this could be implemented with an HTTP cookie, which should be able to 7058 // uniquely identify a visitor on a single device. This unique identifier 7059 // should not change if the visitor logs in or out of the website. This should 7060 // be the same identifier as UserEvent.visitor_id. The field must be a UTF-8 7061 // encoded string with a length limit of 128 characters. Otherwise, an 7062 // INVALID_ARGUMENT error is returned. 7063 VisitorId string `json:"visitorId,omitempty"` 7064 // ForceSendFields is a list of field names (e.g. "BoostSpec") to 7065 // unconditionally include in API requests. By default, fields with empty or 7066 // default values are omitted from API requests. See 7067 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7068 // details. 7069 ForceSendFields []string `json:"-"` 7070 // NullFields is a list of field names (e.g. "BoostSpec") to include in API 7071 // requests with the JSON null value. By default, fields with empty values are 7072 // omitted from API requests. See 7073 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7074 NullFields []string `json:"-"` 7075 } 7076 7077 func (s *GoogleCloudRetailV2betaSearchRequest) MarshalJSON() ([]byte, error) { 7078 type NoMethod GoogleCloudRetailV2betaSearchRequest 7079 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7080 } 7081 7082 // GoogleCloudRetailV2betaSearchRequestBoostSpec: Boost specification to boost 7083 // certain items. 7084 type GoogleCloudRetailV2betaSearchRequestBoostSpec struct { 7085 // ConditionBoostSpecs: Condition boost specifications. If a product matches 7086 // multiple conditions in the specifictions, boost scores from these 7087 // specifications are all applied and combined in a non-linear way. Maximum 7088 // number of specifications is 20. 7089 ConditionBoostSpecs []*GoogleCloudRetailV2betaSearchRequestBoostSpecConditionBoostSpec `json:"conditionBoostSpecs,omitempty"` 7090 // SkipBoostSpecValidation: Whether to skip boostspec validation. If this field 7091 // is set to true, invalid BoostSpec.condition_boost_specs will be ignored and 7092 // valid BoostSpec.condition_boost_specs will still be applied. 7093 SkipBoostSpecValidation bool `json:"skipBoostSpecValidation,omitempty"` 7094 // ForceSendFields is a list of field names (e.g. "ConditionBoostSpecs") to 7095 // unconditionally include in API requests. By default, fields with empty or 7096 // default values are omitted from API requests. See 7097 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7098 // details. 7099 ForceSendFields []string `json:"-"` 7100 // NullFields is a list of field names (e.g. "ConditionBoostSpecs") to include 7101 // in API requests with the JSON null value. By default, fields with empty 7102 // values are omitted from API requests. See 7103 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7104 NullFields []string `json:"-"` 7105 } 7106 7107 func (s *GoogleCloudRetailV2betaSearchRequestBoostSpec) MarshalJSON() ([]byte, error) { 7108 type NoMethod GoogleCloudRetailV2betaSearchRequestBoostSpec 7109 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7110 } 7111 7112 // GoogleCloudRetailV2betaSearchRequestBoostSpecConditionBoostSpec: Boost 7113 // applies to products which match a condition. 7114 type GoogleCloudRetailV2betaSearchRequestBoostSpecConditionBoostSpec struct { 7115 // Boost: Strength of the condition boost, which should be in [-1, 1]. Negative 7116 // boost means demotion. Default is 0.0. Setting to 1.0 gives the item a big 7117 // promotion. However, it does not necessarily mean that the boosted item will 7118 // be the top result at all times, nor that other items will be excluded. 7119 // Results could still be shown even when none of them matches the condition. 7120 // And results that are significantly more relevant to the search query can 7121 // still trump your heavily favored but irrelevant items. Setting to -1.0 gives 7122 // the item a big demotion. However, results that are deeply relevant might 7123 // still be shown. The item will have an upstream battle to get a fairly high 7124 // ranking, but it is not blocked out completely. Setting to 0.0 means no boost 7125 // applied. The boosting condition is ignored. 7126 Boost float64 `json:"boost,omitempty"` 7127 // Condition: An expression which specifies a boost condition. The syntax and 7128 // supported fields are the same as a filter expression. See 7129 // SearchRequest.filter for detail syntax and limitations. Examples: * To boost 7130 // products with product ID "product_1" or "product_2", and color "Red" or 7131 // "Blue": * (id: ANY("product_1", "product_2")) AND (colorFamilies: 7132 // ANY("Red","Blue")) 7133 Condition string `json:"condition,omitempty"` 7134 // ForceSendFields is a list of field names (e.g. "Boost") to unconditionally 7135 // include in API requests. By default, fields with empty or default values are 7136 // omitted from API requests. See 7137 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7138 // details. 7139 ForceSendFields []string `json:"-"` 7140 // NullFields is a list of field names (e.g. "Boost") to include in API 7141 // requests with the JSON null value. By default, fields with empty values are 7142 // omitted from API requests. See 7143 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7144 NullFields []string `json:"-"` 7145 } 7146 7147 func (s *GoogleCloudRetailV2betaSearchRequestBoostSpecConditionBoostSpec) MarshalJSON() ([]byte, error) { 7148 type NoMethod GoogleCloudRetailV2betaSearchRequestBoostSpecConditionBoostSpec 7149 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7150 } 7151 7152 func (s *GoogleCloudRetailV2betaSearchRequestBoostSpecConditionBoostSpec) UnmarshalJSON(data []byte) error { 7153 type NoMethod GoogleCloudRetailV2betaSearchRequestBoostSpecConditionBoostSpec 7154 var s1 struct { 7155 Boost gensupport.JSONFloat64 `json:"boost"` 7156 *NoMethod 7157 } 7158 s1.NoMethod = (*NoMethod)(s) 7159 if err := json.Unmarshal(data, &s1); err != nil { 7160 return err 7161 } 7162 s.Boost = float64(s1.Boost) 7163 return nil 7164 } 7165 7166 // GoogleCloudRetailV2betaSearchRequestDynamicFacetSpec: The specifications of 7167 // dynamically generated facets. 7168 type GoogleCloudRetailV2betaSearchRequestDynamicFacetSpec struct { 7169 // Mode: Mode of the DynamicFacet feature. Defaults to Mode.DISABLED if it's 7170 // unset. 7171 // 7172 // Possible values: 7173 // "MODE_UNSPECIFIED" - Default value. 7174 // "DISABLED" - Disable Dynamic Facet. 7175 // "ENABLED" - Automatic mode built by Google Retail Search. 7176 Mode string `json:"mode,omitempty"` 7177 // ForceSendFields is a list of field names (e.g. "Mode") to unconditionally 7178 // include in API requests. By default, fields with empty or default values are 7179 // omitted from API requests. See 7180 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7181 // details. 7182 ForceSendFields []string `json:"-"` 7183 // NullFields is a list of field names (e.g. "Mode") to include in API requests 7184 // with the JSON null value. By default, fields with empty values are omitted 7185 // from API requests. See 7186 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7187 NullFields []string `json:"-"` 7188 } 7189 7190 func (s *GoogleCloudRetailV2betaSearchRequestDynamicFacetSpec) MarshalJSON() ([]byte, error) { 7191 type NoMethod GoogleCloudRetailV2betaSearchRequestDynamicFacetSpec 7192 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7193 } 7194 7195 // GoogleCloudRetailV2betaSearchRequestFacetSpec: A facet specification to 7196 // perform faceted search. 7197 type GoogleCloudRetailV2betaSearchRequestFacetSpec struct { 7198 // EnableDynamicPosition: Enables dynamic position for this facet. If set to 7199 // true, the position of this facet among all facets in the response is 7200 // determined by Google Retail Search. It is ordered together with dynamic 7201 // facets if dynamic facets is enabled. If set to false, the position of this 7202 // facet in the response is the same as in the request, and it is ranked before 7203 // the facets with dynamic position enable and all dynamic facets. For example, 7204 // you may always want to have rating facet returned in the response, but it's 7205 // not necessarily to always display the rating facet at the top. In that case, 7206 // you can set enable_dynamic_position to true so that the position of rating 7207 // facet in response is determined by Google Retail Search. Another example, 7208 // assuming you have the following facets in the request: * "rating", 7209 // enable_dynamic_position = true * "price", enable_dynamic_position = false * 7210 // "brands", enable_dynamic_position = false And also you have a dynamic facets 7211 // enable, which generates a facet "gender". Then, the final order of the 7212 // facets in the response can be ("price", "brands", "rating", "gender") or 7213 // ("price", "brands", "gender", "rating") depends on how Google Retail Search 7214 // orders "gender" and "rating" facets. However, notice that "price" and 7215 // "brands" are always ranked at first and second position because their 7216 // enable_dynamic_position values are false. 7217 EnableDynamicPosition bool `json:"enableDynamicPosition,omitempty"` 7218 // ExcludedFilterKeys: List of keys to exclude when faceting. By default, 7219 // FacetKey.key is not excluded from the filter unless it is listed in this 7220 // field. Listing a facet key in this field allows its values to appear as 7221 // facet results, even when they are filtered out of search results. Using this 7222 // field does not affect what search results are returned. For example, suppose 7223 // there are 100 products with the color facet "Red" and 200 products with the 7224 // color facet "Blue". A query containing the filter "colorFamilies:ANY("Red")" 7225 // and having "colorFamilies" as FacetKey.key would by default return only 7226 // "Red" products in the search results, and also return "Red" with count 100 7227 // as the only color facet. Although there are also blue products available, 7228 // "Blue" would not be shown as an available facet value. If "colorFamilies" is 7229 // listed in "excludedFilterKeys", then the query returns the facet values 7230 // "Red" with count 100 and "Blue" with count 200, because the "colorFamilies" 7231 // key is now excluded from the filter. Because this field doesn't affect 7232 // search results, the search results are still correctly filtered to return 7233 // only "Red" products. A maximum of 100 values are allowed. Otherwise, an 7234 // INVALID_ARGUMENT error is returned. 7235 ExcludedFilterKeys []string `json:"excludedFilterKeys,omitempty"` 7236 // FacetKey: Required. The facet key specification. 7237 FacetKey *GoogleCloudRetailV2betaSearchRequestFacetSpecFacetKey `json:"facetKey,omitempty"` 7238 // Limit: Maximum of facet values that should be returned for this facet. If 7239 // unspecified, defaults to 50. The maximum allowed value is 300. Values above 7240 // 300 will be coerced to 300. If this field is negative, an INVALID_ARGUMENT 7241 // is returned. 7242 Limit int64 `json:"limit,omitempty"` 7243 // ForceSendFields is a list of field names (e.g. "EnableDynamicPosition") to 7244 // unconditionally include in API requests. By default, fields with empty or 7245 // default values are omitted from API requests. See 7246 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7247 // details. 7248 ForceSendFields []string `json:"-"` 7249 // NullFields is a list of field names (e.g. "EnableDynamicPosition") to 7250 // include in API requests with the JSON null value. By default, fields with 7251 // empty values are omitted from API requests. See 7252 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7253 NullFields []string `json:"-"` 7254 } 7255 7256 func (s *GoogleCloudRetailV2betaSearchRequestFacetSpec) MarshalJSON() ([]byte, error) { 7257 type NoMethod GoogleCloudRetailV2betaSearchRequestFacetSpec 7258 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7259 } 7260 7261 // GoogleCloudRetailV2betaSearchRequestFacetSpecFacetKey: Specifies how a facet 7262 // is computed. 7263 type GoogleCloudRetailV2betaSearchRequestFacetSpecFacetKey struct { 7264 // CaseInsensitive: True to make facet keys case insensitive when getting 7265 // faceting values with prefixes or contains; false otherwise. 7266 CaseInsensitive bool `json:"caseInsensitive,omitempty"` 7267 // Contains: Only get facet values that contains the given strings. For 7268 // example, suppose "categories" has three values "Women > Shoe", "Women > 7269 // Dress" and "Men > Shoe". If set "contains" to "Shoe", the "categories" facet 7270 // gives only "Women > Shoe" and "Men > Shoe". Only supported on textual 7271 // fields. Maximum is 10. 7272 Contains []string `json:"contains,omitempty"` 7273 // Intervals: Set only if values should be bucketized into intervals. Must be 7274 // set for facets with numerical values. Must not be set for facet with text 7275 // values. Maximum number of intervals is 40. For all numerical facet keys that 7276 // appear in the list of products from the catalog, the percentiles 0, 10, 30, 7277 // 50, 70, 90, and 100 are computed from their distribution weekly. If the 7278 // model assigns a high score to a numerical facet key and its intervals are 7279 // not specified in the search request, these percentiles become the bounds for 7280 // its intervals and are returned in the response. If the facet key intervals 7281 // are specified in the request, then the specified intervals are returned 7282 // instead. 7283 Intervals []*GoogleCloudRetailV2betaInterval `json:"intervals,omitempty"` 7284 // Key: Required. Supported textual and numerical facet keys in Product object, 7285 // over which the facet values are computed. Facet key is case-sensitive. 7286 // Allowed facet keys when FacetKey.query is not specified: * textual_field = * 7287 // "brands" * "categories" * "genders" * "ageGroups" * "availability" * 7288 // "colorFamilies" * "colors" * "sizes" * "materials" * "patterns" * 7289 // "conditions" * "attributes.key" * "pickupInStore" * "shipToStore" * 7290 // "sameDayDelivery" * "nextDayDelivery" * "customFulfillment1" * 7291 // "customFulfillment2" * "customFulfillment3" * "customFulfillment4" * 7292 // "customFulfillment5" * "inventory(place_id,attributes.key)" * 7293 // numerical_field = * "price" * "discount" * "rating" * "ratingCount" * 7294 // "attributes.key" * "inventory(place_id,price)" * 7295 // "inventory(place_id,original_price)" * "inventory(place_id,attributes.key)" 7296 Key string `json:"key,omitempty"` 7297 // OrderBy: The order in which SearchResponse.Facet.values are returned. 7298 // Allowed values are: * "count desc", which means order by 7299 // SearchResponse.Facet.values.count descending. * "value desc", which means 7300 // order by SearchResponse.Facet.values.value descending. Only applies to 7301 // textual facets. If not set, textual values are sorted in natural order 7302 // (https://en.wikipedia.org/wiki/Natural_sort_order); numerical intervals are 7303 // sorted in the order given by FacetSpec.FacetKey.intervals; 7304 // FulfillmentInfo.place_ids are sorted in the order given by 7305 // FacetSpec.FacetKey.restricted_values. 7306 OrderBy string `json:"orderBy,omitempty"` 7307 // Prefixes: Only get facet values that start with the given string prefix. For 7308 // example, suppose "categories" has three values "Women > Shoe", "Women > 7309 // Dress" and "Men > Shoe". If set "prefixes" to "Women", the "categories" 7310 // facet gives only "Women > Shoe" and "Women > Dress". Only supported on 7311 // textual fields. Maximum is 10. 7312 Prefixes []string `json:"prefixes,omitempty"` 7313 // Query: The query that is used to compute facet for the given facet key. When 7314 // provided, it overrides the default behavior of facet computation. The query 7315 // syntax is the same as a filter expression. See SearchRequest.filter for 7316 // detail syntax and limitations. Notice that there is no limitation on 7317 // FacetKey.key when query is specified. In the response, 7318 // SearchResponse.Facet.values.value is always "1" and 7319 // SearchResponse.Facet.values.count is the number of results that match the 7320 // query. For example, you can set a customized facet for "shipToStore", where 7321 // FacetKey.key is "customizedShipToStore", and FacetKey.query is 7322 // "availability: ANY(\"IN_STOCK\") AND shipToStore: ANY(\"123\")". Then the 7323 // facet counts the products that are both in stock and ship to store "123". 7324 Query string `json:"query,omitempty"` 7325 // RestrictedValues: Only get facet for the given restricted values. For 7326 // example, when using "pickupInStore" as key and set restricted values to 7327 // ["store123", "store456"], only facets for "store123" and "store456" are 7328 // returned. Only supported on predefined textual fields, custom textual 7329 // attributes and fulfillments. Maximum is 20. Must be set for the fulfillment 7330 // facet keys: * pickupInStore * shipToStore * sameDayDelivery * 7331 // nextDayDelivery * customFulfillment1 * customFulfillment2 * 7332 // customFulfillment3 * customFulfillment4 * customFulfillment5 7333 RestrictedValues []string `json:"restrictedValues,omitempty"` 7334 // ReturnMinMax: Returns the min and max value for each numerical facet 7335 // intervals. Ignored for textual facets. 7336 ReturnMinMax bool `json:"returnMinMax,omitempty"` 7337 // ForceSendFields is a list of field names (e.g. "CaseInsensitive") to 7338 // unconditionally include in API requests. By default, fields with empty or 7339 // default values are omitted from API requests. See 7340 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7341 // details. 7342 ForceSendFields []string `json:"-"` 7343 // NullFields is a list of field names (e.g. "CaseInsensitive") to include in 7344 // API requests with the JSON null value. By default, fields with empty values 7345 // are omitted from API requests. See 7346 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7347 NullFields []string `json:"-"` 7348 } 7349 7350 func (s *GoogleCloudRetailV2betaSearchRequestFacetSpecFacetKey) MarshalJSON() ([]byte, error) { 7351 type NoMethod GoogleCloudRetailV2betaSearchRequestFacetSpecFacetKey 7352 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7353 } 7354 7355 // GoogleCloudRetailV2betaSearchRequestPersonalizationSpec: The specification 7356 // for personalization. 7357 type GoogleCloudRetailV2betaSearchRequestPersonalizationSpec struct { 7358 // Mode: Defaults to Mode.AUTO. 7359 // 7360 // Possible values: 7361 // "MODE_UNSPECIFIED" - Default value. In this case, server behavior defaults 7362 // to Mode.AUTO. 7363 // "AUTO" - Let CRS decide whether to use personalization based on quality of 7364 // user event data. 7365 // "DISABLED" - Disable personalization. 7366 Mode string `json:"mode,omitempty"` 7367 // ForceSendFields is a list of field names (e.g. "Mode") to unconditionally 7368 // include in API requests. By default, fields with empty or default values are 7369 // omitted from API requests. See 7370 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7371 // details. 7372 ForceSendFields []string `json:"-"` 7373 // NullFields is a list of field names (e.g. "Mode") to include in API requests 7374 // with the JSON null value. By default, fields with empty values are omitted 7375 // from API requests. See 7376 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7377 NullFields []string `json:"-"` 7378 } 7379 7380 func (s *GoogleCloudRetailV2betaSearchRequestPersonalizationSpec) MarshalJSON() ([]byte, error) { 7381 type NoMethod GoogleCloudRetailV2betaSearchRequestPersonalizationSpec 7382 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7383 } 7384 7385 // GoogleCloudRetailV2betaSearchRequestQueryExpansionSpec: Specification to 7386 // determine under which conditions query expansion should occur. 7387 type GoogleCloudRetailV2betaSearchRequestQueryExpansionSpec struct { 7388 // Condition: The condition under which query expansion should occur. Default 7389 // to Condition.DISABLED. 7390 // 7391 // Possible values: 7392 // "CONDITION_UNSPECIFIED" - Unspecified query expansion condition. In this 7393 // case, server behavior defaults to Condition.DISABLED. 7394 // "DISABLED" - Disabled query expansion. Only the exact search query is 7395 // used, even if SearchResponse.total_size is zero. 7396 // "AUTO" - Automatic query expansion built by Google Retail Search. 7397 Condition string `json:"condition,omitempty"` 7398 // PinUnexpandedResults: Whether to pin unexpanded results. If this field is 7399 // set to true, unexpanded products are always at the top of the search 7400 // results, followed by the expanded results. 7401 PinUnexpandedResults bool `json:"pinUnexpandedResults,omitempty"` 7402 // ForceSendFields is a list of field names (e.g. "Condition") to 7403 // unconditionally include in API requests. By default, fields with empty or 7404 // default values are omitted from API requests. See 7405 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7406 // details. 7407 ForceSendFields []string `json:"-"` 7408 // NullFields is a list of field names (e.g. "Condition") to include in API 7409 // requests with the JSON null value. By default, fields with empty values are 7410 // omitted from API requests. See 7411 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7412 NullFields []string `json:"-"` 7413 } 7414 7415 func (s *GoogleCloudRetailV2betaSearchRequestQueryExpansionSpec) MarshalJSON() ([]byte, error) { 7416 type NoMethod GoogleCloudRetailV2betaSearchRequestQueryExpansionSpec 7417 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7418 } 7419 7420 // GoogleCloudRetailV2betaSearchRequestSpellCorrectionSpec: The specification 7421 // for query spell correction. 7422 type GoogleCloudRetailV2betaSearchRequestSpellCorrectionSpec struct { 7423 // Mode: The mode under which spell correction should take effect to replace 7424 // the original search query. Default to Mode.AUTO. 7425 // 7426 // Possible values: 7427 // "MODE_UNSPECIFIED" - Unspecified spell correction mode. In this case, 7428 // server behavior defaults to Mode.AUTO. 7429 // "SUGGESTION_ONLY" - Google Retail Search will try to find a spell 7430 // suggestion if there is any and put in the SearchResponse.corrected_query. 7431 // The spell suggestion will not be used as the search query. 7432 // "AUTO" - Automatic spell correction built by Google Retail Search. Search 7433 // will be based on the corrected query if found. 7434 Mode string `json:"mode,omitempty"` 7435 // ForceSendFields is a list of field names (e.g. "Mode") to unconditionally 7436 // include in API requests. By default, fields with empty or default values are 7437 // omitted from API requests. See 7438 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7439 // details. 7440 ForceSendFields []string `json:"-"` 7441 // NullFields is a list of field names (e.g. "Mode") to include in API requests 7442 // with the JSON null value. By default, fields with empty values are omitted 7443 // from API requests. See 7444 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7445 NullFields []string `json:"-"` 7446 } 7447 7448 func (s *GoogleCloudRetailV2betaSearchRequestSpellCorrectionSpec) MarshalJSON() ([]byte, error) { 7449 type NoMethod GoogleCloudRetailV2betaSearchRequestSpellCorrectionSpec 7450 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7451 } 7452 7453 // GoogleCloudRetailV2betaSearchResponse: Response message for 7454 // SearchService.Search method. 7455 type GoogleCloudRetailV2betaSearchResponse struct { 7456 // AppliedControls: The fully qualified resource name of applied controls 7457 // (https://cloud.google.com/retail/docs/serving-control-rules). 7458 AppliedControls []string `json:"appliedControls,omitempty"` 7459 // AttributionToken: A unique search token. This should be included in the 7460 // UserEvent logs resulting from this search, which enables accurate 7461 // attribution of search model performance. 7462 AttributionToken string `json:"attributionToken,omitempty"` 7463 // CorrectedQuery: Contains the spell corrected query, if found. If the spell 7464 // correction type is AUTOMATIC, then the search results are based on 7465 // corrected_query. Otherwise the original query is used for search. 7466 CorrectedQuery string `json:"correctedQuery,omitempty"` 7467 // ExperimentInfo: Metadata related to A/B testing Experiment associated with 7468 // this response. Only exists when an experiment is triggered. 7469 ExperimentInfo []*GoogleCloudRetailV2betaExperimentInfo `json:"experimentInfo,omitempty"` 7470 // Facets: Results of facets requested by user. 7471 Facets []*GoogleCloudRetailV2betaSearchResponseFacet `json:"facets,omitempty"` 7472 // InvalidConditionBoostSpecs: The invalid 7473 // SearchRequest.BoostSpec.condition_boost_specs that are not applied during 7474 // serving. 7475 InvalidConditionBoostSpecs []*GoogleCloudRetailV2betaSearchRequestBoostSpecConditionBoostSpec `json:"invalidConditionBoostSpecs,omitempty"` 7476 // NextPageToken: A token that can be sent as SearchRequest.page_token to 7477 // retrieve the next page. If this field is omitted, there are no subsequent 7478 // pages. 7479 NextPageToken string `json:"nextPageToken,omitempty"` 7480 // QueryExpansionInfo: Query expansion information for the returned results. 7481 QueryExpansionInfo *GoogleCloudRetailV2betaSearchResponseQueryExpansionInfo `json:"queryExpansionInfo,omitempty"` 7482 // RedirectUri: The URI of a customer-defined redirect page. If redirect action 7483 // is triggered, no search is performed, and only redirect_uri and 7484 // attribution_token are set in the response. 7485 RedirectUri string `json:"redirectUri,omitempty"` 7486 // Results: A list of matched items. The order represents the ranking. 7487 Results []*GoogleCloudRetailV2betaSearchResponseSearchResult `json:"results,omitempty"` 7488 // TotalSize: The estimated total count of matched items irrespective of 7489 // pagination. The count of results returned by pagination may be less than the 7490 // total_size that matches. 7491 TotalSize int64 `json:"totalSize,omitempty"` 7492 7493 // ServerResponse contains the HTTP response code and headers from the server. 7494 googleapi.ServerResponse `json:"-"` 7495 // ForceSendFields is a list of field names (e.g. "AppliedControls") to 7496 // unconditionally include in API requests. By default, fields with empty or 7497 // default values are omitted from API requests. See 7498 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7499 // details. 7500 ForceSendFields []string `json:"-"` 7501 // NullFields is a list of field names (e.g. "AppliedControls") to include in 7502 // API requests with the JSON null value. By default, fields with empty values 7503 // are omitted from API requests. See 7504 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7505 NullFields []string `json:"-"` 7506 } 7507 7508 func (s *GoogleCloudRetailV2betaSearchResponse) MarshalJSON() ([]byte, error) { 7509 type NoMethod GoogleCloudRetailV2betaSearchResponse 7510 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7511 } 7512 7513 // GoogleCloudRetailV2betaSearchResponseFacet: A facet result. 7514 type GoogleCloudRetailV2betaSearchResponseFacet struct { 7515 // DynamicFacet: Whether the facet is dynamically generated. 7516 DynamicFacet bool `json:"dynamicFacet,omitempty"` 7517 // Key: The key for this facet. E.g., "colorFamilies" or "price" or 7518 // "attributes.attr1". 7519 Key string `json:"key,omitempty"` 7520 // Values: The facet values for this field. 7521 Values []*GoogleCloudRetailV2betaSearchResponseFacetFacetValue `json:"values,omitempty"` 7522 // ForceSendFields is a list of field names (e.g. "DynamicFacet") to 7523 // unconditionally include in API requests. By default, fields with empty or 7524 // default values are omitted from API requests. See 7525 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7526 // details. 7527 ForceSendFields []string `json:"-"` 7528 // NullFields is a list of field names (e.g. "DynamicFacet") to include in API 7529 // requests with the JSON null value. By default, fields with empty values are 7530 // omitted from API requests. See 7531 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7532 NullFields []string `json:"-"` 7533 } 7534 7535 func (s *GoogleCloudRetailV2betaSearchResponseFacet) MarshalJSON() ([]byte, error) { 7536 type NoMethod GoogleCloudRetailV2betaSearchResponseFacet 7537 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7538 } 7539 7540 // GoogleCloudRetailV2betaSearchResponseFacetFacetValue: A facet value which 7541 // contains value names and their count. 7542 type GoogleCloudRetailV2betaSearchResponseFacetFacetValue struct { 7543 // Count: Number of items that have this facet value. 7544 Count int64 `json:"count,omitempty,string"` 7545 // Interval: Interval value for a facet, such as [10, 20) for facet "price". 7546 Interval *GoogleCloudRetailV2betaInterval `json:"interval,omitempty"` 7547 // MaxValue: The maximum value in the FacetValue.interval. Only supported on 7548 // numerical facets and returned if 7549 // SearchRequest.FacetSpec.FacetKey.return_min_max is true. 7550 MaxValue float64 `json:"maxValue,omitempty"` 7551 // MinValue: The minimum value in the FacetValue.interval. Only supported on 7552 // numerical facets and returned if 7553 // SearchRequest.FacetSpec.FacetKey.return_min_max is true. 7554 MinValue float64 `json:"minValue,omitempty"` 7555 // Value: Text value of a facet, such as "Black" for facet "colorFamilies". 7556 Value string `json:"value,omitempty"` 7557 // ForceSendFields is a list of field names (e.g. "Count") to unconditionally 7558 // include in API requests. By default, fields with empty or default values are 7559 // omitted from API requests. See 7560 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7561 // details. 7562 ForceSendFields []string `json:"-"` 7563 // NullFields is a list of field names (e.g. "Count") to include in API 7564 // requests with the JSON null value. By default, fields with empty values are 7565 // omitted from API requests. See 7566 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7567 NullFields []string `json:"-"` 7568 } 7569 7570 func (s *GoogleCloudRetailV2betaSearchResponseFacetFacetValue) MarshalJSON() ([]byte, error) { 7571 type NoMethod GoogleCloudRetailV2betaSearchResponseFacetFacetValue 7572 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7573 } 7574 7575 func (s *GoogleCloudRetailV2betaSearchResponseFacetFacetValue) UnmarshalJSON(data []byte) error { 7576 type NoMethod GoogleCloudRetailV2betaSearchResponseFacetFacetValue 7577 var s1 struct { 7578 MaxValue gensupport.JSONFloat64 `json:"maxValue"` 7579 MinValue gensupport.JSONFloat64 `json:"minValue"` 7580 *NoMethod 7581 } 7582 s1.NoMethod = (*NoMethod)(s) 7583 if err := json.Unmarshal(data, &s1); err != nil { 7584 return err 7585 } 7586 s.MaxValue = float64(s1.MaxValue) 7587 s.MinValue = float64(s1.MinValue) 7588 return nil 7589 } 7590 7591 // GoogleCloudRetailV2betaSearchResponseQueryExpansionInfo: Information 7592 // describing query expansion including whether expansion has occurred. 7593 type GoogleCloudRetailV2betaSearchResponseQueryExpansionInfo struct { 7594 // ExpandedQuery: Bool describing whether query expansion has occurred. 7595 ExpandedQuery bool `json:"expandedQuery,omitempty"` 7596 // PinnedResultCount: Number of pinned results. This field will only be set 7597 // when expansion happens and 7598 // SearchRequest.QueryExpansionSpec.pin_unexpanded_results is set to true. 7599 PinnedResultCount int64 `json:"pinnedResultCount,omitempty,string"` 7600 // ForceSendFields is a list of field names (e.g. "ExpandedQuery") to 7601 // unconditionally include in API requests. By default, fields with empty or 7602 // default values are omitted from API requests. See 7603 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7604 // details. 7605 ForceSendFields []string `json:"-"` 7606 // NullFields is a list of field names (e.g. "ExpandedQuery") to include in API 7607 // requests with the JSON null value. By default, fields with empty values are 7608 // omitted from API requests. See 7609 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7610 NullFields []string `json:"-"` 7611 } 7612 7613 func (s *GoogleCloudRetailV2betaSearchResponseQueryExpansionInfo) MarshalJSON() ([]byte, error) { 7614 type NoMethod GoogleCloudRetailV2betaSearchResponseQueryExpansionInfo 7615 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7616 } 7617 7618 // GoogleCloudRetailV2betaSearchResponseSearchResult: Represents the search 7619 // results. 7620 type GoogleCloudRetailV2betaSearchResponseSearchResult struct { 7621 // Id: Product.id of the searched Product. 7622 Id string `json:"id,omitempty"` 7623 // MatchingVariantCount: The count of matched variant Products. 7624 MatchingVariantCount int64 `json:"matchingVariantCount,omitempty"` 7625 // MatchingVariantFields: If a variant Product matches the search query, this 7626 // map indicates which Product fields are matched. The key is the Product.name, 7627 // the value is a field mask of the matched Product fields. If matched 7628 // attributes cannot be determined, this map will be empty. For example, a key 7629 // "sku1" with field mask "products.color_info" indicates there is a match 7630 // between "sku1" ColorInfo and the query. 7631 MatchingVariantFields map[string]string `json:"matchingVariantFields,omitempty"` 7632 // PersonalLabels: Specifies previous events related to this product for this 7633 // user based on UserEvent with same SearchRequest.visitor_id or 7634 // UserInfo.user_id. This is set only when 7635 // SearchRequest.PersonalizationSpec.mode is 7636 // SearchRequest.PersonalizationSpec.Mode.AUTO. Possible values: * `purchased`: 7637 // Indicates that this product has been purchased before. 7638 PersonalLabels []string `json:"personalLabels,omitempty"` 7639 // Product: The product data snippet in the search response. Only Product.name 7640 // is guaranteed to be populated. Product.variants contains the product 7641 // variants that match the search query. If there are multiple product variants 7642 // matching the query, top 5 most relevant product variants are returned and 7643 // ordered by relevancy. If relevancy can be deternmined, use 7644 // matching_variant_fields to look up matched product variants fields. If 7645 // relevancy cannot be determined, e.g. when searching "shoe" all products in a 7646 // shoe product can be a match, 5 product variants are returned but order is 7647 // meaningless. 7648 Product *GoogleCloudRetailV2betaProduct `json:"product,omitempty"` 7649 // VariantRollupValues: The rollup matching variant Product attributes. The key 7650 // is one of the SearchRequest.variant_rollup_keys. The values are the merged 7651 // and de-duplicated Product attributes. Notice that the rollup values are 7652 // respect filter. For example, when filtering by "colorFamilies:ANY(\"red\")" 7653 // and rollup "colorFamilies", only "red" is returned. For textual and 7654 // numerical attributes, the rollup values is a list of string or double values 7655 // with type google.protobuf.ListValue. For example, if there are two variants 7656 // with colors "red" and "blue", the rollup values are { key: "colorFamilies" 7657 // value { list_value { values { string_value: "red" } values { string_value: 7658 // "blue" } } } } For FulfillmentInfo, the rollup values is a double value with 7659 // type google.protobuf.Value. For example, `{key: "pickupInStore.store1" value 7660 // { number_value: 10 }}` means a there are 10 variants in this product are 7661 // available in the store "store1". 7662 VariantRollupValues googleapi.RawMessage `json:"variantRollupValues,omitempty"` 7663 // ForceSendFields is a list of field names (e.g. "Id") to unconditionally 7664 // include in API requests. By default, fields with empty or default values are 7665 // omitted from API requests. See 7666 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7667 // details. 7668 ForceSendFields []string `json:"-"` 7669 // NullFields is a list of field names (e.g. "Id") to include in API requests 7670 // with the JSON null value. By default, fields with empty values are omitted 7671 // from API requests. See 7672 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7673 NullFields []string `json:"-"` 7674 } 7675 7676 func (s *GoogleCloudRetailV2betaSearchResponseSearchResult) MarshalJSON() ([]byte, error) { 7677 type NoMethod GoogleCloudRetailV2betaSearchResponseSearchResult 7678 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7679 } 7680 7681 // GoogleCloudRetailV2betaServingConfig: Configures metadata that is used to 7682 // generate serving time results (e.g. search results or recommendation 7683 // predictions). 7684 type GoogleCloudRetailV2betaServingConfig struct { 7685 // BoostControlIds: Condition boost specifications. If a product matches 7686 // multiple conditions in the specifications, boost scores from these 7687 // specifications are all applied and combined in a non-linear way. Maximum 7688 // number of specifications is 100. Notice that if both 7689 // ServingConfig.boost_control_ids and SearchRequest.boost_spec are set, the 7690 // boost conditions from both places are evaluated. If a search request matches 7691 // multiple boost conditions, the final boost score is equal to the sum of the 7692 // boost scores from all matched boost conditions. Can only be set if 7693 // solution_types is SOLUTION_TYPE_SEARCH. 7694 BoostControlIds []string `json:"boostControlIds,omitempty"` 7695 // DisplayName: Required. The human readable serving config display name. Used 7696 // in Retail UI. This field must be a UTF-8 encoded string with a length limit 7697 // of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. 7698 DisplayName string `json:"displayName,omitempty"` 7699 // DiversityLevel: How much diversity to use in recommendation model results 7700 // e.g. `medium-diversity` or `high-diversity`. Currently supported values: * 7701 // `no-diversity` * `low-diversity` * `medium-diversity` * `high-diversity` * 7702 // `auto-diversity` If not specified, we choose default based on recommendation 7703 // model type. Default value: `no-diversity`. Can only be set if solution_types 7704 // is SOLUTION_TYPE_RECOMMENDATION. 7705 DiversityLevel string `json:"diversityLevel,omitempty"` 7706 // DiversityType: What kind of diversity to use - data driven or rule based. If 7707 // unset, the server behavior defaults to RULE_BASED_DIVERSITY. 7708 // 7709 // Possible values: 7710 // "DIVERSITY_TYPE_UNSPECIFIED" - Default value. 7711 // "RULE_BASED_DIVERSITY" - Rule based diversity. 7712 // "DATA_DRIVEN_DIVERSITY" - Data driven diversity. 7713 DiversityType string `json:"diversityType,omitempty"` 7714 // DoNotAssociateControlIds: Condition do not associate specifications. If 7715 // multiple do not associate conditions match, all matching do not associate 7716 // controls in the list will execute. - Order does not matter. - Maximum number 7717 // of specifications is 100. Can only be set if solution_types is 7718 // SOLUTION_TYPE_SEARCH. 7719 DoNotAssociateControlIds []string `json:"doNotAssociateControlIds,omitempty"` 7720 // DynamicFacetSpec: The specification for dynamically generated facets. Notice 7721 // that only textual facets can be dynamically generated. Can only be set if 7722 // solution_types is SOLUTION_TYPE_SEARCH. 7723 DynamicFacetSpec *GoogleCloudRetailV2betaSearchRequestDynamicFacetSpec `json:"dynamicFacetSpec,omitempty"` 7724 // EnableCategoryFilterLevel: Whether to add additional category filters on the 7725 // `similar-items` model. If not specified, we enable it by default. Allowed 7726 // values are: * `no-category-match`: No additional filtering of original 7727 // results from the model and the customer's filters. * 7728 // `relaxed-category-match`: Only keep results with categories that match at 7729 // least one item categories in the PredictRequests's context item. * If 7730 // customer also sends filters in the PredictRequest, then the results will 7731 // satisfy both conditions (user given and category match). Can only be set if 7732 // solution_types is SOLUTION_TYPE_RECOMMENDATION. 7733 EnableCategoryFilterLevel string `json:"enableCategoryFilterLevel,omitempty"` 7734 // FacetControlIds: Facet specifications for faceted search. If empty, no 7735 // facets are returned. The ids refer to the ids of Control resources with only 7736 // the Facet control set. These controls are assumed to be in the same Catalog 7737 // as the ServingConfig. A maximum of 100 values are allowed. Otherwise, an 7738 // INVALID_ARGUMENT error is returned. Can only be set if solution_types is 7739 // SOLUTION_TYPE_SEARCH. 7740 FacetControlIds []string `json:"facetControlIds,omitempty"` 7741 // FilterControlIds: Condition filter specifications. If a product matches 7742 // multiple conditions in the specifications, filters from these specifications 7743 // are all applied and combined via the AND operator. Maximum number of 7744 // specifications is 100. Can only be set if solution_types is 7745 // SOLUTION_TYPE_SEARCH. 7746 FilterControlIds []string `json:"filterControlIds,omitempty"` 7747 // IgnoreControlIds: Condition ignore specifications. If multiple ignore 7748 // conditions match, all matching ignore controls in the list will execute. - 7749 // Order does not matter. - Maximum number of specifications is 100. Can only 7750 // be set if solution_types is SOLUTION_TYPE_SEARCH. 7751 IgnoreControlIds []string `json:"ignoreControlIds,omitempty"` 7752 // IgnoreRecsDenylist: When the flag is enabled, the products in the denylist 7753 // will not be filtered out in the recommendation filtering results. 7754 IgnoreRecsDenylist bool `json:"ignoreRecsDenylist,omitempty"` 7755 // ModelId: The id of the model in the same Catalog to use at serving time. 7756 // Currently only RecommendationModels are supported: 7757 // https://cloud.google.com/retail/recommendations-ai/docs/create-models Can be 7758 // changed but only to a compatible model (e.g. others-you-may-like CTR to 7759 // others-you-may-like CVR). Required when solution_types is 7760 // SOLUTION_TYPE_RECOMMENDATION. 7761 ModelId string `json:"modelId,omitempty"` 7762 // Name: Immutable. Fully qualified name 7763 // `projects/*/locations/global/catalogs/*/servingConfig/*` 7764 Name string `json:"name,omitempty"` 7765 // OnewaySynonymsControlIds: Condition oneway synonyms specifications. If 7766 // multiple oneway synonyms conditions match, all matching oneway synonyms 7767 // controls in the list will execute. Order of controls in the list will not 7768 // matter. Maximum number of specifications is 100. Can only be set if 7769 // solution_types is SOLUTION_TYPE_SEARCH. 7770 OnewaySynonymsControlIds []string `json:"onewaySynonymsControlIds,omitempty"` 7771 // PersonalizationSpec: The specification for personalization spec. Can only be 7772 // set if solution_types is SOLUTION_TYPE_SEARCH. Notice that if both 7773 // ServingConfig.personalization_spec and SearchRequest.personalization_spec 7774 // are set. SearchRequest.personalization_spec will override 7775 // ServingConfig.personalization_spec. 7776 PersonalizationSpec *GoogleCloudRetailV2betaSearchRequestPersonalizationSpec `json:"personalizationSpec,omitempty"` 7777 // PriceRerankingLevel: How much price ranking we want in serving results. 7778 // Price reranking causes product items with a similar recommendation 7779 // probability to be ordered by price, with the highest-priced items first. 7780 // This setting could result in a decrease in click-through and conversion 7781 // rates. Allowed values are: * `no-price-reranking` * `low-price-reranking` * 7782 // `medium-price-reranking` * `high-price-reranking` If not specified, we 7783 // choose default based on model type. Default value: `no-price-reranking`. Can 7784 // only be set if solution_types is SOLUTION_TYPE_RECOMMENDATION. 7785 PriceRerankingLevel string `json:"priceRerankingLevel,omitempty"` 7786 // RedirectControlIds: Condition redirect specifications. Only the first 7787 // triggered redirect action is applied, even if multiple apply. Maximum number 7788 // of specifications is 1000. Can only be set if solution_types is 7789 // SOLUTION_TYPE_SEARCH. 7790 RedirectControlIds []string `json:"redirectControlIds,omitempty"` 7791 // ReplacementControlIds: Condition replacement specifications. - Applied 7792 // according to the order in the list. - A previously replaced term can not be 7793 // re-replaced. - Maximum number of specifications is 100. Can only be set if 7794 // solution_types is SOLUTION_TYPE_SEARCH. 7795 ReplacementControlIds []string `json:"replacementControlIds,omitempty"` 7796 // SolutionTypes: Required. Immutable. Specifies the solution types that a 7797 // serving config can be associated with. Currently we support setting only one 7798 // type of solution. 7799 // 7800 // Possible values: 7801 // "SOLUTION_TYPE_UNSPECIFIED" - Default value. 7802 // "SOLUTION_TYPE_RECOMMENDATION" - Used for Recommendations AI. 7803 // "SOLUTION_TYPE_SEARCH" - Used for Retail Search. 7804 SolutionTypes []string `json:"solutionTypes,omitempty"` 7805 // TwowaySynonymsControlIds: Condition synonyms specifications. If multiple 7806 // syonyms conditions match, all matching synonyms control in the list will 7807 // execute. Order of controls in the list will not matter. Maximum number of 7808 // specifications is 100. Can only be set if solution_types is 7809 // SOLUTION_TYPE_SEARCH. 7810 TwowaySynonymsControlIds []string `json:"twowaySynonymsControlIds,omitempty"` 7811 7812 // ServerResponse contains the HTTP response code and headers from the server. 7813 googleapi.ServerResponse `json:"-"` 7814 // ForceSendFields is a list of field names (e.g. "BoostControlIds") to 7815 // unconditionally include in API requests. By default, fields with empty or 7816 // default values are omitted from API requests. See 7817 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7818 // details. 7819 ForceSendFields []string `json:"-"` 7820 // NullFields is a list of field names (e.g. "BoostControlIds") to include in 7821 // API requests with the JSON null value. By default, fields with empty values 7822 // are omitted from API requests. See 7823 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7824 NullFields []string `json:"-"` 7825 } 7826 7827 func (s *GoogleCloudRetailV2betaServingConfig) MarshalJSON() ([]byte, error) { 7828 type NoMethod GoogleCloudRetailV2betaServingConfig 7829 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7830 } 7831 7832 // GoogleCloudRetailV2betaSetDefaultBranchRequest: Request message to set a 7833 // specified branch as new default_branch. 7834 type GoogleCloudRetailV2betaSetDefaultBranchRequest struct { 7835 // BranchId: The final component of the resource name of a branch. This field 7836 // must be one of "0", "1" or "2". Otherwise, an INVALID_ARGUMENT error is 7837 // returned. If there are no sufficient active products in the targeted branch 7838 // and force is not set, a FAILED_PRECONDITION error is returned. 7839 BranchId string `json:"branchId,omitempty"` 7840 // Force: If set to true, it permits switching to a branch with branch_id even 7841 // if it has no sufficient active products. 7842 Force bool `json:"force,omitempty"` 7843 // Note: Some note on this request, this can be retrieved by 7844 // CatalogService.GetDefaultBranch before next valid default branch set occurs. 7845 // This field must be a UTF-8 encoded string with a length limit of 1,000 7846 // characters. Otherwise, an INVALID_ARGUMENT error is returned. 7847 Note string `json:"note,omitempty"` 7848 // ForceSendFields is a list of field names (e.g. "BranchId") to 7849 // unconditionally include in API requests. By default, fields with empty or 7850 // default values are omitted from API requests. See 7851 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7852 // details. 7853 ForceSendFields []string `json:"-"` 7854 // NullFields is a list of field names (e.g. "BranchId") to include in API 7855 // requests with the JSON null value. By default, fields with empty values are 7856 // omitted from API requests. See 7857 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7858 NullFields []string `json:"-"` 7859 } 7860 7861 func (s *GoogleCloudRetailV2betaSetDefaultBranchRequest) MarshalJSON() ([]byte, error) { 7862 type NoMethod GoogleCloudRetailV2betaSetDefaultBranchRequest 7863 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7864 } 7865 7866 // GoogleCloudRetailV2betaSetInventoryMetadata: Metadata related to the 7867 // progress of the SetInventory operation. Currently empty because there is no 7868 // meaningful metadata populated from the ProductService.SetInventory method. 7869 type GoogleCloudRetailV2betaSetInventoryMetadata struct { 7870 } 7871 7872 // GoogleCloudRetailV2betaSetInventoryRequest: Request message for 7873 // ProductService.SetInventory method. 7874 type GoogleCloudRetailV2betaSetInventoryRequest struct { 7875 // AllowMissing: If set to true, and the Product with name Product.name is not 7876 // found, the inventory update will still be processed and retained for at most 7877 // 1 day until the Product is created. If set to false, a NOT_FOUND error is 7878 // returned if the Product is not found. 7879 AllowMissing bool `json:"allowMissing,omitempty"` 7880 // Inventory: Required. The inventory information to update. The allowable 7881 // fields to update are: * Product.price_info * Product.availability * 7882 // Product.available_quantity * Product.fulfillment_info The updated inventory 7883 // fields must be specified in SetInventoryRequest.set_mask. If 7884 // SetInventoryRequest.inventory.name is empty or invalid, an INVALID_ARGUMENT 7885 // error is returned. If the caller does not have permission to update the 7886 // Product named in Product.name, regardless of whether or not it exists, a 7887 // PERMISSION_DENIED error is returned. If the Product to update does not have 7888 // existing inventory information, the provided inventory information will be 7889 // inserted. If the Product to update has existing inventory information, the 7890 // provided inventory information will be merged while respecting the last 7891 // update time for each inventory field, using the provided or default value 7892 // for SetInventoryRequest.set_time. The caller can replace place IDs for a 7893 // subset of fulfillment types in the following ways: * Adds "fulfillment_info" 7894 // in SetInventoryRequest.set_mask * Specifies only the desired fulfillment 7895 // types and corresponding place IDs to update in 7896 // SetInventoryRequest.inventory.fulfillment_info The caller can clear all 7897 // place IDs from a subset of fulfillment types in the following ways: * Adds 7898 // "fulfillment_info" in SetInventoryRequest.set_mask * Specifies only the 7899 // desired fulfillment types to clear in 7900 // SetInventoryRequest.inventory.fulfillment_info * Checks that only the 7901 // desired fulfillment info types have empty 7902 // SetInventoryRequest.inventory.fulfillment_info.place_ids The last update 7903 // time is recorded for the following inventory fields: * Product.price_info * 7904 // Product.availability * Product.available_quantity * Product.fulfillment_info 7905 // If a full overwrite of inventory information while ignoring timestamps is 7906 // needed, ProductService.UpdateProduct should be invoked instead. 7907 Inventory *GoogleCloudRetailV2betaProduct `json:"inventory,omitempty"` 7908 // SetMask: Indicates which inventory fields in the provided Product to update. 7909 // At least one field must be provided. If an unsupported or unknown field is 7910 // provided, an INVALID_ARGUMENT error is returned and the entire update will 7911 // be ignored. 7912 SetMask string `json:"setMask,omitempty"` 7913 // SetTime: The time when the request is issued, used to prevent out-of-order 7914 // updates on inventory fields with the last update time recorded. If not 7915 // provided, the internal system time will be used. 7916 SetTime string `json:"setTime,omitempty"` 7917 // ForceSendFields is a list of field names (e.g. "AllowMissing") to 7918 // unconditionally include in API requests. By default, fields with empty or 7919 // default values are omitted from API requests. See 7920 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7921 // details. 7922 ForceSendFields []string `json:"-"` 7923 // NullFields is a list of field names (e.g. "AllowMissing") to include in API 7924 // requests with the JSON null value. By default, fields with empty values are 7925 // omitted from API requests. See 7926 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7927 NullFields []string `json:"-"` 7928 } 7929 7930 func (s *GoogleCloudRetailV2betaSetInventoryRequest) MarshalJSON() ([]byte, error) { 7931 type NoMethod GoogleCloudRetailV2betaSetInventoryRequest 7932 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7933 } 7934 7935 // GoogleCloudRetailV2betaSetInventoryResponse: Response of the 7936 // SetInventoryRequest. Currently empty because there is no meaningful response 7937 // populated from the ProductService.SetInventory method. 7938 type GoogleCloudRetailV2betaSetInventoryResponse struct { 7939 } 7940 7941 // GoogleCloudRetailV2betaTuneModelMetadata: Metadata associated with a tune 7942 // operation. 7943 type GoogleCloudRetailV2betaTuneModelMetadata struct { 7944 // Model: The resource name of the model that this tune applies to. Format: 7945 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/mode 7946 // ls/{model_id}` 7947 Model string `json:"model,omitempty"` 7948 // ForceSendFields is a list of field names (e.g. "Model") to unconditionally 7949 // include in API requests. By default, fields with empty or default values are 7950 // omitted from API requests. See 7951 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7952 // details. 7953 ForceSendFields []string `json:"-"` 7954 // NullFields is a list of field names (e.g. "Model") to include in API 7955 // requests with the JSON null value. By default, fields with empty values are 7956 // omitted from API requests. See 7957 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7958 NullFields []string `json:"-"` 7959 } 7960 7961 func (s *GoogleCloudRetailV2betaTuneModelMetadata) MarshalJSON() ([]byte, error) { 7962 type NoMethod GoogleCloudRetailV2betaTuneModelMetadata 7963 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7964 } 7965 7966 // GoogleCloudRetailV2betaTuneModelRequest: Request to manually start a tuning 7967 // process now (instead of waiting for the periodically scheduled tuning to 7968 // happen). 7969 type GoogleCloudRetailV2betaTuneModelRequest struct { 7970 } 7971 7972 // GoogleCloudRetailV2betaTuneModelResponse: Response associated with a tune 7973 // operation. 7974 type GoogleCloudRetailV2betaTuneModelResponse struct { 7975 } 7976 7977 // GoogleCloudRetailV2betaUserEvent: UserEvent captures all metadata 7978 // information Retail API needs to know about how end users interact with 7979 // customers' website. 7980 type GoogleCloudRetailV2betaUserEvent struct { 7981 // Attributes: Extra user event features to include in the recommendation 7982 // model. If you provide custom attributes for ingested user events, also 7983 // include them in the user events that you associate with prediction requests. 7984 // Custom attribute formatting must be consistent between imported events and 7985 // events provided with prediction requests. This lets the Retail API use those 7986 // custom attributes when training models and serving predictions, which helps 7987 // improve recommendation quality. This field needs to pass all below criteria, 7988 // otherwise an INVALID_ARGUMENT error is returned: * The key must be a UTF-8 7989 // encoded string with a length limit of 5,000 characters. * For text 7990 // attributes, at most 400 values are allowed. Empty values are not allowed. 7991 // Each value must be a UTF-8 encoded string with a length limit of 256 7992 // characters. * For number attributes, at most 400 values are allowed. For 7993 // product recommendations, an example of extra user information is 7994 // traffic_channel, which is how a user arrives at the site. Users can arrive 7995 // at the site by coming to the site directly, coming through Google search, or 7996 // in other ways. 7997 Attributes map[string]GoogleCloudRetailV2betaCustomAttribute `json:"attributes,omitempty"` 7998 // AttributionToken: Highly recommended for user events that are the result of 7999 // PredictionService.Predict. This field enables accurate attribution of 8000 // recommendation model performance. The value must be a valid 8001 // PredictResponse.attribution_token for user events that are the result of 8002 // PredictionService.Predict. The value must be a valid 8003 // SearchResponse.attribution_token for user events that are the result of 8004 // SearchService.Search. This token enables us to accurately attribute page 8005 // view or purchase back to the event and the particular predict response 8006 // containing this clicked/purchased product. If user clicks on product K in 8007 // the recommendation results, pass PredictResponse.attribution_token as a URL 8008 // parameter to product K's page. When recording events on product K's page, 8009 // log the PredictResponse.attribution_token to this field. 8010 AttributionToken string `json:"attributionToken,omitempty"` 8011 // CartId: The ID or name of the associated shopping cart. This ID is used to 8012 // associate multiple items added or present in the cart before purchase. This 8013 // can only be set for `add-to-cart`, `purchase-complete`, or 8014 // `shopping-cart-page-view` events. 8015 CartId string `json:"cartId,omitempty"` 8016 // CompletionDetail: The main auto-completion details related to the event. 8017 // This field should be set for `search` event when autocomplete function is 8018 // enabled and the user clicks a suggestion for search. 8019 CompletionDetail *GoogleCloudRetailV2betaCompletionDetail `json:"completionDetail,omitempty"` 8020 // Entity: The entity for customers that may run multiple different entities, 8021 // domains, sites or regions, for example, `Google US`, `Google Ads`, `Waymo`, 8022 // `google.com`, `youtube.com`, etc. We recommend that you set this field to 8023 // get better per-entity search, completion, and prediction results. 8024 Entity string `json:"entity,omitempty"` 8025 // EventTime: Only required for UserEventService.ImportUserEvents method. 8026 // Timestamp of when the user event happened. 8027 EventTime string `json:"eventTime,omitempty"` 8028 // EventType: Required. User event type. Allowed values are: * `add-to-cart`: 8029 // Products being added to cart. * `remove-from-cart`: Products being removed 8030 // from cart. * `category-page-view`: Special pages such as sale or promotion 8031 // pages viewed. * `detail-page-view`: Products detail page viewed. * 8032 // `home-page-view`: Homepage viewed. * `promotion-offered`: Promotion is 8033 // offered to a user. * `promotion-not-offered`: Promotion is not offered to a 8034 // user. * `purchase-complete`: User finishing a purchase. * `search`: Product 8035 // search. * `shopping-cart-page-view`: User viewing a shopping cart. 8036 EventType string `json:"eventType,omitempty"` 8037 // ExperimentIds: A list of identifiers for the independent experiment groups 8038 // this user event belongs to. This is used to distinguish between user events 8039 // associated with different experiment setups (e.g. using Retail API, using 8040 // different recommendation models). 8041 ExperimentIds []string `json:"experimentIds,omitempty"` 8042 // Filter: The filter syntax consists of an expression language for 8043 // constructing a predicate from one or more fields of the products being 8044 // filtered. See SearchRequest.filter for definition and syntax. The value must 8045 // be a UTF-8 encoded string with a length limit of 1,000 characters. 8046 // Otherwise, an INVALID_ARGUMENT error is returned. 8047 Filter string `json:"filter,omitempty"` 8048 // Offset: An integer that specifies the current offset for pagination (the 8049 // 0-indexed starting location, amongst the products deemed by the API as 8050 // relevant). See SearchRequest.offset for definition. If this field is 8051 // negative, an INVALID_ARGUMENT is returned. This can only be set for `search` 8052 // events. Other event types should not set this field. Otherwise, an 8053 // INVALID_ARGUMENT error is returned. 8054 Offset int64 `json:"offset,omitempty"` 8055 // OrderBy: The order in which products are returned. See 8056 // SearchRequest.order_by for definition and syntax. The value must be a UTF-8 8057 // encoded string with a length limit of 1,000 characters. Otherwise, an 8058 // INVALID_ARGUMENT error is returned. This can only be set for `search` 8059 // events. Other event types should not set this field. Otherwise, an 8060 // INVALID_ARGUMENT error is returned. 8061 OrderBy string `json:"orderBy,omitempty"` 8062 // PageCategories: The categories associated with a category page. To represent 8063 // full path of category, use '>' sign to separate different hierarchies. If 8064 // '>' is part of the category name, replace it with other character(s). 8065 // Category pages include special pages such as sales or promotions. For 8066 // instance, a special sale page may have the category hierarchy: 8067 // "pageCategories" : ["Sales > 2017 Black Friday Deals"]. Required for 8068 // `category-page-view` events. At least one of search_query or page_categories 8069 // is required for `search` events. Other event types should not set this 8070 // field. Otherwise, an INVALID_ARGUMENT error is returned. 8071 PageCategories []string `json:"pageCategories,omitempty"` 8072 // PageViewId: A unique ID of a web page view. This should be kept the same for 8073 // all user events triggered from the same pageview. For example, an item 8074 // detail page view could trigger multiple events as the user is browsing the 8075 // page. The `pageViewId` property should be kept the same for all these events 8076 // so that they can be grouped together properly. When using the client side 8077 // event reporting with JavaScript pixel and Google Tag Manager, this value is 8078 // filled in automatically. 8079 PageViewId string `json:"pageViewId,omitempty"` 8080 // ProductDetails: The main product details related to the event. This field is 8081 // optional except for the following event types: * `add-to-cart` * 8082 // `detail-page-view` * `purchase-complete` In a `search` event, this field 8083 // represents the products returned to the end user on the current page (the 8084 // end user may have not finished browsing the whole page yet). When a new page 8085 // is returned to the end user, after pagination/filtering/ordering even for 8086 // the same query, a new `search` event with different product_details is 8087 // desired. The end user may have not finished browsing the whole page yet. 8088 ProductDetails []*GoogleCloudRetailV2betaProductDetail `json:"productDetails,omitempty"` 8089 // PurchaseTransaction: A transaction represents the entire purchase 8090 // transaction. Required for `purchase-complete` events. Other event types 8091 // should not set this field. Otherwise, an INVALID_ARGUMENT error is returned. 8092 PurchaseTransaction *GoogleCloudRetailV2betaPurchaseTransaction `json:"purchaseTransaction,omitempty"` 8093 // ReferrerUri: The referrer URL of the current page. When using the client 8094 // side event reporting with JavaScript pixel and Google Tag Manager, this 8095 // value is filled in automatically. 8096 ReferrerUri string `json:"referrerUri,omitempty"` 8097 // SearchQuery: The user's search query. See SearchRequest.query for 8098 // definition. The value must be a UTF-8 encoded string with a length limit of 8099 // 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. At least 8100 // one of search_query or page_categories is required for `search` events. 8101 // Other event types should not set this field. Otherwise, an INVALID_ARGUMENT 8102 // error is returned. 8103 SearchQuery string `json:"searchQuery,omitempty"` 8104 // SessionId: A unique identifier for tracking a visitor session with a length 8105 // limit of 128 bytes. A session is an aggregation of an end user behavior in a 8106 // time span. A general guideline to populate the sesion_id: 1. If user has no 8107 // activity for 30 min, a new session_id should be assigned. 2. The session_id 8108 // should be unique across users, suggest use uuid or add visitor_id as prefix. 8109 SessionId string `json:"sessionId,omitempty"` 8110 // Uri: Complete URL (window.location.href) of the user's current page. When 8111 // using the client side event reporting with JavaScript pixel and Google Tag 8112 // Manager, this value is filled in automatically. Maximum length 5,000 8113 // characters. 8114 Uri string `json:"uri,omitempty"` 8115 // UserInfo: User information. 8116 UserInfo *GoogleCloudRetailV2betaUserInfo `json:"userInfo,omitempty"` 8117 // VisitorId: Required. A unique identifier for tracking visitors. For example, 8118 // this could be implemented with an HTTP cookie, which should be able to 8119 // uniquely identify a visitor on a single device. This unique identifier 8120 // should not change if the visitor log in/out of the website. Don't set the 8121 // field to the same fixed ID for different users. This mixes the event history 8122 // of those users together, which results in degraded model quality. The field 8123 // must be a UTF-8 encoded string with a length limit of 128 characters. 8124 // Otherwise, an INVALID_ARGUMENT error is returned. The field should not 8125 // contain PII or user-data. We recommend to use Google Analytics Client ID 8126 // (https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId) 8127 // for this field. 8128 VisitorId string `json:"visitorId,omitempty"` 8129 8130 // ServerResponse contains the HTTP response code and headers from the server. 8131 googleapi.ServerResponse `json:"-"` 8132 // ForceSendFields is a list of field names (e.g. "Attributes") to 8133 // unconditionally include in API requests. By default, fields with empty or 8134 // default values are omitted from API requests. See 8135 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8136 // details. 8137 ForceSendFields []string `json:"-"` 8138 // NullFields is a list of field names (e.g. "Attributes") to include in API 8139 // requests with the JSON null value. By default, fields with empty values are 8140 // omitted from API requests. See 8141 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8142 NullFields []string `json:"-"` 8143 } 8144 8145 func (s *GoogleCloudRetailV2betaUserEvent) MarshalJSON() ([]byte, error) { 8146 type NoMethod GoogleCloudRetailV2betaUserEvent 8147 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8148 } 8149 8150 // GoogleCloudRetailV2betaUserEventImportSummary: A summary of import result. 8151 // The UserEventImportSummary summarizes the import status for user events. 8152 type GoogleCloudRetailV2betaUserEventImportSummary struct { 8153 // JoinedEventsCount: Count of user events imported with complete existing 8154 // catalog information. 8155 JoinedEventsCount int64 `json:"joinedEventsCount,omitempty,string"` 8156 // UnjoinedEventsCount: Count of user events imported, but with catalog 8157 // information not found in the imported catalog. 8158 UnjoinedEventsCount int64 `json:"unjoinedEventsCount,omitempty,string"` 8159 // ForceSendFields is a list of field names (e.g. "JoinedEventsCount") to 8160 // unconditionally include in API requests. By default, fields with empty or 8161 // default values are omitted from API requests. See 8162 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8163 // details. 8164 ForceSendFields []string `json:"-"` 8165 // NullFields is a list of field names (e.g. "JoinedEventsCount") to include in 8166 // API requests with the JSON null value. By default, fields with empty values 8167 // are omitted from API requests. See 8168 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8169 NullFields []string `json:"-"` 8170 } 8171 8172 func (s *GoogleCloudRetailV2betaUserEventImportSummary) MarshalJSON() ([]byte, error) { 8173 type NoMethod GoogleCloudRetailV2betaUserEventImportSummary 8174 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8175 } 8176 8177 // GoogleCloudRetailV2betaUserEventInlineSource: The inline source for the 8178 // input config for ImportUserEvents method. 8179 type GoogleCloudRetailV2betaUserEventInlineSource struct { 8180 // UserEvents: Required. A list of user events to import. Recommended max of 8181 // 10k items. 8182 UserEvents []*GoogleCloudRetailV2betaUserEvent `json:"userEvents,omitempty"` 8183 // ForceSendFields is a list of field names (e.g. "UserEvents") to 8184 // unconditionally include in API requests. By default, fields with empty or 8185 // default values are omitted from API requests. See 8186 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8187 // details. 8188 ForceSendFields []string `json:"-"` 8189 // NullFields is a list of field names (e.g. "UserEvents") to include in API 8190 // requests with the JSON null value. By default, fields with empty values are 8191 // omitted from API requests. See 8192 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8193 NullFields []string `json:"-"` 8194 } 8195 8196 func (s *GoogleCloudRetailV2betaUserEventInlineSource) MarshalJSON() ([]byte, error) { 8197 type NoMethod GoogleCloudRetailV2betaUserEventInlineSource 8198 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8199 } 8200 8201 // GoogleCloudRetailV2betaUserEventInputConfig: The input config source for 8202 // user events. 8203 type GoogleCloudRetailV2betaUserEventInputConfig struct { 8204 // BigQuerySource: Required. BigQuery input source. 8205 BigQuerySource *GoogleCloudRetailV2betaBigQuerySource `json:"bigQuerySource,omitempty"` 8206 // GcsSource: Required. Google Cloud Storage location for the input content. 8207 GcsSource *GoogleCloudRetailV2betaGcsSource `json:"gcsSource,omitempty"` 8208 // UserEventInlineSource: Required. The Inline source for the input content for 8209 // UserEvents. 8210 UserEventInlineSource *GoogleCloudRetailV2betaUserEventInlineSource `json:"userEventInlineSource,omitempty"` 8211 // ForceSendFields is a list of field names (e.g. "BigQuerySource") to 8212 // unconditionally include in API requests. By default, fields with empty or 8213 // default values are omitted from API requests. See 8214 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8215 // details. 8216 ForceSendFields []string `json:"-"` 8217 // NullFields is a list of field names (e.g. "BigQuerySource") to include in 8218 // API requests with the JSON null value. By default, fields with empty values 8219 // are omitted from API requests. See 8220 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8221 NullFields []string `json:"-"` 8222 } 8223 8224 func (s *GoogleCloudRetailV2betaUserEventInputConfig) MarshalJSON() ([]byte, error) { 8225 type NoMethod GoogleCloudRetailV2betaUserEventInputConfig 8226 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8227 } 8228 8229 // GoogleCloudRetailV2betaUserInfo: Information of an end user. 8230 type GoogleCloudRetailV2betaUserInfo struct { 8231 // DirectUserRequest: True if the request is made directly from the end user, 8232 // in which case the ip_address and user_agent can be populated from the HTTP 8233 // request. This flag should be set only if the API request is made directly 8234 // from the end user such as a mobile app (and not if a gateway or a server is 8235 // processing and pushing the user events). This should not be set when using 8236 // the JavaScript tag in UserEventService.CollectUserEvent. 8237 DirectUserRequest bool `json:"directUserRequest,omitempty"` 8238 // IpAddress: The end user's IP address. This field is used to extract location 8239 // information for personalization. This field must be either an IPv4 address 8240 // (e.g. "104.133.9.80") or an IPv6 address (e.g. 8241 // "2001:0db8:85a3:0000:0000:8a2e:0370:7334"). Otherwise, an INVALID_ARGUMENT 8242 // error is returned. This should not be set when: * setting 8243 // SearchRequest.user_info. * using the JavaScript tag in 8244 // UserEventService.CollectUserEvent or if direct_user_request is set. 8245 IpAddress string `json:"ipAddress,omitempty"` 8246 // UserAgent: User agent as included in the HTTP header. Required for getting 8247 // SearchResponse.sponsored_results. The field must be a UTF-8 encoded string 8248 // with a length limit of 1,000 characters. Otherwise, an INVALID_ARGUMENT 8249 // error is returned. This should not be set when using the client side event 8250 // reporting with GTM or JavaScript tag in UserEventService.CollectUserEvent or 8251 // if direct_user_request is set. 8252 UserAgent string `json:"userAgent,omitempty"` 8253 // UserId: Highly recommended for logged-in users. Unique identifier for 8254 // logged-in user, such as a user name. Don't set for anonymous users. Always 8255 // use a hashed value for this ID. Don't set the field to the same fixed ID for 8256 // different users. This mixes the event history of those users together, which 8257 // results in degraded model quality. The field must be a UTF-8 encoded string 8258 // with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error 8259 // is returned. 8260 UserId string `json:"userId,omitempty"` 8261 // ForceSendFields is a list of field names (e.g. "DirectUserRequest") to 8262 // unconditionally include in API requests. By default, fields with empty or 8263 // default values are omitted from API requests. See 8264 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8265 // details. 8266 ForceSendFields []string `json:"-"` 8267 // NullFields is a list of field names (e.g. "DirectUserRequest") to include in 8268 // API requests with the JSON null value. By default, fields with empty values 8269 // are omitted from API requests. See 8270 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8271 NullFields []string `json:"-"` 8272 } 8273 8274 func (s *GoogleCloudRetailV2betaUserInfo) MarshalJSON() ([]byte, error) { 8275 type NoMethod GoogleCloudRetailV2betaUserInfo 8276 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8277 } 8278 8279 // GoogleLongrunningListOperationsResponse: The response message for 8280 // Operations.ListOperations. 8281 type GoogleLongrunningListOperationsResponse struct { 8282 // NextPageToken: The standard List next-page token. 8283 NextPageToken string `json:"nextPageToken,omitempty"` 8284 // Operations: A list of operations that matches the specified filter in the 8285 // request. 8286 Operations []*GoogleLongrunningOperation `json:"operations,omitempty"` 8287 8288 // ServerResponse contains the HTTP response code and headers from the server. 8289 googleapi.ServerResponse `json:"-"` 8290 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 8291 // unconditionally include in API requests. By default, fields with empty or 8292 // default values are omitted from API requests. See 8293 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8294 // details. 8295 ForceSendFields []string `json:"-"` 8296 // NullFields is a list of field names (e.g. "NextPageToken") to include in API 8297 // requests with the JSON null value. By default, fields with empty values are 8298 // omitted from API requests. See 8299 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8300 NullFields []string `json:"-"` 8301 } 8302 8303 func (s *GoogleLongrunningListOperationsResponse) MarshalJSON() ([]byte, error) { 8304 type NoMethod GoogleLongrunningListOperationsResponse 8305 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8306 } 8307 8308 // GoogleLongrunningOperation: This resource represents a long-running 8309 // operation that is the result of a network API call. 8310 type GoogleLongrunningOperation struct { 8311 // Done: If the value is `false`, it means the operation is still in progress. 8312 // If `true`, the operation is completed, and either `error` or `response` is 8313 // available. 8314 Done bool `json:"done,omitempty"` 8315 // Error: The error result of the operation in case of failure or cancellation. 8316 Error *GoogleRpcStatus `json:"error,omitempty"` 8317 // Metadata: Service-specific metadata associated with the operation. It 8318 // typically contains progress information and common metadata such as create 8319 // time. Some services might not provide such metadata. Any method that returns 8320 // a long-running operation should document the metadata type, if any. 8321 Metadata googleapi.RawMessage `json:"metadata,omitempty"` 8322 // Name: The server-assigned name, which is only unique within the same service 8323 // that originally returns it. If you use the default HTTP mapping, the `name` 8324 // should be a resource name ending with `operations/{unique_id}`. 8325 Name string `json:"name,omitempty"` 8326 // Response: The normal, successful response of the operation. If the original 8327 // method returns no data on success, such as `Delete`, the response is 8328 // `google.protobuf.Empty`. If the original method is standard 8329 // `Get`/`Create`/`Update`, the response should be the resource. For other 8330 // methods, the response should have the type `XxxResponse`, where `Xxx` is the 8331 // original method name. For example, if the original method name is 8332 // `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. 8333 Response googleapi.RawMessage `json:"response,omitempty"` 8334 8335 // ServerResponse contains the HTTP response code and headers from the server. 8336 googleapi.ServerResponse `json:"-"` 8337 // ForceSendFields is a list of field names (e.g. "Done") to unconditionally 8338 // include in API requests. By default, fields with empty or default values are 8339 // omitted from API requests. See 8340 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8341 // details. 8342 ForceSendFields []string `json:"-"` 8343 // NullFields is a list of field names (e.g. "Done") to include in API requests 8344 // with the JSON null value. By default, fields with empty values are omitted 8345 // from API requests. See 8346 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8347 NullFields []string `json:"-"` 8348 } 8349 8350 func (s *GoogleLongrunningOperation) MarshalJSON() ([]byte, error) { 8351 type NoMethod GoogleLongrunningOperation 8352 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8353 } 8354 8355 // GoogleProtobufEmpty: A generic empty message that you can re-use to avoid 8356 // defining duplicated empty messages in your APIs. A typical example is to use 8357 // it as the request or the response type of an API method. For instance: 8358 // service Foo { rpc Bar(google.protobuf.Empty) returns 8359 // (google.protobuf.Empty); } 8360 type GoogleProtobufEmpty struct { 8361 // ServerResponse contains the HTTP response code and headers from the server. 8362 googleapi.ServerResponse `json:"-"` 8363 } 8364 8365 // GoogleRpcStatus: The `Status` type defines a logical error model that is 8366 // suitable for different programming environments, including REST APIs and RPC 8367 // APIs. It is used by gRPC (https://github.com/grpc). Each `Status` message 8368 // contains three pieces of data: error code, error message, and error details. 8369 // You can find out more about this error model and how to work with it in the 8370 // API Design Guide (https://cloud.google.com/apis/design/errors). 8371 type GoogleRpcStatus struct { 8372 // Code: The status code, which should be an enum value of google.rpc.Code. 8373 Code int64 `json:"code,omitempty"` 8374 // Details: A list of messages that carry the error details. There is a common 8375 // set of message types for APIs to use. 8376 Details []googleapi.RawMessage `json:"details,omitempty"` 8377 // Message: A developer-facing error message, which should be in English. Any 8378 // user-facing error message should be localized and sent in the 8379 // google.rpc.Status.details field, or localized by the client. 8380 Message string `json:"message,omitempty"` 8381 // ForceSendFields is a list of field names (e.g. "Code") to unconditionally 8382 // include in API requests. By default, fields with empty or default values are 8383 // omitted from API requests. See 8384 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8385 // details. 8386 ForceSendFields []string `json:"-"` 8387 // NullFields is a list of field names (e.g. "Code") to include in API requests 8388 // with the JSON null value. By default, fields with empty values are omitted 8389 // from API requests. See 8390 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8391 NullFields []string `json:"-"` 8392 } 8393 8394 func (s *GoogleRpcStatus) MarshalJSON() ([]byte, error) { 8395 type NoMethod GoogleRpcStatus 8396 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8397 } 8398 8399 // GoogleTypeDate: Represents a whole or partial calendar date, such as a 8400 // birthday. The time of day and time zone are either specified elsewhere or 8401 // are insignificant. The date is relative to the Gregorian Calendar. This can 8402 // represent one of the following: * A full date, with non-zero year, month, 8403 // and day values. * A month and day, with a zero year (for example, an 8404 // anniversary). * A year on its own, with a zero month and a zero day. * A 8405 // year and month, with a zero day (for example, a credit card expiration 8406 // date). Related types: * google.type.TimeOfDay * google.type.DateTime * 8407 // google.protobuf.Timestamp 8408 type GoogleTypeDate struct { 8409 // Day: Day of a month. Must be from 1 to 31 and valid for the year and month, 8410 // or 0 to specify a year by itself or a year and month where the day isn't 8411 // significant. 8412 Day int64 `json:"day,omitempty"` 8413 // Month: Month of a year. Must be from 1 to 12, or 0 to specify a year without 8414 // a month and day. 8415 Month int64 `json:"month,omitempty"` 8416 // Year: Year of the date. Must be from 1 to 9999, or 0 to specify a date 8417 // without a year. 8418 Year int64 `json:"year,omitempty"` 8419 // ForceSendFields is a list of field names (e.g. "Day") to unconditionally 8420 // include in API requests. By default, fields with empty or default values are 8421 // omitted from API requests. See 8422 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8423 // details. 8424 ForceSendFields []string `json:"-"` 8425 // NullFields is a list of field names (e.g. "Day") to include in API requests 8426 // with the JSON null value. By default, fields with empty values are omitted 8427 // from API requests. See 8428 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8429 NullFields []string `json:"-"` 8430 } 8431 8432 func (s *GoogleTypeDate) MarshalJSON() ([]byte, error) { 8433 type NoMethod GoogleTypeDate 8434 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8435 } 8436 8437 type ProjectsLocationsCatalogsCompleteQueryCall struct { 8438 s *Service 8439 catalog string 8440 urlParams_ gensupport.URLParams 8441 ifNoneMatch_ string 8442 ctx_ context.Context 8443 header_ http.Header 8444 } 8445 8446 // CompleteQuery: Completes the specified prefix with keyword suggestions. This 8447 // feature is only available for users who have Retail Search enabled. Enable 8448 // Retail Search on Cloud Console before using this feature. 8449 // 8450 // - catalog: Catalog for which the completion is performed. Full resource name 8451 // of catalog, such as 8452 // `projects/*/locations/global/catalogs/default_catalog`. 8453 func (r *ProjectsLocationsCatalogsService) CompleteQuery(catalog string) *ProjectsLocationsCatalogsCompleteQueryCall { 8454 c := &ProjectsLocationsCatalogsCompleteQueryCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8455 c.catalog = catalog 8456 return c 8457 } 8458 8459 // Dataset sets the optional parameter "dataset": Determines which dataset to 8460 // use for fetching completion. "user-data" will use the imported dataset 8461 // through CompletionService.ImportCompletionData. "cloud-retail" will use the 8462 // dataset generated by cloud retail based on user events. If leave empty, it 8463 // will use the "user-data". Current supported values: * user-data * 8464 // cloud-retail: This option requires enabling auto-learning function first. 8465 // See guidelines 8466 // (https://cloud.google.com/retail/docs/completion-overview#generated-completion-dataset). 8467 func (c *ProjectsLocationsCatalogsCompleteQueryCall) Dataset(dataset string) *ProjectsLocationsCatalogsCompleteQueryCall { 8468 c.urlParams_.Set("dataset", dataset) 8469 return c 8470 } 8471 8472 // DeviceType sets the optional parameter "deviceType": The device type context 8473 // for completion suggestions. We recommend that you leave this field empty. It 8474 // can apply different suggestions on different device types, e.g. `DESKTOP`, 8475 // `MOBILE`. If it is empty, the suggestions are across all device types. 8476 // Supported formats: * `UNKNOWN_DEVICE_TYPE` * `DESKTOP` * `MOBILE` * A 8477 // customized string starts with `OTHER_`, e.g. `OTHER_IPHONE`. 8478 func (c *ProjectsLocationsCatalogsCompleteQueryCall) DeviceType(deviceType string) *ProjectsLocationsCatalogsCompleteQueryCall { 8479 c.urlParams_.Set("deviceType", deviceType) 8480 return c 8481 } 8482 8483 // EnableAttributeSuggestions sets the optional parameter 8484 // "enableAttributeSuggestions": If true, attribute suggestions are enabled and 8485 // provided in response. This field is only available for "cloud-retail" 8486 // dataset. 8487 func (c *ProjectsLocationsCatalogsCompleteQueryCall) EnableAttributeSuggestions(enableAttributeSuggestions bool) *ProjectsLocationsCatalogsCompleteQueryCall { 8488 c.urlParams_.Set("enableAttributeSuggestions", fmt.Sprint(enableAttributeSuggestions)) 8489 return c 8490 } 8491 8492 // Entity sets the optional parameter "entity": The entity for customers who 8493 // run multiple entities, domains, sites, or regions, for example, `Google US`, 8494 // `Google Ads`, `Waymo`, `google.com`, `youtube.com`, etc. If this is set, it 8495 // must be an exact match with UserEvent.entity to get per-entity autocomplete 8496 // results. 8497 func (c *ProjectsLocationsCatalogsCompleteQueryCall) Entity(entity string) *ProjectsLocationsCatalogsCompleteQueryCall { 8498 c.urlParams_.Set("entity", entity) 8499 return c 8500 } 8501 8502 // LanguageCodes sets the optional parameter "languageCodes": Note that this 8503 // field applies for `user-data` dataset only. For requests with `cloud-retail` 8504 // dataset, setting this field has no effect. The language filters applied to 8505 // the output suggestions. If set, it should contain the language of the query. 8506 // If not set, suggestions are returned without considering language 8507 // restrictions. This is the BCP-47 language code, such as "en-US" or 8508 // "sr-Latn". For more information, see Tags for Identifying Languages 8509 // (https://tools.ietf.org/html/bcp47). The maximum number of language codes is 8510 // 3. 8511 func (c *ProjectsLocationsCatalogsCompleteQueryCall) LanguageCodes(languageCodes ...string) *ProjectsLocationsCatalogsCompleteQueryCall { 8512 c.urlParams_.SetMulti("languageCodes", append([]string{}, languageCodes...)) 8513 return c 8514 } 8515 8516 // MaxSuggestions sets the optional parameter "maxSuggestions": Completion max 8517 // suggestions. If left unset or set to 0, then will fallback to the configured 8518 // value CompletionConfig.max_suggestions. The maximum allowed max suggestions 8519 // is 20. If it is set higher, it will be capped by 20. 8520 func (c *ProjectsLocationsCatalogsCompleteQueryCall) MaxSuggestions(maxSuggestions int64) *ProjectsLocationsCatalogsCompleteQueryCall { 8521 c.urlParams_.Set("maxSuggestions", fmt.Sprint(maxSuggestions)) 8522 return c 8523 } 8524 8525 // Query sets the optional parameter "query": Required. The query used to 8526 // generate suggestions. The maximum number of allowed characters is 255. 8527 func (c *ProjectsLocationsCatalogsCompleteQueryCall) Query(query string) *ProjectsLocationsCatalogsCompleteQueryCall { 8528 c.urlParams_.Set("query", query) 8529 return c 8530 } 8531 8532 // VisitorId sets the optional parameter "visitorId": Required field. A unique 8533 // identifier for tracking visitors. For example, this could be implemented 8534 // with an HTTP cookie, which should be able to uniquely identify a visitor on 8535 // a single device. This unique identifier should not change if the visitor 8536 // logs in or out of the website. The field must be a UTF-8 encoded string with 8537 // a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is 8538 // returned. 8539 func (c *ProjectsLocationsCatalogsCompleteQueryCall) VisitorId(visitorId string) *ProjectsLocationsCatalogsCompleteQueryCall { 8540 c.urlParams_.Set("visitorId", visitorId) 8541 return c 8542 } 8543 8544 // Fields allows partial responses to be retrieved. See 8545 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 8546 // details. 8547 func (c *ProjectsLocationsCatalogsCompleteQueryCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsCompleteQueryCall { 8548 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8549 return c 8550 } 8551 8552 // IfNoneMatch sets an optional parameter which makes the operation fail if the 8553 // object's ETag matches the given value. This is useful for getting updates 8554 // only after the object has changed since the last request. 8555 func (c *ProjectsLocationsCatalogsCompleteQueryCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsCompleteQueryCall { 8556 c.ifNoneMatch_ = entityTag 8557 return c 8558 } 8559 8560 // Context sets the context to be used in this call's Do method. 8561 func (c *ProjectsLocationsCatalogsCompleteQueryCall) Context(ctx context.Context) *ProjectsLocationsCatalogsCompleteQueryCall { 8562 c.ctx_ = ctx 8563 return c 8564 } 8565 8566 // Header returns a http.Header that can be modified by the caller to add 8567 // headers to the request. 8568 func (c *ProjectsLocationsCatalogsCompleteQueryCall) Header() http.Header { 8569 if c.header_ == nil { 8570 c.header_ = make(http.Header) 8571 } 8572 return c.header_ 8573 } 8574 8575 func (c *ProjectsLocationsCatalogsCompleteQueryCall) doRequest(alt string) (*http.Response, error) { 8576 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 8577 if c.ifNoneMatch_ != "" { 8578 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8579 } 8580 var body io.Reader = nil 8581 c.urlParams_.Set("alt", alt) 8582 c.urlParams_.Set("prettyPrint", "false") 8583 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+catalog}:completeQuery") 8584 urls += "?" + c.urlParams_.Encode() 8585 req, err := http.NewRequest("GET", urls, body) 8586 if err != nil { 8587 return nil, err 8588 } 8589 req.Header = reqHeaders 8590 googleapi.Expand(req.URL, map[string]string{ 8591 "catalog": c.catalog, 8592 }) 8593 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8594 } 8595 8596 // Do executes the "retail.projects.locations.catalogs.completeQuery" call. 8597 // Any non-2xx status code is an error. Response headers are in either 8598 // *GoogleCloudRetailV2betaCompleteQueryResponse.ServerResponse.Header or (if a 8599 // response was returned at all) in error.(*googleapi.Error).Header. Use 8600 // googleapi.IsNotModified to check whether the returned error was because 8601 // http.StatusNotModified was returned. 8602 func (c *ProjectsLocationsCatalogsCompleteQueryCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2betaCompleteQueryResponse, error) { 8603 gensupport.SetOptions(c.urlParams_, opts...) 8604 res, err := c.doRequest("json") 8605 if res != nil && res.StatusCode == http.StatusNotModified { 8606 if res.Body != nil { 8607 res.Body.Close() 8608 } 8609 return nil, gensupport.WrapError(&googleapi.Error{ 8610 Code: res.StatusCode, 8611 Header: res.Header, 8612 }) 8613 } 8614 if err != nil { 8615 return nil, err 8616 } 8617 defer googleapi.CloseBody(res) 8618 if err := googleapi.CheckResponse(res); err != nil { 8619 return nil, gensupport.WrapError(err) 8620 } 8621 ret := &GoogleCloudRetailV2betaCompleteQueryResponse{ 8622 ServerResponse: googleapi.ServerResponse{ 8623 Header: res.Header, 8624 HTTPStatusCode: res.StatusCode, 8625 }, 8626 } 8627 target := &ret 8628 if err := gensupport.DecodeResponse(target, res); err != nil { 8629 return nil, err 8630 } 8631 return ret, nil 8632 } 8633 8634 type ProjectsLocationsCatalogsExportAnalyticsMetricsCall struct { 8635 s *Service 8636 catalog string 8637 googlecloudretailv2betaexportanalyticsmetricsrequest *GoogleCloudRetailV2betaExportAnalyticsMetricsRequest 8638 urlParams_ gensupport.URLParams 8639 ctx_ context.Context 8640 header_ http.Header 8641 } 8642 8643 // ExportAnalyticsMetrics: Exports analytics metrics. `Operation.response` is 8644 // of type `ExportAnalyticsMetricsResponse`. `Operation.metadata` is of type 8645 // `ExportMetadata`. 8646 // 8647 // - catalog: Full resource name of the parent catalog. Expected format: 8648 // `projects/*/locations/*/catalogs/*`. 8649 func (r *ProjectsLocationsCatalogsService) ExportAnalyticsMetrics(catalog string, googlecloudretailv2betaexportanalyticsmetricsrequest *GoogleCloudRetailV2betaExportAnalyticsMetricsRequest) *ProjectsLocationsCatalogsExportAnalyticsMetricsCall { 8650 c := &ProjectsLocationsCatalogsExportAnalyticsMetricsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8651 c.catalog = catalog 8652 c.googlecloudretailv2betaexportanalyticsmetricsrequest = googlecloudretailv2betaexportanalyticsmetricsrequest 8653 return c 8654 } 8655 8656 // Fields allows partial responses to be retrieved. See 8657 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 8658 // details. 8659 func (c *ProjectsLocationsCatalogsExportAnalyticsMetricsCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsExportAnalyticsMetricsCall { 8660 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8661 return c 8662 } 8663 8664 // Context sets the context to be used in this call's Do method. 8665 func (c *ProjectsLocationsCatalogsExportAnalyticsMetricsCall) Context(ctx context.Context) *ProjectsLocationsCatalogsExportAnalyticsMetricsCall { 8666 c.ctx_ = ctx 8667 return c 8668 } 8669 8670 // Header returns a http.Header that can be modified by the caller to add 8671 // headers to the request. 8672 func (c *ProjectsLocationsCatalogsExportAnalyticsMetricsCall) Header() http.Header { 8673 if c.header_ == nil { 8674 c.header_ = make(http.Header) 8675 } 8676 return c.header_ 8677 } 8678 8679 func (c *ProjectsLocationsCatalogsExportAnalyticsMetricsCall) doRequest(alt string) (*http.Response, error) { 8680 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 8681 var body io.Reader = nil 8682 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betaexportanalyticsmetricsrequest) 8683 if err != nil { 8684 return nil, err 8685 } 8686 c.urlParams_.Set("alt", alt) 8687 c.urlParams_.Set("prettyPrint", "false") 8688 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+catalog}:exportAnalyticsMetrics") 8689 urls += "?" + c.urlParams_.Encode() 8690 req, err := http.NewRequest("POST", urls, body) 8691 if err != nil { 8692 return nil, err 8693 } 8694 req.Header = reqHeaders 8695 googleapi.Expand(req.URL, map[string]string{ 8696 "catalog": c.catalog, 8697 }) 8698 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8699 } 8700 8701 // Do executes the "retail.projects.locations.catalogs.exportAnalyticsMetrics" call. 8702 // Any non-2xx status code is an error. Response headers are in either 8703 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was 8704 // returned at all) in error.(*googleapi.Error).Header. Use 8705 // googleapi.IsNotModified to check whether the returned error was because 8706 // http.StatusNotModified was returned. 8707 func (c *ProjectsLocationsCatalogsExportAnalyticsMetricsCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 8708 gensupport.SetOptions(c.urlParams_, opts...) 8709 res, err := c.doRequest("json") 8710 if res != nil && res.StatusCode == http.StatusNotModified { 8711 if res.Body != nil { 8712 res.Body.Close() 8713 } 8714 return nil, gensupport.WrapError(&googleapi.Error{ 8715 Code: res.StatusCode, 8716 Header: res.Header, 8717 }) 8718 } 8719 if err != nil { 8720 return nil, err 8721 } 8722 defer googleapi.CloseBody(res) 8723 if err := googleapi.CheckResponse(res); err != nil { 8724 return nil, gensupport.WrapError(err) 8725 } 8726 ret := &GoogleLongrunningOperation{ 8727 ServerResponse: googleapi.ServerResponse{ 8728 Header: res.Header, 8729 HTTPStatusCode: res.StatusCode, 8730 }, 8731 } 8732 target := &ret 8733 if err := gensupport.DecodeResponse(target, res); err != nil { 8734 return nil, err 8735 } 8736 return ret, nil 8737 } 8738 8739 type ProjectsLocationsCatalogsGetAttributesConfigCall struct { 8740 s *Service 8741 name string 8742 urlParams_ gensupport.URLParams 8743 ifNoneMatch_ string 8744 ctx_ context.Context 8745 header_ http.Header 8746 } 8747 8748 // GetAttributesConfig: Gets an AttributesConfig. 8749 // 8750 // - name: Full AttributesConfig resource name. Format: 8751 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/at 8752 // tributesConfig`. 8753 func (r *ProjectsLocationsCatalogsService) GetAttributesConfig(name string) *ProjectsLocationsCatalogsGetAttributesConfigCall { 8754 c := &ProjectsLocationsCatalogsGetAttributesConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8755 c.name = name 8756 return c 8757 } 8758 8759 // Fields allows partial responses to be retrieved. See 8760 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 8761 // details. 8762 func (c *ProjectsLocationsCatalogsGetAttributesConfigCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsGetAttributesConfigCall { 8763 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8764 return c 8765 } 8766 8767 // IfNoneMatch sets an optional parameter which makes the operation fail if the 8768 // object's ETag matches the given value. This is useful for getting updates 8769 // only after the object has changed since the last request. 8770 func (c *ProjectsLocationsCatalogsGetAttributesConfigCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsGetAttributesConfigCall { 8771 c.ifNoneMatch_ = entityTag 8772 return c 8773 } 8774 8775 // Context sets the context to be used in this call's Do method. 8776 func (c *ProjectsLocationsCatalogsGetAttributesConfigCall) Context(ctx context.Context) *ProjectsLocationsCatalogsGetAttributesConfigCall { 8777 c.ctx_ = ctx 8778 return c 8779 } 8780 8781 // Header returns a http.Header that can be modified by the caller to add 8782 // headers to the request. 8783 func (c *ProjectsLocationsCatalogsGetAttributesConfigCall) Header() http.Header { 8784 if c.header_ == nil { 8785 c.header_ = make(http.Header) 8786 } 8787 return c.header_ 8788 } 8789 8790 func (c *ProjectsLocationsCatalogsGetAttributesConfigCall) doRequest(alt string) (*http.Response, error) { 8791 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 8792 if c.ifNoneMatch_ != "" { 8793 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8794 } 8795 var body io.Reader = nil 8796 c.urlParams_.Set("alt", alt) 8797 c.urlParams_.Set("prettyPrint", "false") 8798 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}") 8799 urls += "?" + c.urlParams_.Encode() 8800 req, err := http.NewRequest("GET", urls, body) 8801 if err != nil { 8802 return nil, err 8803 } 8804 req.Header = reqHeaders 8805 googleapi.Expand(req.URL, map[string]string{ 8806 "name": c.name, 8807 }) 8808 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8809 } 8810 8811 // Do executes the "retail.projects.locations.catalogs.getAttributesConfig" call. 8812 // Any non-2xx status code is an error. Response headers are in either 8813 // *GoogleCloudRetailV2betaAttributesConfig.ServerResponse.Header or (if a 8814 // response was returned at all) in error.(*googleapi.Error).Header. Use 8815 // googleapi.IsNotModified to check whether the returned error was because 8816 // http.StatusNotModified was returned. 8817 func (c *ProjectsLocationsCatalogsGetAttributesConfigCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2betaAttributesConfig, error) { 8818 gensupport.SetOptions(c.urlParams_, opts...) 8819 res, err := c.doRequest("json") 8820 if res != nil && res.StatusCode == http.StatusNotModified { 8821 if res.Body != nil { 8822 res.Body.Close() 8823 } 8824 return nil, gensupport.WrapError(&googleapi.Error{ 8825 Code: res.StatusCode, 8826 Header: res.Header, 8827 }) 8828 } 8829 if err != nil { 8830 return nil, err 8831 } 8832 defer googleapi.CloseBody(res) 8833 if err := googleapi.CheckResponse(res); err != nil { 8834 return nil, gensupport.WrapError(err) 8835 } 8836 ret := &GoogleCloudRetailV2betaAttributesConfig{ 8837 ServerResponse: googleapi.ServerResponse{ 8838 Header: res.Header, 8839 HTTPStatusCode: res.StatusCode, 8840 }, 8841 } 8842 target := &ret 8843 if err := gensupport.DecodeResponse(target, res); err != nil { 8844 return nil, err 8845 } 8846 return ret, nil 8847 } 8848 8849 type ProjectsLocationsCatalogsGetCompletionConfigCall struct { 8850 s *Service 8851 name string 8852 urlParams_ gensupport.URLParams 8853 ifNoneMatch_ string 8854 ctx_ context.Context 8855 header_ http.Header 8856 } 8857 8858 // GetCompletionConfig: Gets a CompletionConfig. 8859 // 8860 // - name: Full CompletionConfig resource name. Format: 8861 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/co 8862 // mpletionConfig`. 8863 func (r *ProjectsLocationsCatalogsService) GetCompletionConfig(name string) *ProjectsLocationsCatalogsGetCompletionConfigCall { 8864 c := &ProjectsLocationsCatalogsGetCompletionConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8865 c.name = name 8866 return c 8867 } 8868 8869 // Fields allows partial responses to be retrieved. See 8870 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 8871 // details. 8872 func (c *ProjectsLocationsCatalogsGetCompletionConfigCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsGetCompletionConfigCall { 8873 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8874 return c 8875 } 8876 8877 // IfNoneMatch sets an optional parameter which makes the operation fail if the 8878 // object's ETag matches the given value. This is useful for getting updates 8879 // only after the object has changed since the last request. 8880 func (c *ProjectsLocationsCatalogsGetCompletionConfigCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsGetCompletionConfigCall { 8881 c.ifNoneMatch_ = entityTag 8882 return c 8883 } 8884 8885 // Context sets the context to be used in this call's Do method. 8886 func (c *ProjectsLocationsCatalogsGetCompletionConfigCall) Context(ctx context.Context) *ProjectsLocationsCatalogsGetCompletionConfigCall { 8887 c.ctx_ = ctx 8888 return c 8889 } 8890 8891 // Header returns a http.Header that can be modified by the caller to add 8892 // headers to the request. 8893 func (c *ProjectsLocationsCatalogsGetCompletionConfigCall) Header() http.Header { 8894 if c.header_ == nil { 8895 c.header_ = make(http.Header) 8896 } 8897 return c.header_ 8898 } 8899 8900 func (c *ProjectsLocationsCatalogsGetCompletionConfigCall) doRequest(alt string) (*http.Response, error) { 8901 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 8902 if c.ifNoneMatch_ != "" { 8903 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8904 } 8905 var body io.Reader = nil 8906 c.urlParams_.Set("alt", alt) 8907 c.urlParams_.Set("prettyPrint", "false") 8908 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}") 8909 urls += "?" + c.urlParams_.Encode() 8910 req, err := http.NewRequest("GET", urls, body) 8911 if err != nil { 8912 return nil, err 8913 } 8914 req.Header = reqHeaders 8915 googleapi.Expand(req.URL, map[string]string{ 8916 "name": c.name, 8917 }) 8918 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8919 } 8920 8921 // Do executes the "retail.projects.locations.catalogs.getCompletionConfig" call. 8922 // Any non-2xx status code is an error. Response headers are in either 8923 // *GoogleCloudRetailV2betaCompletionConfig.ServerResponse.Header or (if a 8924 // response was returned at all) in error.(*googleapi.Error).Header. Use 8925 // googleapi.IsNotModified to check whether the returned error was because 8926 // http.StatusNotModified was returned. 8927 func (c *ProjectsLocationsCatalogsGetCompletionConfigCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2betaCompletionConfig, error) { 8928 gensupport.SetOptions(c.urlParams_, opts...) 8929 res, err := c.doRequest("json") 8930 if res != nil && res.StatusCode == http.StatusNotModified { 8931 if res.Body != nil { 8932 res.Body.Close() 8933 } 8934 return nil, gensupport.WrapError(&googleapi.Error{ 8935 Code: res.StatusCode, 8936 Header: res.Header, 8937 }) 8938 } 8939 if err != nil { 8940 return nil, err 8941 } 8942 defer googleapi.CloseBody(res) 8943 if err := googleapi.CheckResponse(res); err != nil { 8944 return nil, gensupport.WrapError(err) 8945 } 8946 ret := &GoogleCloudRetailV2betaCompletionConfig{ 8947 ServerResponse: googleapi.ServerResponse{ 8948 Header: res.Header, 8949 HTTPStatusCode: res.StatusCode, 8950 }, 8951 } 8952 target := &ret 8953 if err := gensupport.DecodeResponse(target, res); err != nil { 8954 return nil, err 8955 } 8956 return ret, nil 8957 } 8958 8959 type ProjectsLocationsCatalogsGetDefaultBranchCall struct { 8960 s *Service 8961 catalog string 8962 urlParams_ gensupport.URLParams 8963 ifNoneMatch_ string 8964 ctx_ context.Context 8965 header_ http.Header 8966 } 8967 8968 // GetDefaultBranch: Get which branch is currently default branch set by 8969 // CatalogService.SetDefaultBranch method under a specified parent catalog. 8970 // 8971 // - catalog: The parent catalog resource name, such as 8972 // `projects/*/locations/global/catalogs/default_catalog`. 8973 func (r *ProjectsLocationsCatalogsService) GetDefaultBranch(catalog string) *ProjectsLocationsCatalogsGetDefaultBranchCall { 8974 c := &ProjectsLocationsCatalogsGetDefaultBranchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8975 c.catalog = catalog 8976 return c 8977 } 8978 8979 // Fields allows partial responses to be retrieved. See 8980 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 8981 // details. 8982 func (c *ProjectsLocationsCatalogsGetDefaultBranchCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsGetDefaultBranchCall { 8983 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8984 return c 8985 } 8986 8987 // IfNoneMatch sets an optional parameter which makes the operation fail if the 8988 // object's ETag matches the given value. This is useful for getting updates 8989 // only after the object has changed since the last request. 8990 func (c *ProjectsLocationsCatalogsGetDefaultBranchCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsGetDefaultBranchCall { 8991 c.ifNoneMatch_ = entityTag 8992 return c 8993 } 8994 8995 // Context sets the context to be used in this call's Do method. 8996 func (c *ProjectsLocationsCatalogsGetDefaultBranchCall) Context(ctx context.Context) *ProjectsLocationsCatalogsGetDefaultBranchCall { 8997 c.ctx_ = ctx 8998 return c 8999 } 9000 9001 // Header returns a http.Header that can be modified by the caller to add 9002 // headers to the request. 9003 func (c *ProjectsLocationsCatalogsGetDefaultBranchCall) Header() http.Header { 9004 if c.header_ == nil { 9005 c.header_ = make(http.Header) 9006 } 9007 return c.header_ 9008 } 9009 9010 func (c *ProjectsLocationsCatalogsGetDefaultBranchCall) doRequest(alt string) (*http.Response, error) { 9011 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 9012 if c.ifNoneMatch_ != "" { 9013 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9014 } 9015 var body io.Reader = nil 9016 c.urlParams_.Set("alt", alt) 9017 c.urlParams_.Set("prettyPrint", "false") 9018 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+catalog}:getDefaultBranch") 9019 urls += "?" + c.urlParams_.Encode() 9020 req, err := http.NewRequest("GET", urls, body) 9021 if err != nil { 9022 return nil, err 9023 } 9024 req.Header = reqHeaders 9025 googleapi.Expand(req.URL, map[string]string{ 9026 "catalog": c.catalog, 9027 }) 9028 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9029 } 9030 9031 // Do executes the "retail.projects.locations.catalogs.getDefaultBranch" call. 9032 // Any non-2xx status code is an error. Response headers are in either 9033 // *GoogleCloudRetailV2betaGetDefaultBranchResponse.ServerResponse.Header or 9034 // (if a response was returned at all) in error.(*googleapi.Error).Header. Use 9035 // googleapi.IsNotModified to check whether the returned error was because 9036 // http.StatusNotModified was returned. 9037 func (c *ProjectsLocationsCatalogsGetDefaultBranchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2betaGetDefaultBranchResponse, error) { 9038 gensupport.SetOptions(c.urlParams_, opts...) 9039 res, err := c.doRequest("json") 9040 if res != nil && res.StatusCode == http.StatusNotModified { 9041 if res.Body != nil { 9042 res.Body.Close() 9043 } 9044 return nil, gensupport.WrapError(&googleapi.Error{ 9045 Code: res.StatusCode, 9046 Header: res.Header, 9047 }) 9048 } 9049 if err != nil { 9050 return nil, err 9051 } 9052 defer googleapi.CloseBody(res) 9053 if err := googleapi.CheckResponse(res); err != nil { 9054 return nil, gensupport.WrapError(err) 9055 } 9056 ret := &GoogleCloudRetailV2betaGetDefaultBranchResponse{ 9057 ServerResponse: googleapi.ServerResponse{ 9058 Header: res.Header, 9059 HTTPStatusCode: res.StatusCode, 9060 }, 9061 } 9062 target := &ret 9063 if err := gensupport.DecodeResponse(target, res); err != nil { 9064 return nil, err 9065 } 9066 return ret, nil 9067 } 9068 9069 type ProjectsLocationsCatalogsListCall struct { 9070 s *Service 9071 parent string 9072 urlParams_ gensupport.URLParams 9073 ifNoneMatch_ string 9074 ctx_ context.Context 9075 header_ http.Header 9076 } 9077 9078 // List: Lists all the Catalogs associated with the project. 9079 // 9080 // - parent: The account resource name with an associated location. If the 9081 // caller does not have permission to list Catalogs under this location, 9082 // regardless of whether or not this location exists, a PERMISSION_DENIED 9083 // error is returned. 9084 func (r *ProjectsLocationsCatalogsService) List(parent string) *ProjectsLocationsCatalogsListCall { 9085 c := &ProjectsLocationsCatalogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9086 c.parent = parent 9087 return c 9088 } 9089 9090 // PageSize sets the optional parameter "pageSize": Maximum number of Catalogs 9091 // to return. If unspecified, defaults to 50. The maximum allowed value is 9092 // 1000. Values above 1000 will be coerced to 1000. If this field is negative, 9093 // an INVALID_ARGUMENT is returned. 9094 func (c *ProjectsLocationsCatalogsListCall) PageSize(pageSize int64) *ProjectsLocationsCatalogsListCall { 9095 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 9096 return c 9097 } 9098 9099 // PageToken sets the optional parameter "pageToken": A page token 9100 // ListCatalogsResponse.next_page_token, received from a previous 9101 // CatalogService.ListCatalogs call. Provide this to retrieve the subsequent 9102 // page. When paginating, all other parameters provided to 9103 // CatalogService.ListCatalogs must match the call that provided the page 9104 // token. Otherwise, an INVALID_ARGUMENT error is returned. 9105 func (c *ProjectsLocationsCatalogsListCall) PageToken(pageToken string) *ProjectsLocationsCatalogsListCall { 9106 c.urlParams_.Set("pageToken", pageToken) 9107 return c 9108 } 9109 9110 // Fields allows partial responses to be retrieved. See 9111 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 9112 // details. 9113 func (c *ProjectsLocationsCatalogsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsListCall { 9114 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9115 return c 9116 } 9117 9118 // IfNoneMatch sets an optional parameter which makes the operation fail if the 9119 // object's ETag matches the given value. This is useful for getting updates 9120 // only after the object has changed since the last request. 9121 func (c *ProjectsLocationsCatalogsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsListCall { 9122 c.ifNoneMatch_ = entityTag 9123 return c 9124 } 9125 9126 // Context sets the context to be used in this call's Do method. 9127 func (c *ProjectsLocationsCatalogsListCall) Context(ctx context.Context) *ProjectsLocationsCatalogsListCall { 9128 c.ctx_ = ctx 9129 return c 9130 } 9131 9132 // Header returns a http.Header that can be modified by the caller to add 9133 // headers to the request. 9134 func (c *ProjectsLocationsCatalogsListCall) Header() http.Header { 9135 if c.header_ == nil { 9136 c.header_ = make(http.Header) 9137 } 9138 return c.header_ 9139 } 9140 9141 func (c *ProjectsLocationsCatalogsListCall) doRequest(alt string) (*http.Response, error) { 9142 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 9143 if c.ifNoneMatch_ != "" { 9144 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9145 } 9146 var body io.Reader = nil 9147 c.urlParams_.Set("alt", alt) 9148 c.urlParams_.Set("prettyPrint", "false") 9149 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+parent}/catalogs") 9150 urls += "?" + c.urlParams_.Encode() 9151 req, err := http.NewRequest("GET", urls, body) 9152 if err != nil { 9153 return nil, err 9154 } 9155 req.Header = reqHeaders 9156 googleapi.Expand(req.URL, map[string]string{ 9157 "parent": c.parent, 9158 }) 9159 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9160 } 9161 9162 // Do executes the "retail.projects.locations.catalogs.list" call. 9163 // Any non-2xx status code is an error. Response headers are in either 9164 // *GoogleCloudRetailV2betaListCatalogsResponse.ServerResponse.Header or (if a 9165 // response was returned at all) in error.(*googleapi.Error).Header. Use 9166 // googleapi.IsNotModified to check whether the returned error was because 9167 // http.StatusNotModified was returned. 9168 func (c *ProjectsLocationsCatalogsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2betaListCatalogsResponse, error) { 9169 gensupport.SetOptions(c.urlParams_, opts...) 9170 res, err := c.doRequest("json") 9171 if res != nil && res.StatusCode == http.StatusNotModified { 9172 if res.Body != nil { 9173 res.Body.Close() 9174 } 9175 return nil, gensupport.WrapError(&googleapi.Error{ 9176 Code: res.StatusCode, 9177 Header: res.Header, 9178 }) 9179 } 9180 if err != nil { 9181 return nil, err 9182 } 9183 defer googleapi.CloseBody(res) 9184 if err := googleapi.CheckResponse(res); err != nil { 9185 return nil, gensupport.WrapError(err) 9186 } 9187 ret := &GoogleCloudRetailV2betaListCatalogsResponse{ 9188 ServerResponse: googleapi.ServerResponse{ 9189 Header: res.Header, 9190 HTTPStatusCode: res.StatusCode, 9191 }, 9192 } 9193 target := &ret 9194 if err := gensupport.DecodeResponse(target, res); err != nil { 9195 return nil, err 9196 } 9197 return ret, nil 9198 } 9199 9200 // Pages invokes f for each page of results. 9201 // A non-nil error returned from f will halt the iteration. 9202 // The provided context supersedes any context provided to the Context method. 9203 func (c *ProjectsLocationsCatalogsListCall) Pages(ctx context.Context, f func(*GoogleCloudRetailV2betaListCatalogsResponse) error) error { 9204 c.ctx_ = ctx 9205 defer c.PageToken(c.urlParams_.Get("pageToken")) 9206 for { 9207 x, err := c.Do() 9208 if err != nil { 9209 return err 9210 } 9211 if err := f(x); err != nil { 9212 return err 9213 } 9214 if x.NextPageToken == "" { 9215 return nil 9216 } 9217 c.PageToken(x.NextPageToken) 9218 } 9219 } 9220 9221 type ProjectsLocationsCatalogsPatchCall struct { 9222 s *Service 9223 name string 9224 googlecloudretailv2betacatalog *GoogleCloudRetailV2betaCatalog 9225 urlParams_ gensupport.URLParams 9226 ctx_ context.Context 9227 header_ http.Header 9228 } 9229 9230 // Patch: Updates the Catalogs. 9231 // 9232 // - name: Immutable. The fully qualified resource name of the catalog. 9233 func (r *ProjectsLocationsCatalogsService) Patch(name string, googlecloudretailv2betacatalog *GoogleCloudRetailV2betaCatalog) *ProjectsLocationsCatalogsPatchCall { 9234 c := &ProjectsLocationsCatalogsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9235 c.name = name 9236 c.googlecloudretailv2betacatalog = googlecloudretailv2betacatalog 9237 return c 9238 } 9239 9240 // UpdateMask sets the optional parameter "updateMask": Indicates which fields 9241 // in the provided Catalog to update. If an unsupported or unknown field is 9242 // provided, an INVALID_ARGUMENT error is returned. 9243 func (c *ProjectsLocationsCatalogsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsCatalogsPatchCall { 9244 c.urlParams_.Set("updateMask", updateMask) 9245 return c 9246 } 9247 9248 // Fields allows partial responses to be retrieved. See 9249 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 9250 // details. 9251 func (c *ProjectsLocationsCatalogsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsPatchCall { 9252 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9253 return c 9254 } 9255 9256 // Context sets the context to be used in this call's Do method. 9257 func (c *ProjectsLocationsCatalogsPatchCall) Context(ctx context.Context) *ProjectsLocationsCatalogsPatchCall { 9258 c.ctx_ = ctx 9259 return c 9260 } 9261 9262 // Header returns a http.Header that can be modified by the caller to add 9263 // headers to the request. 9264 func (c *ProjectsLocationsCatalogsPatchCall) Header() http.Header { 9265 if c.header_ == nil { 9266 c.header_ = make(http.Header) 9267 } 9268 return c.header_ 9269 } 9270 9271 func (c *ProjectsLocationsCatalogsPatchCall) doRequest(alt string) (*http.Response, error) { 9272 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 9273 var body io.Reader = nil 9274 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betacatalog) 9275 if err != nil { 9276 return nil, err 9277 } 9278 c.urlParams_.Set("alt", alt) 9279 c.urlParams_.Set("prettyPrint", "false") 9280 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}") 9281 urls += "?" + c.urlParams_.Encode() 9282 req, err := http.NewRequest("PATCH", urls, body) 9283 if err != nil { 9284 return nil, err 9285 } 9286 req.Header = reqHeaders 9287 googleapi.Expand(req.URL, map[string]string{ 9288 "name": c.name, 9289 }) 9290 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9291 } 9292 9293 // Do executes the "retail.projects.locations.catalogs.patch" call. 9294 // Any non-2xx status code is an error. Response headers are in either 9295 // *GoogleCloudRetailV2betaCatalog.ServerResponse.Header or (if a response was 9296 // returned at all) in error.(*googleapi.Error).Header. Use 9297 // googleapi.IsNotModified to check whether the returned error was because 9298 // http.StatusNotModified was returned. 9299 func (c *ProjectsLocationsCatalogsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2betaCatalog, error) { 9300 gensupport.SetOptions(c.urlParams_, opts...) 9301 res, err := c.doRequest("json") 9302 if res != nil && res.StatusCode == http.StatusNotModified { 9303 if res.Body != nil { 9304 res.Body.Close() 9305 } 9306 return nil, gensupport.WrapError(&googleapi.Error{ 9307 Code: res.StatusCode, 9308 Header: res.Header, 9309 }) 9310 } 9311 if err != nil { 9312 return nil, err 9313 } 9314 defer googleapi.CloseBody(res) 9315 if err := googleapi.CheckResponse(res); err != nil { 9316 return nil, gensupport.WrapError(err) 9317 } 9318 ret := &GoogleCloudRetailV2betaCatalog{ 9319 ServerResponse: googleapi.ServerResponse{ 9320 Header: res.Header, 9321 HTTPStatusCode: res.StatusCode, 9322 }, 9323 } 9324 target := &ret 9325 if err := gensupport.DecodeResponse(target, res); err != nil { 9326 return nil, err 9327 } 9328 return ret, nil 9329 } 9330 9331 type ProjectsLocationsCatalogsSetDefaultBranchCall struct { 9332 s *Service 9333 catalog string 9334 googlecloudretailv2betasetdefaultbranchrequest *GoogleCloudRetailV2betaSetDefaultBranchRequest 9335 urlParams_ gensupport.URLParams 9336 ctx_ context.Context 9337 header_ http.Header 9338 } 9339 9340 // SetDefaultBranch: Set a specified branch id as default branch. API methods 9341 // such as SearchService.Search, ProductService.GetProduct, 9342 // ProductService.ListProducts will treat requests using "default_branch" to 9343 // the actual branch id set as default. For example, if 9344 // `projects/*/locations/*/catalogs/*/branches/1` is set as default, setting 9345 // SearchRequest.branch to 9346 // `projects/*/locations/*/catalogs/*/branches/default_branch` is equivalent to 9347 // setting SearchRequest.branch to 9348 // `projects/*/locations/*/catalogs/*/branches/1`. Using multiple branches can 9349 // be useful when developers would like to have a staging branch to test and 9350 // verify for future usage. When it becomes ready, developers switch on the 9351 // staging branch using this API while keeping using 9352 // `projects/*/locations/*/catalogs/*/branches/default_branch` as 9353 // SearchRequest.branch to route the traffic to this staging branch. CAUTION: 9354 // If you have live predict/search traffic, switching the default branch could 9355 // potentially cause outages if the ID space of the new branch is very 9356 // different from the old one. More specifically: * PredictionService will only 9357 // return product IDs from branch {newBranch}. * SearchService will only return 9358 // product IDs from branch {newBranch} (if branch is not explicitly set). * 9359 // UserEventService will only join events with products from branch 9360 // {newBranch}. 9361 // 9362 // - catalog: Full resource name of the catalog, such as 9363 // `projects/*/locations/global/catalogs/default_catalog`. 9364 func (r *ProjectsLocationsCatalogsService) SetDefaultBranch(catalog string, googlecloudretailv2betasetdefaultbranchrequest *GoogleCloudRetailV2betaSetDefaultBranchRequest) *ProjectsLocationsCatalogsSetDefaultBranchCall { 9365 c := &ProjectsLocationsCatalogsSetDefaultBranchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9366 c.catalog = catalog 9367 c.googlecloudretailv2betasetdefaultbranchrequest = googlecloudretailv2betasetdefaultbranchrequest 9368 return c 9369 } 9370 9371 // Fields allows partial responses to be retrieved. See 9372 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 9373 // details. 9374 func (c *ProjectsLocationsCatalogsSetDefaultBranchCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsSetDefaultBranchCall { 9375 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9376 return c 9377 } 9378 9379 // Context sets the context to be used in this call's Do method. 9380 func (c *ProjectsLocationsCatalogsSetDefaultBranchCall) Context(ctx context.Context) *ProjectsLocationsCatalogsSetDefaultBranchCall { 9381 c.ctx_ = ctx 9382 return c 9383 } 9384 9385 // Header returns a http.Header that can be modified by the caller to add 9386 // headers to the request. 9387 func (c *ProjectsLocationsCatalogsSetDefaultBranchCall) Header() http.Header { 9388 if c.header_ == nil { 9389 c.header_ = make(http.Header) 9390 } 9391 return c.header_ 9392 } 9393 9394 func (c *ProjectsLocationsCatalogsSetDefaultBranchCall) doRequest(alt string) (*http.Response, error) { 9395 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 9396 var body io.Reader = nil 9397 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betasetdefaultbranchrequest) 9398 if err != nil { 9399 return nil, err 9400 } 9401 c.urlParams_.Set("alt", alt) 9402 c.urlParams_.Set("prettyPrint", "false") 9403 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+catalog}:setDefaultBranch") 9404 urls += "?" + c.urlParams_.Encode() 9405 req, err := http.NewRequest("POST", urls, body) 9406 if err != nil { 9407 return nil, err 9408 } 9409 req.Header = reqHeaders 9410 googleapi.Expand(req.URL, map[string]string{ 9411 "catalog": c.catalog, 9412 }) 9413 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9414 } 9415 9416 // Do executes the "retail.projects.locations.catalogs.setDefaultBranch" call. 9417 // Any non-2xx status code is an error. Response headers are in either 9418 // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at 9419 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 9420 // check whether the returned error was because http.StatusNotModified was 9421 // returned. 9422 func (c *ProjectsLocationsCatalogsSetDefaultBranchCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { 9423 gensupport.SetOptions(c.urlParams_, opts...) 9424 res, err := c.doRequest("json") 9425 if res != nil && res.StatusCode == http.StatusNotModified { 9426 if res.Body != nil { 9427 res.Body.Close() 9428 } 9429 return nil, gensupport.WrapError(&googleapi.Error{ 9430 Code: res.StatusCode, 9431 Header: res.Header, 9432 }) 9433 } 9434 if err != nil { 9435 return nil, err 9436 } 9437 defer googleapi.CloseBody(res) 9438 if err := googleapi.CheckResponse(res); err != nil { 9439 return nil, gensupport.WrapError(err) 9440 } 9441 ret := &GoogleProtobufEmpty{ 9442 ServerResponse: googleapi.ServerResponse{ 9443 Header: res.Header, 9444 HTTPStatusCode: res.StatusCode, 9445 }, 9446 } 9447 target := &ret 9448 if err := gensupport.DecodeResponse(target, res); err != nil { 9449 return nil, err 9450 } 9451 return ret, nil 9452 } 9453 9454 type ProjectsLocationsCatalogsUpdateAttributesConfigCall struct { 9455 s *Service 9456 name string 9457 googlecloudretailv2betaattributesconfig *GoogleCloudRetailV2betaAttributesConfig 9458 urlParams_ gensupport.URLParams 9459 ctx_ context.Context 9460 header_ http.Header 9461 } 9462 9463 // UpdateAttributesConfig: Updates the AttributesConfig. The catalog attributes 9464 // in the request will be updated in the catalog, or inserted if they do not 9465 // exist. Existing catalog attributes not included in the request will remain 9466 // unchanged. Attributes that are assigned to products, but do not exist at the 9467 // catalog level, are always included in the response. The product attribute is 9468 // assigned default values for missing catalog attribute fields, e.g., 9469 // searchable and dynamic facetable options. 9470 // 9471 // - name: Immutable. The fully qualified resource name of the attribute 9472 // config. Format: `projects/*/locations/*/catalogs/*/attributesConfig`. 9473 func (r *ProjectsLocationsCatalogsService) UpdateAttributesConfig(name string, googlecloudretailv2betaattributesconfig *GoogleCloudRetailV2betaAttributesConfig) *ProjectsLocationsCatalogsUpdateAttributesConfigCall { 9474 c := &ProjectsLocationsCatalogsUpdateAttributesConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9475 c.name = name 9476 c.googlecloudretailv2betaattributesconfig = googlecloudretailv2betaattributesconfig 9477 return c 9478 } 9479 9480 // UpdateMask sets the optional parameter "updateMask": Indicates which fields 9481 // in the provided AttributesConfig to update. The following is the only 9482 // supported field: * AttributesConfig.catalog_attributes If not set, all 9483 // supported fields are updated. 9484 func (c *ProjectsLocationsCatalogsUpdateAttributesConfigCall) UpdateMask(updateMask string) *ProjectsLocationsCatalogsUpdateAttributesConfigCall { 9485 c.urlParams_.Set("updateMask", updateMask) 9486 return c 9487 } 9488 9489 // Fields allows partial responses to be retrieved. See 9490 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 9491 // details. 9492 func (c *ProjectsLocationsCatalogsUpdateAttributesConfigCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsUpdateAttributesConfigCall { 9493 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9494 return c 9495 } 9496 9497 // Context sets the context to be used in this call's Do method. 9498 func (c *ProjectsLocationsCatalogsUpdateAttributesConfigCall) Context(ctx context.Context) *ProjectsLocationsCatalogsUpdateAttributesConfigCall { 9499 c.ctx_ = ctx 9500 return c 9501 } 9502 9503 // Header returns a http.Header that can be modified by the caller to add 9504 // headers to the request. 9505 func (c *ProjectsLocationsCatalogsUpdateAttributesConfigCall) Header() http.Header { 9506 if c.header_ == nil { 9507 c.header_ = make(http.Header) 9508 } 9509 return c.header_ 9510 } 9511 9512 func (c *ProjectsLocationsCatalogsUpdateAttributesConfigCall) doRequest(alt string) (*http.Response, error) { 9513 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 9514 var body io.Reader = nil 9515 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betaattributesconfig) 9516 if err != nil { 9517 return nil, err 9518 } 9519 c.urlParams_.Set("alt", alt) 9520 c.urlParams_.Set("prettyPrint", "false") 9521 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}") 9522 urls += "?" + c.urlParams_.Encode() 9523 req, err := http.NewRequest("PATCH", urls, body) 9524 if err != nil { 9525 return nil, err 9526 } 9527 req.Header = reqHeaders 9528 googleapi.Expand(req.URL, map[string]string{ 9529 "name": c.name, 9530 }) 9531 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9532 } 9533 9534 // Do executes the "retail.projects.locations.catalogs.updateAttributesConfig" call. 9535 // Any non-2xx status code is an error. Response headers are in either 9536 // *GoogleCloudRetailV2betaAttributesConfig.ServerResponse.Header or (if a 9537 // response was returned at all) in error.(*googleapi.Error).Header. Use 9538 // googleapi.IsNotModified to check whether the returned error was because 9539 // http.StatusNotModified was returned. 9540 func (c *ProjectsLocationsCatalogsUpdateAttributesConfigCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2betaAttributesConfig, error) { 9541 gensupport.SetOptions(c.urlParams_, opts...) 9542 res, err := c.doRequest("json") 9543 if res != nil && res.StatusCode == http.StatusNotModified { 9544 if res.Body != nil { 9545 res.Body.Close() 9546 } 9547 return nil, gensupport.WrapError(&googleapi.Error{ 9548 Code: res.StatusCode, 9549 Header: res.Header, 9550 }) 9551 } 9552 if err != nil { 9553 return nil, err 9554 } 9555 defer googleapi.CloseBody(res) 9556 if err := googleapi.CheckResponse(res); err != nil { 9557 return nil, gensupport.WrapError(err) 9558 } 9559 ret := &GoogleCloudRetailV2betaAttributesConfig{ 9560 ServerResponse: googleapi.ServerResponse{ 9561 Header: res.Header, 9562 HTTPStatusCode: res.StatusCode, 9563 }, 9564 } 9565 target := &ret 9566 if err := gensupport.DecodeResponse(target, res); err != nil { 9567 return nil, err 9568 } 9569 return ret, nil 9570 } 9571 9572 type ProjectsLocationsCatalogsUpdateCompletionConfigCall struct { 9573 s *Service 9574 name string 9575 googlecloudretailv2betacompletionconfig *GoogleCloudRetailV2betaCompletionConfig 9576 urlParams_ gensupport.URLParams 9577 ctx_ context.Context 9578 header_ http.Header 9579 } 9580 9581 // UpdateCompletionConfig: Updates the CompletionConfigs. 9582 // 9583 // - name: Immutable. Fully qualified name 9584 // `projects/*/locations/*/catalogs/*/completionConfig`. 9585 func (r *ProjectsLocationsCatalogsService) UpdateCompletionConfig(name string, googlecloudretailv2betacompletionconfig *GoogleCloudRetailV2betaCompletionConfig) *ProjectsLocationsCatalogsUpdateCompletionConfigCall { 9586 c := &ProjectsLocationsCatalogsUpdateCompletionConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9587 c.name = name 9588 c.googlecloudretailv2betacompletionconfig = googlecloudretailv2betacompletionconfig 9589 return c 9590 } 9591 9592 // UpdateMask sets the optional parameter "updateMask": Indicates which fields 9593 // in the provided CompletionConfig to update. The following are the only 9594 // supported fields: * CompletionConfig.matching_order * 9595 // CompletionConfig.max_suggestions * CompletionConfig.min_prefix_length * 9596 // CompletionConfig.auto_learning If not set, all supported fields are updated. 9597 func (c *ProjectsLocationsCatalogsUpdateCompletionConfigCall) UpdateMask(updateMask string) *ProjectsLocationsCatalogsUpdateCompletionConfigCall { 9598 c.urlParams_.Set("updateMask", updateMask) 9599 return c 9600 } 9601 9602 // Fields allows partial responses to be retrieved. See 9603 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 9604 // details. 9605 func (c *ProjectsLocationsCatalogsUpdateCompletionConfigCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsUpdateCompletionConfigCall { 9606 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9607 return c 9608 } 9609 9610 // Context sets the context to be used in this call's Do method. 9611 func (c *ProjectsLocationsCatalogsUpdateCompletionConfigCall) Context(ctx context.Context) *ProjectsLocationsCatalogsUpdateCompletionConfigCall { 9612 c.ctx_ = ctx 9613 return c 9614 } 9615 9616 // Header returns a http.Header that can be modified by the caller to add 9617 // headers to the request. 9618 func (c *ProjectsLocationsCatalogsUpdateCompletionConfigCall) Header() http.Header { 9619 if c.header_ == nil { 9620 c.header_ = make(http.Header) 9621 } 9622 return c.header_ 9623 } 9624 9625 func (c *ProjectsLocationsCatalogsUpdateCompletionConfigCall) doRequest(alt string) (*http.Response, error) { 9626 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 9627 var body io.Reader = nil 9628 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betacompletionconfig) 9629 if err != nil { 9630 return nil, err 9631 } 9632 c.urlParams_.Set("alt", alt) 9633 c.urlParams_.Set("prettyPrint", "false") 9634 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}") 9635 urls += "?" + c.urlParams_.Encode() 9636 req, err := http.NewRequest("PATCH", urls, body) 9637 if err != nil { 9638 return nil, err 9639 } 9640 req.Header = reqHeaders 9641 googleapi.Expand(req.URL, map[string]string{ 9642 "name": c.name, 9643 }) 9644 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9645 } 9646 9647 // Do executes the "retail.projects.locations.catalogs.updateCompletionConfig" call. 9648 // Any non-2xx status code is an error. Response headers are in either 9649 // *GoogleCloudRetailV2betaCompletionConfig.ServerResponse.Header or (if a 9650 // response was returned at all) in error.(*googleapi.Error).Header. Use 9651 // googleapi.IsNotModified to check whether the returned error was because 9652 // http.StatusNotModified was returned. 9653 func (c *ProjectsLocationsCatalogsUpdateCompletionConfigCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2betaCompletionConfig, error) { 9654 gensupport.SetOptions(c.urlParams_, opts...) 9655 res, err := c.doRequest("json") 9656 if res != nil && res.StatusCode == http.StatusNotModified { 9657 if res.Body != nil { 9658 res.Body.Close() 9659 } 9660 return nil, gensupport.WrapError(&googleapi.Error{ 9661 Code: res.StatusCode, 9662 Header: res.Header, 9663 }) 9664 } 9665 if err != nil { 9666 return nil, err 9667 } 9668 defer googleapi.CloseBody(res) 9669 if err := googleapi.CheckResponse(res); err != nil { 9670 return nil, gensupport.WrapError(err) 9671 } 9672 ret := &GoogleCloudRetailV2betaCompletionConfig{ 9673 ServerResponse: googleapi.ServerResponse{ 9674 Header: res.Header, 9675 HTTPStatusCode: res.StatusCode, 9676 }, 9677 } 9678 target := &ret 9679 if err := gensupport.DecodeResponse(target, res); err != nil { 9680 return nil, err 9681 } 9682 return ret, nil 9683 } 9684 9685 type ProjectsLocationsCatalogsAttributesConfigAddCatalogAttributeCall struct { 9686 s *Service 9687 attributesConfig string 9688 googlecloudretailv2betaaddcatalogattributerequest *GoogleCloudRetailV2betaAddCatalogAttributeRequest 9689 urlParams_ gensupport.URLParams 9690 ctx_ context.Context 9691 header_ http.Header 9692 } 9693 9694 // AddCatalogAttribute: Adds the specified CatalogAttribute to the 9695 // AttributesConfig. If the CatalogAttribute to add already exists, an 9696 // ALREADY_EXISTS error is returned. 9697 // 9698 // - attributesConfig: Full AttributesConfig resource name. Format: 9699 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/at 9700 // tributesConfig`. 9701 func (r *ProjectsLocationsCatalogsAttributesConfigService) AddCatalogAttribute(attributesConfig string, googlecloudretailv2betaaddcatalogattributerequest *GoogleCloudRetailV2betaAddCatalogAttributeRequest) *ProjectsLocationsCatalogsAttributesConfigAddCatalogAttributeCall { 9702 c := &ProjectsLocationsCatalogsAttributesConfigAddCatalogAttributeCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9703 c.attributesConfig = attributesConfig 9704 c.googlecloudretailv2betaaddcatalogattributerequest = googlecloudretailv2betaaddcatalogattributerequest 9705 return c 9706 } 9707 9708 // Fields allows partial responses to be retrieved. See 9709 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 9710 // details. 9711 func (c *ProjectsLocationsCatalogsAttributesConfigAddCatalogAttributeCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsAttributesConfigAddCatalogAttributeCall { 9712 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9713 return c 9714 } 9715 9716 // Context sets the context to be used in this call's Do method. 9717 func (c *ProjectsLocationsCatalogsAttributesConfigAddCatalogAttributeCall) Context(ctx context.Context) *ProjectsLocationsCatalogsAttributesConfigAddCatalogAttributeCall { 9718 c.ctx_ = ctx 9719 return c 9720 } 9721 9722 // Header returns a http.Header that can be modified by the caller to add 9723 // headers to the request. 9724 func (c *ProjectsLocationsCatalogsAttributesConfigAddCatalogAttributeCall) Header() http.Header { 9725 if c.header_ == nil { 9726 c.header_ = make(http.Header) 9727 } 9728 return c.header_ 9729 } 9730 9731 func (c *ProjectsLocationsCatalogsAttributesConfigAddCatalogAttributeCall) doRequest(alt string) (*http.Response, error) { 9732 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 9733 var body io.Reader = nil 9734 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betaaddcatalogattributerequest) 9735 if err != nil { 9736 return nil, err 9737 } 9738 c.urlParams_.Set("alt", alt) 9739 c.urlParams_.Set("prettyPrint", "false") 9740 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+attributesConfig}:addCatalogAttribute") 9741 urls += "?" + c.urlParams_.Encode() 9742 req, err := http.NewRequest("POST", urls, body) 9743 if err != nil { 9744 return nil, err 9745 } 9746 req.Header = reqHeaders 9747 googleapi.Expand(req.URL, map[string]string{ 9748 "attributesConfig": c.attributesConfig, 9749 }) 9750 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9751 } 9752 9753 // Do executes the "retail.projects.locations.catalogs.attributesConfig.addCatalogAttribute" call. 9754 // Any non-2xx status code is an error. Response headers are in either 9755 // *GoogleCloudRetailV2betaAttributesConfig.ServerResponse.Header or (if a 9756 // response was returned at all) in error.(*googleapi.Error).Header. Use 9757 // googleapi.IsNotModified to check whether the returned error was because 9758 // http.StatusNotModified was returned. 9759 func (c *ProjectsLocationsCatalogsAttributesConfigAddCatalogAttributeCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2betaAttributesConfig, error) { 9760 gensupport.SetOptions(c.urlParams_, opts...) 9761 res, err := c.doRequest("json") 9762 if res != nil && res.StatusCode == http.StatusNotModified { 9763 if res.Body != nil { 9764 res.Body.Close() 9765 } 9766 return nil, gensupport.WrapError(&googleapi.Error{ 9767 Code: res.StatusCode, 9768 Header: res.Header, 9769 }) 9770 } 9771 if err != nil { 9772 return nil, err 9773 } 9774 defer googleapi.CloseBody(res) 9775 if err := googleapi.CheckResponse(res); err != nil { 9776 return nil, gensupport.WrapError(err) 9777 } 9778 ret := &GoogleCloudRetailV2betaAttributesConfig{ 9779 ServerResponse: googleapi.ServerResponse{ 9780 Header: res.Header, 9781 HTTPStatusCode: res.StatusCode, 9782 }, 9783 } 9784 target := &ret 9785 if err := gensupport.DecodeResponse(target, res); err != nil { 9786 return nil, err 9787 } 9788 return ret, nil 9789 } 9790 9791 type ProjectsLocationsCatalogsAttributesConfigBatchRemoveCatalogAttributesCall struct { 9792 s *Service 9793 attributesConfig string 9794 googlecloudretailv2betabatchremovecatalogattributesrequest *GoogleCloudRetailV2betaBatchRemoveCatalogAttributesRequest 9795 urlParams_ gensupport.URLParams 9796 ctx_ context.Context 9797 header_ http.Header 9798 } 9799 9800 // BatchRemoveCatalogAttributes: Removes all specified CatalogAttributes from 9801 // the AttributesConfig. 9802 // 9803 // - attributesConfig: The attributes config resource shared by all catalog 9804 // attributes being deleted. Format: 9805 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/at 9806 // tributesConfig`. 9807 func (r *ProjectsLocationsCatalogsAttributesConfigService) BatchRemoveCatalogAttributes(attributesConfig string, googlecloudretailv2betabatchremovecatalogattributesrequest *GoogleCloudRetailV2betaBatchRemoveCatalogAttributesRequest) *ProjectsLocationsCatalogsAttributesConfigBatchRemoveCatalogAttributesCall { 9808 c := &ProjectsLocationsCatalogsAttributesConfigBatchRemoveCatalogAttributesCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9809 c.attributesConfig = attributesConfig 9810 c.googlecloudretailv2betabatchremovecatalogattributesrequest = googlecloudretailv2betabatchremovecatalogattributesrequest 9811 return c 9812 } 9813 9814 // Fields allows partial responses to be retrieved. See 9815 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 9816 // details. 9817 func (c *ProjectsLocationsCatalogsAttributesConfigBatchRemoveCatalogAttributesCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsAttributesConfigBatchRemoveCatalogAttributesCall { 9818 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9819 return c 9820 } 9821 9822 // Context sets the context to be used in this call's Do method. 9823 func (c *ProjectsLocationsCatalogsAttributesConfigBatchRemoveCatalogAttributesCall) Context(ctx context.Context) *ProjectsLocationsCatalogsAttributesConfigBatchRemoveCatalogAttributesCall { 9824 c.ctx_ = ctx 9825 return c 9826 } 9827 9828 // Header returns a http.Header that can be modified by the caller to add 9829 // headers to the request. 9830 func (c *ProjectsLocationsCatalogsAttributesConfigBatchRemoveCatalogAttributesCall) Header() http.Header { 9831 if c.header_ == nil { 9832 c.header_ = make(http.Header) 9833 } 9834 return c.header_ 9835 } 9836 9837 func (c *ProjectsLocationsCatalogsAttributesConfigBatchRemoveCatalogAttributesCall) doRequest(alt string) (*http.Response, error) { 9838 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 9839 var body io.Reader = nil 9840 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betabatchremovecatalogattributesrequest) 9841 if err != nil { 9842 return nil, err 9843 } 9844 c.urlParams_.Set("alt", alt) 9845 c.urlParams_.Set("prettyPrint", "false") 9846 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+attributesConfig}:batchRemoveCatalogAttributes") 9847 urls += "?" + c.urlParams_.Encode() 9848 req, err := http.NewRequest("POST", urls, body) 9849 if err != nil { 9850 return nil, err 9851 } 9852 req.Header = reqHeaders 9853 googleapi.Expand(req.URL, map[string]string{ 9854 "attributesConfig": c.attributesConfig, 9855 }) 9856 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9857 } 9858 9859 // Do executes the "retail.projects.locations.catalogs.attributesConfig.batchRemoveCatalogAttributes" call. 9860 // Any non-2xx status code is an error. Response headers are in either 9861 // *GoogleCloudRetailV2betaBatchRemoveCatalogAttributesResponse.ServerResponse.H 9862 // eader or (if a response was returned at all) in 9863 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 9864 // whether the returned error was because http.StatusNotModified was returned. 9865 func (c *ProjectsLocationsCatalogsAttributesConfigBatchRemoveCatalogAttributesCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2betaBatchRemoveCatalogAttributesResponse, error) { 9866 gensupport.SetOptions(c.urlParams_, opts...) 9867 res, err := c.doRequest("json") 9868 if res != nil && res.StatusCode == http.StatusNotModified { 9869 if res.Body != nil { 9870 res.Body.Close() 9871 } 9872 return nil, gensupport.WrapError(&googleapi.Error{ 9873 Code: res.StatusCode, 9874 Header: res.Header, 9875 }) 9876 } 9877 if err != nil { 9878 return nil, err 9879 } 9880 defer googleapi.CloseBody(res) 9881 if err := googleapi.CheckResponse(res); err != nil { 9882 return nil, gensupport.WrapError(err) 9883 } 9884 ret := &GoogleCloudRetailV2betaBatchRemoveCatalogAttributesResponse{ 9885 ServerResponse: googleapi.ServerResponse{ 9886 Header: res.Header, 9887 HTTPStatusCode: res.StatusCode, 9888 }, 9889 } 9890 target := &ret 9891 if err := gensupport.DecodeResponse(target, res); err != nil { 9892 return nil, err 9893 } 9894 return ret, nil 9895 } 9896 9897 type ProjectsLocationsCatalogsAttributesConfigRemoveCatalogAttributeCall struct { 9898 s *Service 9899 attributesConfig string 9900 googlecloudretailv2betaremovecatalogattributerequest *GoogleCloudRetailV2betaRemoveCatalogAttributeRequest 9901 urlParams_ gensupport.URLParams 9902 ctx_ context.Context 9903 header_ http.Header 9904 } 9905 9906 // RemoveCatalogAttribute: Removes the specified CatalogAttribute from the 9907 // AttributesConfig. If the CatalogAttribute to remove does not exist, a 9908 // NOT_FOUND error is returned. 9909 // 9910 // - attributesConfig: Full AttributesConfig resource name. Format: 9911 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/at 9912 // tributesConfig`. 9913 func (r *ProjectsLocationsCatalogsAttributesConfigService) RemoveCatalogAttribute(attributesConfig string, googlecloudretailv2betaremovecatalogattributerequest *GoogleCloudRetailV2betaRemoveCatalogAttributeRequest) *ProjectsLocationsCatalogsAttributesConfigRemoveCatalogAttributeCall { 9914 c := &ProjectsLocationsCatalogsAttributesConfigRemoveCatalogAttributeCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9915 c.attributesConfig = attributesConfig 9916 c.googlecloudretailv2betaremovecatalogattributerequest = googlecloudretailv2betaremovecatalogattributerequest 9917 return c 9918 } 9919 9920 // Fields allows partial responses to be retrieved. See 9921 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 9922 // details. 9923 func (c *ProjectsLocationsCatalogsAttributesConfigRemoveCatalogAttributeCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsAttributesConfigRemoveCatalogAttributeCall { 9924 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9925 return c 9926 } 9927 9928 // Context sets the context to be used in this call's Do method. 9929 func (c *ProjectsLocationsCatalogsAttributesConfigRemoveCatalogAttributeCall) Context(ctx context.Context) *ProjectsLocationsCatalogsAttributesConfigRemoveCatalogAttributeCall { 9930 c.ctx_ = ctx 9931 return c 9932 } 9933 9934 // Header returns a http.Header that can be modified by the caller to add 9935 // headers to the request. 9936 func (c *ProjectsLocationsCatalogsAttributesConfigRemoveCatalogAttributeCall) Header() http.Header { 9937 if c.header_ == nil { 9938 c.header_ = make(http.Header) 9939 } 9940 return c.header_ 9941 } 9942 9943 func (c *ProjectsLocationsCatalogsAttributesConfigRemoveCatalogAttributeCall) doRequest(alt string) (*http.Response, error) { 9944 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 9945 var body io.Reader = nil 9946 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betaremovecatalogattributerequest) 9947 if err != nil { 9948 return nil, err 9949 } 9950 c.urlParams_.Set("alt", alt) 9951 c.urlParams_.Set("prettyPrint", "false") 9952 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+attributesConfig}:removeCatalogAttribute") 9953 urls += "?" + c.urlParams_.Encode() 9954 req, err := http.NewRequest("POST", urls, body) 9955 if err != nil { 9956 return nil, err 9957 } 9958 req.Header = reqHeaders 9959 googleapi.Expand(req.URL, map[string]string{ 9960 "attributesConfig": c.attributesConfig, 9961 }) 9962 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9963 } 9964 9965 // Do executes the "retail.projects.locations.catalogs.attributesConfig.removeCatalogAttribute" call. 9966 // Any non-2xx status code is an error. Response headers are in either 9967 // *GoogleCloudRetailV2betaAttributesConfig.ServerResponse.Header or (if a 9968 // response was returned at all) in error.(*googleapi.Error).Header. Use 9969 // googleapi.IsNotModified to check whether the returned error was because 9970 // http.StatusNotModified was returned. 9971 func (c *ProjectsLocationsCatalogsAttributesConfigRemoveCatalogAttributeCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2betaAttributesConfig, error) { 9972 gensupport.SetOptions(c.urlParams_, opts...) 9973 res, err := c.doRequest("json") 9974 if res != nil && res.StatusCode == http.StatusNotModified { 9975 if res.Body != nil { 9976 res.Body.Close() 9977 } 9978 return nil, gensupport.WrapError(&googleapi.Error{ 9979 Code: res.StatusCode, 9980 Header: res.Header, 9981 }) 9982 } 9983 if err != nil { 9984 return nil, err 9985 } 9986 defer googleapi.CloseBody(res) 9987 if err := googleapi.CheckResponse(res); err != nil { 9988 return nil, gensupport.WrapError(err) 9989 } 9990 ret := &GoogleCloudRetailV2betaAttributesConfig{ 9991 ServerResponse: googleapi.ServerResponse{ 9992 Header: res.Header, 9993 HTTPStatusCode: res.StatusCode, 9994 }, 9995 } 9996 target := &ret 9997 if err := gensupport.DecodeResponse(target, res); err != nil { 9998 return nil, err 9999 } 10000 return ret, nil 10001 } 10002 10003 type ProjectsLocationsCatalogsAttributesConfigReplaceCatalogAttributeCall struct { 10004 s *Service 10005 attributesConfig string 10006 googlecloudretailv2betareplacecatalogattributerequest *GoogleCloudRetailV2betaReplaceCatalogAttributeRequest 10007 urlParams_ gensupport.URLParams 10008 ctx_ context.Context 10009 header_ http.Header 10010 } 10011 10012 // ReplaceCatalogAttribute: Replaces the specified CatalogAttribute in the 10013 // AttributesConfig by updating the catalog attribute with the same 10014 // CatalogAttribute.key. If the CatalogAttribute to replace does not exist, a 10015 // NOT_FOUND error is returned. 10016 // 10017 // - attributesConfig: Full AttributesConfig resource name. Format: 10018 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/at 10019 // tributesConfig`. 10020 func (r *ProjectsLocationsCatalogsAttributesConfigService) ReplaceCatalogAttribute(attributesConfig string, googlecloudretailv2betareplacecatalogattributerequest *GoogleCloudRetailV2betaReplaceCatalogAttributeRequest) *ProjectsLocationsCatalogsAttributesConfigReplaceCatalogAttributeCall { 10021 c := &ProjectsLocationsCatalogsAttributesConfigReplaceCatalogAttributeCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10022 c.attributesConfig = attributesConfig 10023 c.googlecloudretailv2betareplacecatalogattributerequest = googlecloudretailv2betareplacecatalogattributerequest 10024 return c 10025 } 10026 10027 // Fields allows partial responses to be retrieved. See 10028 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 10029 // details. 10030 func (c *ProjectsLocationsCatalogsAttributesConfigReplaceCatalogAttributeCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsAttributesConfigReplaceCatalogAttributeCall { 10031 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10032 return c 10033 } 10034 10035 // Context sets the context to be used in this call's Do method. 10036 func (c *ProjectsLocationsCatalogsAttributesConfigReplaceCatalogAttributeCall) Context(ctx context.Context) *ProjectsLocationsCatalogsAttributesConfigReplaceCatalogAttributeCall { 10037 c.ctx_ = ctx 10038 return c 10039 } 10040 10041 // Header returns a http.Header that can be modified by the caller to add 10042 // headers to the request. 10043 func (c *ProjectsLocationsCatalogsAttributesConfigReplaceCatalogAttributeCall) Header() http.Header { 10044 if c.header_ == nil { 10045 c.header_ = make(http.Header) 10046 } 10047 return c.header_ 10048 } 10049 10050 func (c *ProjectsLocationsCatalogsAttributesConfigReplaceCatalogAttributeCall) doRequest(alt string) (*http.Response, error) { 10051 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 10052 var body io.Reader = nil 10053 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betareplacecatalogattributerequest) 10054 if err != nil { 10055 return nil, err 10056 } 10057 c.urlParams_.Set("alt", alt) 10058 c.urlParams_.Set("prettyPrint", "false") 10059 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+attributesConfig}:replaceCatalogAttribute") 10060 urls += "?" + c.urlParams_.Encode() 10061 req, err := http.NewRequest("POST", urls, body) 10062 if err != nil { 10063 return nil, err 10064 } 10065 req.Header = reqHeaders 10066 googleapi.Expand(req.URL, map[string]string{ 10067 "attributesConfig": c.attributesConfig, 10068 }) 10069 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10070 } 10071 10072 // Do executes the "retail.projects.locations.catalogs.attributesConfig.replaceCatalogAttribute" call. 10073 // Any non-2xx status code is an error. Response headers are in either 10074 // *GoogleCloudRetailV2betaAttributesConfig.ServerResponse.Header or (if a 10075 // response was returned at all) in error.(*googleapi.Error).Header. Use 10076 // googleapi.IsNotModified to check whether the returned error was because 10077 // http.StatusNotModified was returned. 10078 func (c *ProjectsLocationsCatalogsAttributesConfigReplaceCatalogAttributeCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2betaAttributesConfig, error) { 10079 gensupport.SetOptions(c.urlParams_, opts...) 10080 res, err := c.doRequest("json") 10081 if res != nil && res.StatusCode == http.StatusNotModified { 10082 if res.Body != nil { 10083 res.Body.Close() 10084 } 10085 return nil, gensupport.WrapError(&googleapi.Error{ 10086 Code: res.StatusCode, 10087 Header: res.Header, 10088 }) 10089 } 10090 if err != nil { 10091 return nil, err 10092 } 10093 defer googleapi.CloseBody(res) 10094 if err := googleapi.CheckResponse(res); err != nil { 10095 return nil, gensupport.WrapError(err) 10096 } 10097 ret := &GoogleCloudRetailV2betaAttributesConfig{ 10098 ServerResponse: googleapi.ServerResponse{ 10099 Header: res.Header, 10100 HTTPStatusCode: res.StatusCode, 10101 }, 10102 } 10103 target := &ret 10104 if err := gensupport.DecodeResponse(target, res); err != nil { 10105 return nil, err 10106 } 10107 return ret, nil 10108 } 10109 10110 type ProjectsLocationsCatalogsBranchesOperationsGetCall struct { 10111 s *Service 10112 name string 10113 urlParams_ gensupport.URLParams 10114 ifNoneMatch_ string 10115 ctx_ context.Context 10116 header_ http.Header 10117 } 10118 10119 // Get: Gets the latest state of a long-running operation. Clients can use this 10120 // method to poll the operation result at intervals as recommended by the API 10121 // service. 10122 // 10123 // - name: The name of the operation resource. 10124 func (r *ProjectsLocationsCatalogsBranchesOperationsService) Get(name string) *ProjectsLocationsCatalogsBranchesOperationsGetCall { 10125 c := &ProjectsLocationsCatalogsBranchesOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10126 c.name = name 10127 return c 10128 } 10129 10130 // Fields allows partial responses to be retrieved. See 10131 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 10132 // details. 10133 func (c *ProjectsLocationsCatalogsBranchesOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesOperationsGetCall { 10134 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10135 return c 10136 } 10137 10138 // IfNoneMatch sets an optional parameter which makes the operation fail if the 10139 // object's ETag matches the given value. This is useful for getting updates 10140 // only after the object has changed since the last request. 10141 func (c *ProjectsLocationsCatalogsBranchesOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsBranchesOperationsGetCall { 10142 c.ifNoneMatch_ = entityTag 10143 return c 10144 } 10145 10146 // Context sets the context to be used in this call's Do method. 10147 func (c *ProjectsLocationsCatalogsBranchesOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesOperationsGetCall { 10148 c.ctx_ = ctx 10149 return c 10150 } 10151 10152 // Header returns a http.Header that can be modified by the caller to add 10153 // headers to the request. 10154 func (c *ProjectsLocationsCatalogsBranchesOperationsGetCall) Header() http.Header { 10155 if c.header_ == nil { 10156 c.header_ = make(http.Header) 10157 } 10158 return c.header_ 10159 } 10160 10161 func (c *ProjectsLocationsCatalogsBranchesOperationsGetCall) doRequest(alt string) (*http.Response, error) { 10162 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 10163 if c.ifNoneMatch_ != "" { 10164 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 10165 } 10166 var body io.Reader = nil 10167 c.urlParams_.Set("alt", alt) 10168 c.urlParams_.Set("prettyPrint", "false") 10169 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}") 10170 urls += "?" + c.urlParams_.Encode() 10171 req, err := http.NewRequest("GET", urls, body) 10172 if err != nil { 10173 return nil, err 10174 } 10175 req.Header = reqHeaders 10176 googleapi.Expand(req.URL, map[string]string{ 10177 "name": c.name, 10178 }) 10179 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10180 } 10181 10182 // Do executes the "retail.projects.locations.catalogs.branches.operations.get" call. 10183 // Any non-2xx status code is an error. Response headers are in either 10184 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was 10185 // returned at all) in error.(*googleapi.Error).Header. Use 10186 // googleapi.IsNotModified to check whether the returned error was because 10187 // http.StatusNotModified was returned. 10188 func (c *ProjectsLocationsCatalogsBranchesOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 10189 gensupport.SetOptions(c.urlParams_, opts...) 10190 res, err := c.doRequest("json") 10191 if res != nil && res.StatusCode == http.StatusNotModified { 10192 if res.Body != nil { 10193 res.Body.Close() 10194 } 10195 return nil, gensupport.WrapError(&googleapi.Error{ 10196 Code: res.StatusCode, 10197 Header: res.Header, 10198 }) 10199 } 10200 if err != nil { 10201 return nil, err 10202 } 10203 defer googleapi.CloseBody(res) 10204 if err := googleapi.CheckResponse(res); err != nil { 10205 return nil, gensupport.WrapError(err) 10206 } 10207 ret := &GoogleLongrunningOperation{ 10208 ServerResponse: googleapi.ServerResponse{ 10209 Header: res.Header, 10210 HTTPStatusCode: res.StatusCode, 10211 }, 10212 } 10213 target := &ret 10214 if err := gensupport.DecodeResponse(target, res); err != nil { 10215 return nil, err 10216 } 10217 return ret, nil 10218 } 10219 10220 type ProjectsLocationsCatalogsBranchesProductsAddFulfillmentPlacesCall struct { 10221 s *Service 10222 product string 10223 googlecloudretailv2betaaddfulfillmentplacesrequest *GoogleCloudRetailV2betaAddFulfillmentPlacesRequest 10224 urlParams_ gensupport.URLParams 10225 ctx_ context.Context 10226 header_ http.Header 10227 } 10228 10229 // AddFulfillmentPlaces: We recommend that you use the 10230 // ProductService.AddLocalInventories method instead of the 10231 // ProductService.AddFulfillmentPlaces method. 10232 // ProductService.AddLocalInventories achieves the same results but provides 10233 // more fine-grained control over ingesting local inventory data. Incrementally 10234 // adds place IDs to Product.fulfillment_info.place_ids. This process is 10235 // asynchronous and does not require the Product to exist before updating 10236 // fulfillment information. If the request is valid, the update will be 10237 // enqueued and processed downstream. As a consequence, when a response is 10238 // returned, the added place IDs are not immediately manifested in the Product 10239 // queried by ProductService.GetProduct or ProductService.ListProducts. The 10240 // returned Operations will be obsolete after 1 day, and GetOperation API will 10241 // return NOT_FOUND afterwards. If conflicting updates are issued, the 10242 // Operations associated with the stale updates will not be marked as done 10243 // until being obsolete. 10244 // 10245 // - product: Full resource name of Product, such as 10246 // `projects/*/locations/global/catalogs/default_catalog/branches/default_bran 10247 // ch/products/some_product_id`. If the caller does not have permission to 10248 // access the Product, regardless of whether or not it exists, a 10249 // PERMISSION_DENIED error is returned. 10250 func (r *ProjectsLocationsCatalogsBranchesProductsService) AddFulfillmentPlaces(product string, googlecloudretailv2betaaddfulfillmentplacesrequest *GoogleCloudRetailV2betaAddFulfillmentPlacesRequest) *ProjectsLocationsCatalogsBranchesProductsAddFulfillmentPlacesCall { 10251 c := &ProjectsLocationsCatalogsBranchesProductsAddFulfillmentPlacesCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10252 c.product = product 10253 c.googlecloudretailv2betaaddfulfillmentplacesrequest = googlecloudretailv2betaaddfulfillmentplacesrequest 10254 return c 10255 } 10256 10257 // Fields allows partial responses to be retrieved. See 10258 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 10259 // details. 10260 func (c *ProjectsLocationsCatalogsBranchesProductsAddFulfillmentPlacesCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesProductsAddFulfillmentPlacesCall { 10261 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10262 return c 10263 } 10264 10265 // Context sets the context to be used in this call's Do method. 10266 func (c *ProjectsLocationsCatalogsBranchesProductsAddFulfillmentPlacesCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesProductsAddFulfillmentPlacesCall { 10267 c.ctx_ = ctx 10268 return c 10269 } 10270 10271 // Header returns a http.Header that can be modified by the caller to add 10272 // headers to the request. 10273 func (c *ProjectsLocationsCatalogsBranchesProductsAddFulfillmentPlacesCall) Header() http.Header { 10274 if c.header_ == nil { 10275 c.header_ = make(http.Header) 10276 } 10277 return c.header_ 10278 } 10279 10280 func (c *ProjectsLocationsCatalogsBranchesProductsAddFulfillmentPlacesCall) doRequest(alt string) (*http.Response, error) { 10281 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 10282 var body io.Reader = nil 10283 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betaaddfulfillmentplacesrequest) 10284 if err != nil { 10285 return nil, err 10286 } 10287 c.urlParams_.Set("alt", alt) 10288 c.urlParams_.Set("prettyPrint", "false") 10289 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+product}:addFulfillmentPlaces") 10290 urls += "?" + c.urlParams_.Encode() 10291 req, err := http.NewRequest("POST", urls, body) 10292 if err != nil { 10293 return nil, err 10294 } 10295 req.Header = reqHeaders 10296 googleapi.Expand(req.URL, map[string]string{ 10297 "product": c.product, 10298 }) 10299 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10300 } 10301 10302 // Do executes the "retail.projects.locations.catalogs.branches.products.addFulfillmentPlaces" call. 10303 // Any non-2xx status code is an error. Response headers are in either 10304 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was 10305 // returned at all) in error.(*googleapi.Error).Header. Use 10306 // googleapi.IsNotModified to check whether the returned error was because 10307 // http.StatusNotModified was returned. 10308 func (c *ProjectsLocationsCatalogsBranchesProductsAddFulfillmentPlacesCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 10309 gensupport.SetOptions(c.urlParams_, opts...) 10310 res, err := c.doRequest("json") 10311 if res != nil && res.StatusCode == http.StatusNotModified { 10312 if res.Body != nil { 10313 res.Body.Close() 10314 } 10315 return nil, gensupport.WrapError(&googleapi.Error{ 10316 Code: res.StatusCode, 10317 Header: res.Header, 10318 }) 10319 } 10320 if err != nil { 10321 return nil, err 10322 } 10323 defer googleapi.CloseBody(res) 10324 if err := googleapi.CheckResponse(res); err != nil { 10325 return nil, gensupport.WrapError(err) 10326 } 10327 ret := &GoogleLongrunningOperation{ 10328 ServerResponse: googleapi.ServerResponse{ 10329 Header: res.Header, 10330 HTTPStatusCode: res.StatusCode, 10331 }, 10332 } 10333 target := &ret 10334 if err := gensupport.DecodeResponse(target, res); err != nil { 10335 return nil, err 10336 } 10337 return ret, nil 10338 } 10339 10340 type ProjectsLocationsCatalogsBranchesProductsAddLocalInventoriesCall struct { 10341 s *Service 10342 product string 10343 googlecloudretailv2betaaddlocalinventoriesrequest *GoogleCloudRetailV2betaAddLocalInventoriesRequest 10344 urlParams_ gensupport.URLParams 10345 ctx_ context.Context 10346 header_ http.Header 10347 } 10348 10349 // AddLocalInventories: Updates local inventory information for a Product at a 10350 // list of places, while respecting the last update timestamps of each 10351 // inventory field. This process is asynchronous and does not require the 10352 // Product to exist before updating inventory information. If the request is 10353 // valid, the update will be enqueued and processed downstream. As a 10354 // consequence, when a response is returned, updates are not immediately 10355 // manifested in the Product queried by ProductService.GetProduct or 10356 // ProductService.ListProducts. Local inventory information can only be 10357 // modified using this method. ProductService.CreateProduct and 10358 // ProductService.UpdateProduct has no effect on local inventories. The 10359 // returned Operations will be obsolete after 1 day, and GetOperation API will 10360 // return NOT_FOUND afterwards. If conflicting updates are issued, the 10361 // Operations associated with the stale updates will not be marked as done 10362 // until being obsolete. 10363 // 10364 // - product: Full resource name of Product, such as 10365 // `projects/*/locations/global/catalogs/default_catalog/branches/default_bran 10366 // ch/products/some_product_id`. If the caller does not have permission to 10367 // access the Product, regardless of whether or not it exists, a 10368 // PERMISSION_DENIED error is returned. 10369 func (r *ProjectsLocationsCatalogsBranchesProductsService) AddLocalInventories(product string, googlecloudretailv2betaaddlocalinventoriesrequest *GoogleCloudRetailV2betaAddLocalInventoriesRequest) *ProjectsLocationsCatalogsBranchesProductsAddLocalInventoriesCall { 10370 c := &ProjectsLocationsCatalogsBranchesProductsAddLocalInventoriesCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10371 c.product = product 10372 c.googlecloudretailv2betaaddlocalinventoriesrequest = googlecloudretailv2betaaddlocalinventoriesrequest 10373 return c 10374 } 10375 10376 // Fields allows partial responses to be retrieved. See 10377 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 10378 // details. 10379 func (c *ProjectsLocationsCatalogsBranchesProductsAddLocalInventoriesCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesProductsAddLocalInventoriesCall { 10380 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10381 return c 10382 } 10383 10384 // Context sets the context to be used in this call's Do method. 10385 func (c *ProjectsLocationsCatalogsBranchesProductsAddLocalInventoriesCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesProductsAddLocalInventoriesCall { 10386 c.ctx_ = ctx 10387 return c 10388 } 10389 10390 // Header returns a http.Header that can be modified by the caller to add 10391 // headers to the request. 10392 func (c *ProjectsLocationsCatalogsBranchesProductsAddLocalInventoriesCall) Header() http.Header { 10393 if c.header_ == nil { 10394 c.header_ = make(http.Header) 10395 } 10396 return c.header_ 10397 } 10398 10399 func (c *ProjectsLocationsCatalogsBranchesProductsAddLocalInventoriesCall) doRequest(alt string) (*http.Response, error) { 10400 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 10401 var body io.Reader = nil 10402 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betaaddlocalinventoriesrequest) 10403 if err != nil { 10404 return nil, err 10405 } 10406 c.urlParams_.Set("alt", alt) 10407 c.urlParams_.Set("prettyPrint", "false") 10408 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+product}:addLocalInventories") 10409 urls += "?" + c.urlParams_.Encode() 10410 req, err := http.NewRequest("POST", urls, body) 10411 if err != nil { 10412 return nil, err 10413 } 10414 req.Header = reqHeaders 10415 googleapi.Expand(req.URL, map[string]string{ 10416 "product": c.product, 10417 }) 10418 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10419 } 10420 10421 // Do executes the "retail.projects.locations.catalogs.branches.products.addLocalInventories" call. 10422 // Any non-2xx status code is an error. Response headers are in either 10423 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was 10424 // returned at all) in error.(*googleapi.Error).Header. Use 10425 // googleapi.IsNotModified to check whether the returned error was because 10426 // http.StatusNotModified was returned. 10427 func (c *ProjectsLocationsCatalogsBranchesProductsAddLocalInventoriesCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 10428 gensupport.SetOptions(c.urlParams_, opts...) 10429 res, err := c.doRequest("json") 10430 if res != nil && res.StatusCode == http.StatusNotModified { 10431 if res.Body != nil { 10432 res.Body.Close() 10433 } 10434 return nil, gensupport.WrapError(&googleapi.Error{ 10435 Code: res.StatusCode, 10436 Header: res.Header, 10437 }) 10438 } 10439 if err != nil { 10440 return nil, err 10441 } 10442 defer googleapi.CloseBody(res) 10443 if err := googleapi.CheckResponse(res); err != nil { 10444 return nil, gensupport.WrapError(err) 10445 } 10446 ret := &GoogleLongrunningOperation{ 10447 ServerResponse: googleapi.ServerResponse{ 10448 Header: res.Header, 10449 HTTPStatusCode: res.StatusCode, 10450 }, 10451 } 10452 target := &ret 10453 if err := gensupport.DecodeResponse(target, res); err != nil { 10454 return nil, err 10455 } 10456 return ret, nil 10457 } 10458 10459 type ProjectsLocationsCatalogsBranchesProductsCreateCall struct { 10460 s *Service 10461 parent string 10462 googlecloudretailv2betaproduct *GoogleCloudRetailV2betaProduct 10463 urlParams_ gensupport.URLParams 10464 ctx_ context.Context 10465 header_ http.Header 10466 } 10467 10468 // Create: Creates a Product. 10469 // 10470 // - parent: The parent catalog resource name, such as 10471 // `projects/*/locations/global/catalogs/default_catalog/branches/default_bran 10472 // ch`. 10473 func (r *ProjectsLocationsCatalogsBranchesProductsService) Create(parent string, googlecloudretailv2betaproduct *GoogleCloudRetailV2betaProduct) *ProjectsLocationsCatalogsBranchesProductsCreateCall { 10474 c := &ProjectsLocationsCatalogsBranchesProductsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10475 c.parent = parent 10476 c.googlecloudretailv2betaproduct = googlecloudretailv2betaproduct 10477 return c 10478 } 10479 10480 // ProductId sets the optional parameter "productId": Required. The ID to use 10481 // for the Product, which will become the final component of the Product.name. 10482 // If the caller does not have permission to create the Product, regardless of 10483 // whether or not it exists, a PERMISSION_DENIED error is returned. This field 10484 // must be unique among all Products with the same parent. Otherwise, an 10485 // ALREADY_EXISTS error is returned. This field must be a UTF-8 encoded string 10486 // with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error 10487 // is returned. 10488 func (c *ProjectsLocationsCatalogsBranchesProductsCreateCall) ProductId(productId string) *ProjectsLocationsCatalogsBranchesProductsCreateCall { 10489 c.urlParams_.Set("productId", productId) 10490 return c 10491 } 10492 10493 // Fields allows partial responses to be retrieved. See 10494 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 10495 // details. 10496 func (c *ProjectsLocationsCatalogsBranchesProductsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesProductsCreateCall { 10497 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10498 return c 10499 } 10500 10501 // Context sets the context to be used in this call's Do method. 10502 func (c *ProjectsLocationsCatalogsBranchesProductsCreateCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesProductsCreateCall { 10503 c.ctx_ = ctx 10504 return c 10505 } 10506 10507 // Header returns a http.Header that can be modified by the caller to add 10508 // headers to the request. 10509 func (c *ProjectsLocationsCatalogsBranchesProductsCreateCall) Header() http.Header { 10510 if c.header_ == nil { 10511 c.header_ = make(http.Header) 10512 } 10513 return c.header_ 10514 } 10515 10516 func (c *ProjectsLocationsCatalogsBranchesProductsCreateCall) doRequest(alt string) (*http.Response, error) { 10517 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 10518 var body io.Reader = nil 10519 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betaproduct) 10520 if err != nil { 10521 return nil, err 10522 } 10523 c.urlParams_.Set("alt", alt) 10524 c.urlParams_.Set("prettyPrint", "false") 10525 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+parent}/products") 10526 urls += "?" + c.urlParams_.Encode() 10527 req, err := http.NewRequest("POST", urls, body) 10528 if err != nil { 10529 return nil, err 10530 } 10531 req.Header = reqHeaders 10532 googleapi.Expand(req.URL, map[string]string{ 10533 "parent": c.parent, 10534 }) 10535 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10536 } 10537 10538 // Do executes the "retail.projects.locations.catalogs.branches.products.create" call. 10539 // Any non-2xx status code is an error. Response headers are in either 10540 // *GoogleCloudRetailV2betaProduct.ServerResponse.Header or (if a response was 10541 // returned at all) in error.(*googleapi.Error).Header. Use 10542 // googleapi.IsNotModified to check whether the returned error was because 10543 // http.StatusNotModified was returned. 10544 func (c *ProjectsLocationsCatalogsBranchesProductsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2betaProduct, error) { 10545 gensupport.SetOptions(c.urlParams_, opts...) 10546 res, err := c.doRequest("json") 10547 if res != nil && res.StatusCode == http.StatusNotModified { 10548 if res.Body != nil { 10549 res.Body.Close() 10550 } 10551 return nil, gensupport.WrapError(&googleapi.Error{ 10552 Code: res.StatusCode, 10553 Header: res.Header, 10554 }) 10555 } 10556 if err != nil { 10557 return nil, err 10558 } 10559 defer googleapi.CloseBody(res) 10560 if err := googleapi.CheckResponse(res); err != nil { 10561 return nil, gensupport.WrapError(err) 10562 } 10563 ret := &GoogleCloudRetailV2betaProduct{ 10564 ServerResponse: googleapi.ServerResponse{ 10565 Header: res.Header, 10566 HTTPStatusCode: res.StatusCode, 10567 }, 10568 } 10569 target := &ret 10570 if err := gensupport.DecodeResponse(target, res); err != nil { 10571 return nil, err 10572 } 10573 return ret, nil 10574 } 10575 10576 type ProjectsLocationsCatalogsBranchesProductsDeleteCall struct { 10577 s *Service 10578 name string 10579 urlParams_ gensupport.URLParams 10580 ctx_ context.Context 10581 header_ http.Header 10582 } 10583 10584 // Delete: Deletes a Product. 10585 // 10586 // - name: Full resource name of Product, such as 10587 // `projects/*/locations/global/catalogs/default_catalog/branches/default_bran 10588 // ch/products/some_product_id`. If the caller does not have permission to 10589 // delete the Product, regardless of whether or not it exists, a 10590 // PERMISSION_DENIED error is returned. If the Product to delete does not 10591 // exist, a NOT_FOUND error is returned. The Product to delete can neither be 10592 // a Product.Type.COLLECTION Product member nor a Product.Type.PRIMARY 10593 // Product with more than one variants. Otherwise, an INVALID_ARGUMENT error 10594 // is returned. All inventory information for the named Product will be 10595 // deleted. 10596 func (r *ProjectsLocationsCatalogsBranchesProductsService) Delete(name string) *ProjectsLocationsCatalogsBranchesProductsDeleteCall { 10597 c := &ProjectsLocationsCatalogsBranchesProductsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10598 c.name = name 10599 return c 10600 } 10601 10602 // Fields allows partial responses to be retrieved. See 10603 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 10604 // details. 10605 func (c *ProjectsLocationsCatalogsBranchesProductsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesProductsDeleteCall { 10606 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10607 return c 10608 } 10609 10610 // Context sets the context to be used in this call's Do method. 10611 func (c *ProjectsLocationsCatalogsBranchesProductsDeleteCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesProductsDeleteCall { 10612 c.ctx_ = ctx 10613 return c 10614 } 10615 10616 // Header returns a http.Header that can be modified by the caller to add 10617 // headers to the request. 10618 func (c *ProjectsLocationsCatalogsBranchesProductsDeleteCall) Header() http.Header { 10619 if c.header_ == nil { 10620 c.header_ = make(http.Header) 10621 } 10622 return c.header_ 10623 } 10624 10625 func (c *ProjectsLocationsCatalogsBranchesProductsDeleteCall) doRequest(alt string) (*http.Response, error) { 10626 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 10627 var body io.Reader = nil 10628 c.urlParams_.Set("alt", alt) 10629 c.urlParams_.Set("prettyPrint", "false") 10630 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}") 10631 urls += "?" + c.urlParams_.Encode() 10632 req, err := http.NewRequest("DELETE", urls, body) 10633 if err != nil { 10634 return nil, err 10635 } 10636 req.Header = reqHeaders 10637 googleapi.Expand(req.URL, map[string]string{ 10638 "name": c.name, 10639 }) 10640 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10641 } 10642 10643 // Do executes the "retail.projects.locations.catalogs.branches.products.delete" call. 10644 // Any non-2xx status code is an error. Response headers are in either 10645 // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at 10646 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 10647 // check whether the returned error was because http.StatusNotModified was 10648 // returned. 10649 func (c *ProjectsLocationsCatalogsBranchesProductsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { 10650 gensupport.SetOptions(c.urlParams_, opts...) 10651 res, err := c.doRequest("json") 10652 if res != nil && res.StatusCode == http.StatusNotModified { 10653 if res.Body != nil { 10654 res.Body.Close() 10655 } 10656 return nil, gensupport.WrapError(&googleapi.Error{ 10657 Code: res.StatusCode, 10658 Header: res.Header, 10659 }) 10660 } 10661 if err != nil { 10662 return nil, err 10663 } 10664 defer googleapi.CloseBody(res) 10665 if err := googleapi.CheckResponse(res); err != nil { 10666 return nil, gensupport.WrapError(err) 10667 } 10668 ret := &GoogleProtobufEmpty{ 10669 ServerResponse: googleapi.ServerResponse{ 10670 Header: res.Header, 10671 HTTPStatusCode: res.StatusCode, 10672 }, 10673 } 10674 target := &ret 10675 if err := gensupport.DecodeResponse(target, res); err != nil { 10676 return nil, err 10677 } 10678 return ret, nil 10679 } 10680 10681 type ProjectsLocationsCatalogsBranchesProductsGetCall struct { 10682 s *Service 10683 name string 10684 urlParams_ gensupport.URLParams 10685 ifNoneMatch_ string 10686 ctx_ context.Context 10687 header_ http.Header 10688 } 10689 10690 // Get: Gets a Product. 10691 // 10692 // - name: Full resource name of Product, such as 10693 // `projects/*/locations/global/catalogs/default_catalog/branches/default_bran 10694 // ch/products/some_product_id`. If the caller does not have permission to 10695 // access the Product, regardless of whether or not it exists, a 10696 // PERMISSION_DENIED error is returned. If the requested Product does not 10697 // exist, a NOT_FOUND error is returned. 10698 func (r *ProjectsLocationsCatalogsBranchesProductsService) Get(name string) *ProjectsLocationsCatalogsBranchesProductsGetCall { 10699 c := &ProjectsLocationsCatalogsBranchesProductsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10700 c.name = name 10701 return c 10702 } 10703 10704 // Fields allows partial responses to be retrieved. See 10705 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 10706 // details. 10707 func (c *ProjectsLocationsCatalogsBranchesProductsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesProductsGetCall { 10708 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10709 return c 10710 } 10711 10712 // IfNoneMatch sets an optional parameter which makes the operation fail if the 10713 // object's ETag matches the given value. This is useful for getting updates 10714 // only after the object has changed since the last request. 10715 func (c *ProjectsLocationsCatalogsBranchesProductsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsBranchesProductsGetCall { 10716 c.ifNoneMatch_ = entityTag 10717 return c 10718 } 10719 10720 // Context sets the context to be used in this call's Do method. 10721 func (c *ProjectsLocationsCatalogsBranchesProductsGetCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesProductsGetCall { 10722 c.ctx_ = ctx 10723 return c 10724 } 10725 10726 // Header returns a http.Header that can be modified by the caller to add 10727 // headers to the request. 10728 func (c *ProjectsLocationsCatalogsBranchesProductsGetCall) Header() http.Header { 10729 if c.header_ == nil { 10730 c.header_ = make(http.Header) 10731 } 10732 return c.header_ 10733 } 10734 10735 func (c *ProjectsLocationsCatalogsBranchesProductsGetCall) doRequest(alt string) (*http.Response, error) { 10736 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 10737 if c.ifNoneMatch_ != "" { 10738 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 10739 } 10740 var body io.Reader = nil 10741 c.urlParams_.Set("alt", alt) 10742 c.urlParams_.Set("prettyPrint", "false") 10743 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}") 10744 urls += "?" + c.urlParams_.Encode() 10745 req, err := http.NewRequest("GET", urls, body) 10746 if err != nil { 10747 return nil, err 10748 } 10749 req.Header = reqHeaders 10750 googleapi.Expand(req.URL, map[string]string{ 10751 "name": c.name, 10752 }) 10753 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10754 } 10755 10756 // Do executes the "retail.projects.locations.catalogs.branches.products.get" call. 10757 // Any non-2xx status code is an error. Response headers are in either 10758 // *GoogleCloudRetailV2betaProduct.ServerResponse.Header or (if a response was 10759 // returned at all) in error.(*googleapi.Error).Header. Use 10760 // googleapi.IsNotModified to check whether the returned error was because 10761 // http.StatusNotModified was returned. 10762 func (c *ProjectsLocationsCatalogsBranchesProductsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2betaProduct, error) { 10763 gensupport.SetOptions(c.urlParams_, opts...) 10764 res, err := c.doRequest("json") 10765 if res != nil && res.StatusCode == http.StatusNotModified { 10766 if res.Body != nil { 10767 res.Body.Close() 10768 } 10769 return nil, gensupport.WrapError(&googleapi.Error{ 10770 Code: res.StatusCode, 10771 Header: res.Header, 10772 }) 10773 } 10774 if err != nil { 10775 return nil, err 10776 } 10777 defer googleapi.CloseBody(res) 10778 if err := googleapi.CheckResponse(res); err != nil { 10779 return nil, gensupport.WrapError(err) 10780 } 10781 ret := &GoogleCloudRetailV2betaProduct{ 10782 ServerResponse: googleapi.ServerResponse{ 10783 Header: res.Header, 10784 HTTPStatusCode: res.StatusCode, 10785 }, 10786 } 10787 target := &ret 10788 if err := gensupport.DecodeResponse(target, res); err != nil { 10789 return nil, err 10790 } 10791 return ret, nil 10792 } 10793 10794 type ProjectsLocationsCatalogsBranchesProductsImportCall struct { 10795 s *Service 10796 parent string 10797 googlecloudretailv2betaimportproductsrequest *GoogleCloudRetailV2betaImportProductsRequest 10798 urlParams_ gensupport.URLParams 10799 ctx_ context.Context 10800 header_ http.Header 10801 } 10802 10803 // Import: Bulk import of multiple Products. Request processing may be 10804 // synchronous. Non-existing items are created. Note that it is possible for a 10805 // subset of the Products to be successfully updated. 10806 // 10807 // - parent: 10808 // `projects/1234/locations/global/catalogs/default_catalog/branches/default_b 10809 // ranch` If no updateMask is specified, requires products.create permission. 10810 // If updateMask is specified, requires products.update permission. 10811 func (r *ProjectsLocationsCatalogsBranchesProductsService) Import(parent string, googlecloudretailv2betaimportproductsrequest *GoogleCloudRetailV2betaImportProductsRequest) *ProjectsLocationsCatalogsBranchesProductsImportCall { 10812 c := &ProjectsLocationsCatalogsBranchesProductsImportCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10813 c.parent = parent 10814 c.googlecloudretailv2betaimportproductsrequest = googlecloudretailv2betaimportproductsrequest 10815 return c 10816 } 10817 10818 // Fields allows partial responses to be retrieved. See 10819 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 10820 // details. 10821 func (c *ProjectsLocationsCatalogsBranchesProductsImportCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesProductsImportCall { 10822 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10823 return c 10824 } 10825 10826 // Context sets the context to be used in this call's Do method. 10827 func (c *ProjectsLocationsCatalogsBranchesProductsImportCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesProductsImportCall { 10828 c.ctx_ = ctx 10829 return c 10830 } 10831 10832 // Header returns a http.Header that can be modified by the caller to add 10833 // headers to the request. 10834 func (c *ProjectsLocationsCatalogsBranchesProductsImportCall) Header() http.Header { 10835 if c.header_ == nil { 10836 c.header_ = make(http.Header) 10837 } 10838 return c.header_ 10839 } 10840 10841 func (c *ProjectsLocationsCatalogsBranchesProductsImportCall) doRequest(alt string) (*http.Response, error) { 10842 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 10843 var body io.Reader = nil 10844 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betaimportproductsrequest) 10845 if err != nil { 10846 return nil, err 10847 } 10848 c.urlParams_.Set("alt", alt) 10849 c.urlParams_.Set("prettyPrint", "false") 10850 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+parent}/products:import") 10851 urls += "?" + c.urlParams_.Encode() 10852 req, err := http.NewRequest("POST", urls, body) 10853 if err != nil { 10854 return nil, err 10855 } 10856 req.Header = reqHeaders 10857 googleapi.Expand(req.URL, map[string]string{ 10858 "parent": c.parent, 10859 }) 10860 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10861 } 10862 10863 // Do executes the "retail.projects.locations.catalogs.branches.products.import" call. 10864 // Any non-2xx status code is an error. Response headers are in either 10865 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was 10866 // returned at all) in error.(*googleapi.Error).Header. Use 10867 // googleapi.IsNotModified to check whether the returned error was because 10868 // http.StatusNotModified was returned. 10869 func (c *ProjectsLocationsCatalogsBranchesProductsImportCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 10870 gensupport.SetOptions(c.urlParams_, opts...) 10871 res, err := c.doRequest("json") 10872 if res != nil && res.StatusCode == http.StatusNotModified { 10873 if res.Body != nil { 10874 res.Body.Close() 10875 } 10876 return nil, gensupport.WrapError(&googleapi.Error{ 10877 Code: res.StatusCode, 10878 Header: res.Header, 10879 }) 10880 } 10881 if err != nil { 10882 return nil, err 10883 } 10884 defer googleapi.CloseBody(res) 10885 if err := googleapi.CheckResponse(res); err != nil { 10886 return nil, gensupport.WrapError(err) 10887 } 10888 ret := &GoogleLongrunningOperation{ 10889 ServerResponse: googleapi.ServerResponse{ 10890 Header: res.Header, 10891 HTTPStatusCode: res.StatusCode, 10892 }, 10893 } 10894 target := &ret 10895 if err := gensupport.DecodeResponse(target, res); err != nil { 10896 return nil, err 10897 } 10898 return ret, nil 10899 } 10900 10901 type ProjectsLocationsCatalogsBranchesProductsListCall struct { 10902 s *Service 10903 parent string 10904 urlParams_ gensupport.URLParams 10905 ifNoneMatch_ string 10906 ctx_ context.Context 10907 header_ http.Header 10908 } 10909 10910 // List: Gets a list of Products. 10911 // 10912 // - parent: The parent branch resource name, such as 10913 // `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use 10914 // `default_branch` as the branch ID, to list products under the default 10915 // branch. If the caller does not have permission to list Products under this 10916 // branch, regardless of whether or not this branch exists, a 10917 // PERMISSION_DENIED error is returned. 10918 func (r *ProjectsLocationsCatalogsBranchesProductsService) List(parent string) *ProjectsLocationsCatalogsBranchesProductsListCall { 10919 c := &ProjectsLocationsCatalogsBranchesProductsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10920 c.parent = parent 10921 return c 10922 } 10923 10924 // Filter sets the optional parameter "filter": A filter to apply on the list 10925 // results. Supported features: * List all the products under the parent branch 10926 // if filter is unset. * List Product.Type.VARIANT Products sharing the same 10927 // Product.Type.PRIMARY Product. For example: `primary_product_id = 10928 // "some_product_id" * List Products bundled in a Product.Type.COLLECTION 10929 // Product. For example: `collection_product_id = "some_product_id" * List 10930 // Products with a partibular type. For example: `type = "PRIMARY" `type = 10931 // "VARIANT" `type = "COLLECTION" If the field is unrecognizable, an 10932 // INVALID_ARGUMENT error is returned. If the specified Product.Type.PRIMARY 10933 // Product or Product.Type.COLLECTION Product does not exist, a NOT_FOUND error 10934 // is returned. 10935 func (c *ProjectsLocationsCatalogsBranchesProductsListCall) Filter(filter string) *ProjectsLocationsCatalogsBranchesProductsListCall { 10936 c.urlParams_.Set("filter", filter) 10937 return c 10938 } 10939 10940 // PageSize sets the optional parameter "pageSize": Maximum number of Products 10941 // to return. If unspecified, defaults to 100. The maximum allowed value is 10942 // 1000. Values above 1000 will be coerced to 1000. If this field is negative, 10943 // an INVALID_ARGUMENT error is returned. 10944 func (c *ProjectsLocationsCatalogsBranchesProductsListCall) PageSize(pageSize int64) *ProjectsLocationsCatalogsBranchesProductsListCall { 10945 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 10946 return c 10947 } 10948 10949 // PageToken sets the optional parameter "pageToken": A page token 10950 // ListProductsResponse.next_page_token, received from a previous 10951 // ProductService.ListProducts call. Provide this to retrieve the subsequent 10952 // page. When paginating, all other parameters provided to 10953 // ProductService.ListProducts must match the call that provided the page 10954 // token. Otherwise, an INVALID_ARGUMENT error is returned. 10955 func (c *ProjectsLocationsCatalogsBranchesProductsListCall) PageToken(pageToken string) *ProjectsLocationsCatalogsBranchesProductsListCall { 10956 c.urlParams_.Set("pageToken", pageToken) 10957 return c 10958 } 10959 10960 // ReadMask sets the optional parameter "readMask": The fields of Product to 10961 // return in the responses. If not set or empty, the following fields are 10962 // returned: * Product.name * Product.id * Product.title * Product.uri * 10963 // Product.images * Product.price_info * Product.brands If "*" is provided, all 10964 // fields are returned. Product.name is always returned no matter what mask is 10965 // set. If an unsupported or unknown field is provided, an INVALID_ARGUMENT 10966 // error is returned. 10967 func (c *ProjectsLocationsCatalogsBranchesProductsListCall) ReadMask(readMask string) *ProjectsLocationsCatalogsBranchesProductsListCall { 10968 c.urlParams_.Set("readMask", readMask) 10969 return c 10970 } 10971 10972 // Fields allows partial responses to be retrieved. See 10973 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 10974 // details. 10975 func (c *ProjectsLocationsCatalogsBranchesProductsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesProductsListCall { 10976 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10977 return c 10978 } 10979 10980 // IfNoneMatch sets an optional parameter which makes the operation fail if the 10981 // object's ETag matches the given value. This is useful for getting updates 10982 // only after the object has changed since the last request. 10983 func (c *ProjectsLocationsCatalogsBranchesProductsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsBranchesProductsListCall { 10984 c.ifNoneMatch_ = entityTag 10985 return c 10986 } 10987 10988 // Context sets the context to be used in this call's Do method. 10989 func (c *ProjectsLocationsCatalogsBranchesProductsListCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesProductsListCall { 10990 c.ctx_ = ctx 10991 return c 10992 } 10993 10994 // Header returns a http.Header that can be modified by the caller to add 10995 // headers to the request. 10996 func (c *ProjectsLocationsCatalogsBranchesProductsListCall) Header() http.Header { 10997 if c.header_ == nil { 10998 c.header_ = make(http.Header) 10999 } 11000 return c.header_ 11001 } 11002 11003 func (c *ProjectsLocationsCatalogsBranchesProductsListCall) doRequest(alt string) (*http.Response, error) { 11004 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 11005 if c.ifNoneMatch_ != "" { 11006 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 11007 } 11008 var body io.Reader = nil 11009 c.urlParams_.Set("alt", alt) 11010 c.urlParams_.Set("prettyPrint", "false") 11011 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+parent}/products") 11012 urls += "?" + c.urlParams_.Encode() 11013 req, err := http.NewRequest("GET", urls, body) 11014 if err != nil { 11015 return nil, err 11016 } 11017 req.Header = reqHeaders 11018 googleapi.Expand(req.URL, map[string]string{ 11019 "parent": c.parent, 11020 }) 11021 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11022 } 11023 11024 // Do executes the "retail.projects.locations.catalogs.branches.products.list" call. 11025 // Any non-2xx status code is an error. Response headers are in either 11026 // *GoogleCloudRetailV2betaListProductsResponse.ServerResponse.Header or (if a 11027 // response was returned at all) in error.(*googleapi.Error).Header. Use 11028 // googleapi.IsNotModified to check whether the returned error was because 11029 // http.StatusNotModified was returned. 11030 func (c *ProjectsLocationsCatalogsBranchesProductsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2betaListProductsResponse, error) { 11031 gensupport.SetOptions(c.urlParams_, opts...) 11032 res, err := c.doRequest("json") 11033 if res != nil && res.StatusCode == http.StatusNotModified { 11034 if res.Body != nil { 11035 res.Body.Close() 11036 } 11037 return nil, gensupport.WrapError(&googleapi.Error{ 11038 Code: res.StatusCode, 11039 Header: res.Header, 11040 }) 11041 } 11042 if err != nil { 11043 return nil, err 11044 } 11045 defer googleapi.CloseBody(res) 11046 if err := googleapi.CheckResponse(res); err != nil { 11047 return nil, gensupport.WrapError(err) 11048 } 11049 ret := &GoogleCloudRetailV2betaListProductsResponse{ 11050 ServerResponse: googleapi.ServerResponse{ 11051 Header: res.Header, 11052 HTTPStatusCode: res.StatusCode, 11053 }, 11054 } 11055 target := &ret 11056 if err := gensupport.DecodeResponse(target, res); err != nil { 11057 return nil, err 11058 } 11059 return ret, nil 11060 } 11061 11062 // Pages invokes f for each page of results. 11063 // A non-nil error returned from f will halt the iteration. 11064 // The provided context supersedes any context provided to the Context method. 11065 func (c *ProjectsLocationsCatalogsBranchesProductsListCall) Pages(ctx context.Context, f func(*GoogleCloudRetailV2betaListProductsResponse) error) error { 11066 c.ctx_ = ctx 11067 defer c.PageToken(c.urlParams_.Get("pageToken")) 11068 for { 11069 x, err := c.Do() 11070 if err != nil { 11071 return err 11072 } 11073 if err := f(x); err != nil { 11074 return err 11075 } 11076 if x.NextPageToken == "" { 11077 return nil 11078 } 11079 c.PageToken(x.NextPageToken) 11080 } 11081 } 11082 11083 type ProjectsLocationsCatalogsBranchesProductsPatchCall struct { 11084 s *Service 11085 name string 11086 googlecloudretailv2betaproduct *GoogleCloudRetailV2betaProduct 11087 urlParams_ gensupport.URLParams 11088 ctx_ context.Context 11089 header_ http.Header 11090 } 11091 11092 // Patch: Updates a Product. 11093 // 11094 // - name: Immutable. Full resource name of the product, such as 11095 // `projects/*/locations/global/catalogs/default_catalog/branches/default_bran 11096 // ch/products/product_id`. 11097 func (r *ProjectsLocationsCatalogsBranchesProductsService) Patch(name string, googlecloudretailv2betaproduct *GoogleCloudRetailV2betaProduct) *ProjectsLocationsCatalogsBranchesProductsPatchCall { 11098 c := &ProjectsLocationsCatalogsBranchesProductsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11099 c.name = name 11100 c.googlecloudretailv2betaproduct = googlecloudretailv2betaproduct 11101 return c 11102 } 11103 11104 // AllowMissing sets the optional parameter "allowMissing": If set to true, and 11105 // the Product is not found, a new Product will be created. In this situation, 11106 // `update_mask` is ignored. 11107 func (c *ProjectsLocationsCatalogsBranchesProductsPatchCall) AllowMissing(allowMissing bool) *ProjectsLocationsCatalogsBranchesProductsPatchCall { 11108 c.urlParams_.Set("allowMissing", fmt.Sprint(allowMissing)) 11109 return c 11110 } 11111 11112 // UpdateMask sets the optional parameter "updateMask": Indicates which fields 11113 // in the provided Product to update. The immutable and output only fields are 11114 // NOT supported. If not set, all supported fields (the fields that are neither 11115 // immutable nor output only) are updated. If an unsupported or unknown field 11116 // is provided, an INVALID_ARGUMENT error is returned. The attribute key can be 11117 // updated by setting the mask path as "attributes.${key_name}". If a key name 11118 // is present in the mask but not in the patching product from the request, 11119 // this key will be deleted after the update. 11120 func (c *ProjectsLocationsCatalogsBranchesProductsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsCatalogsBranchesProductsPatchCall { 11121 c.urlParams_.Set("updateMask", updateMask) 11122 return c 11123 } 11124 11125 // Fields allows partial responses to be retrieved. See 11126 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 11127 // details. 11128 func (c *ProjectsLocationsCatalogsBranchesProductsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesProductsPatchCall { 11129 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11130 return c 11131 } 11132 11133 // Context sets the context to be used in this call's Do method. 11134 func (c *ProjectsLocationsCatalogsBranchesProductsPatchCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesProductsPatchCall { 11135 c.ctx_ = ctx 11136 return c 11137 } 11138 11139 // Header returns a http.Header that can be modified by the caller to add 11140 // headers to the request. 11141 func (c *ProjectsLocationsCatalogsBranchesProductsPatchCall) Header() http.Header { 11142 if c.header_ == nil { 11143 c.header_ = make(http.Header) 11144 } 11145 return c.header_ 11146 } 11147 11148 func (c *ProjectsLocationsCatalogsBranchesProductsPatchCall) doRequest(alt string) (*http.Response, error) { 11149 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 11150 var body io.Reader = nil 11151 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betaproduct) 11152 if err != nil { 11153 return nil, err 11154 } 11155 c.urlParams_.Set("alt", alt) 11156 c.urlParams_.Set("prettyPrint", "false") 11157 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}") 11158 urls += "?" + c.urlParams_.Encode() 11159 req, err := http.NewRequest("PATCH", urls, body) 11160 if err != nil { 11161 return nil, err 11162 } 11163 req.Header = reqHeaders 11164 googleapi.Expand(req.URL, map[string]string{ 11165 "name": c.name, 11166 }) 11167 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11168 } 11169 11170 // Do executes the "retail.projects.locations.catalogs.branches.products.patch" call. 11171 // Any non-2xx status code is an error. Response headers are in either 11172 // *GoogleCloudRetailV2betaProduct.ServerResponse.Header or (if a response was 11173 // returned at all) in error.(*googleapi.Error).Header. Use 11174 // googleapi.IsNotModified to check whether the returned error was because 11175 // http.StatusNotModified was returned. 11176 func (c *ProjectsLocationsCatalogsBranchesProductsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2betaProduct, error) { 11177 gensupport.SetOptions(c.urlParams_, opts...) 11178 res, err := c.doRequest("json") 11179 if res != nil && res.StatusCode == http.StatusNotModified { 11180 if res.Body != nil { 11181 res.Body.Close() 11182 } 11183 return nil, gensupport.WrapError(&googleapi.Error{ 11184 Code: res.StatusCode, 11185 Header: res.Header, 11186 }) 11187 } 11188 if err != nil { 11189 return nil, err 11190 } 11191 defer googleapi.CloseBody(res) 11192 if err := googleapi.CheckResponse(res); err != nil { 11193 return nil, gensupport.WrapError(err) 11194 } 11195 ret := &GoogleCloudRetailV2betaProduct{ 11196 ServerResponse: googleapi.ServerResponse{ 11197 Header: res.Header, 11198 HTTPStatusCode: res.StatusCode, 11199 }, 11200 } 11201 target := &ret 11202 if err := gensupport.DecodeResponse(target, res); err != nil { 11203 return nil, err 11204 } 11205 return ret, nil 11206 } 11207 11208 type ProjectsLocationsCatalogsBranchesProductsPurgeCall struct { 11209 s *Service 11210 parent string 11211 googlecloudretailv2betapurgeproductsrequest *GoogleCloudRetailV2betaPurgeProductsRequest 11212 urlParams_ gensupport.URLParams 11213 ctx_ context.Context 11214 header_ http.Header 11215 } 11216 11217 // Purge: Permanently deletes all selected Products under a branch. This 11218 // process is asynchronous. If the request is valid, the removal will be 11219 // enqueued and processed offline. Depending on the number of Products, this 11220 // operation could take hours to complete. Before the operation completes, some 11221 // Products may still be returned by ProductService.GetProduct or 11222 // ProductService.ListProducts. Depending on the number of Products, this 11223 // operation could take hours to complete. To get a sample of Products that 11224 // would be deleted, set PurgeProductsRequest.force to false. 11225 // 11226 // - parent: The resource name of the branch under which the products are 11227 // created. The format is 11228 // `projects/${projectId}/locations/global/catalogs/${catalogId}/branches/${br 11229 // anchId}`. 11230 func (r *ProjectsLocationsCatalogsBranchesProductsService) Purge(parent string, googlecloudretailv2betapurgeproductsrequest *GoogleCloudRetailV2betaPurgeProductsRequest) *ProjectsLocationsCatalogsBranchesProductsPurgeCall { 11231 c := &ProjectsLocationsCatalogsBranchesProductsPurgeCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11232 c.parent = parent 11233 c.googlecloudretailv2betapurgeproductsrequest = googlecloudretailv2betapurgeproductsrequest 11234 return c 11235 } 11236 11237 // Fields allows partial responses to be retrieved. See 11238 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 11239 // details. 11240 func (c *ProjectsLocationsCatalogsBranchesProductsPurgeCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesProductsPurgeCall { 11241 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11242 return c 11243 } 11244 11245 // Context sets the context to be used in this call's Do method. 11246 func (c *ProjectsLocationsCatalogsBranchesProductsPurgeCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesProductsPurgeCall { 11247 c.ctx_ = ctx 11248 return c 11249 } 11250 11251 // Header returns a http.Header that can be modified by the caller to add 11252 // headers to the request. 11253 func (c *ProjectsLocationsCatalogsBranchesProductsPurgeCall) Header() http.Header { 11254 if c.header_ == nil { 11255 c.header_ = make(http.Header) 11256 } 11257 return c.header_ 11258 } 11259 11260 func (c *ProjectsLocationsCatalogsBranchesProductsPurgeCall) doRequest(alt string) (*http.Response, error) { 11261 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 11262 var body io.Reader = nil 11263 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betapurgeproductsrequest) 11264 if err != nil { 11265 return nil, err 11266 } 11267 c.urlParams_.Set("alt", alt) 11268 c.urlParams_.Set("prettyPrint", "false") 11269 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+parent}/products:purge") 11270 urls += "?" + c.urlParams_.Encode() 11271 req, err := http.NewRequest("POST", urls, body) 11272 if err != nil { 11273 return nil, err 11274 } 11275 req.Header = reqHeaders 11276 googleapi.Expand(req.URL, map[string]string{ 11277 "parent": c.parent, 11278 }) 11279 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11280 } 11281 11282 // Do executes the "retail.projects.locations.catalogs.branches.products.purge" call. 11283 // Any non-2xx status code is an error. Response headers are in either 11284 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was 11285 // returned at all) in error.(*googleapi.Error).Header. Use 11286 // googleapi.IsNotModified to check whether the returned error was because 11287 // http.StatusNotModified was returned. 11288 func (c *ProjectsLocationsCatalogsBranchesProductsPurgeCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 11289 gensupport.SetOptions(c.urlParams_, opts...) 11290 res, err := c.doRequest("json") 11291 if res != nil && res.StatusCode == http.StatusNotModified { 11292 if res.Body != nil { 11293 res.Body.Close() 11294 } 11295 return nil, gensupport.WrapError(&googleapi.Error{ 11296 Code: res.StatusCode, 11297 Header: res.Header, 11298 }) 11299 } 11300 if err != nil { 11301 return nil, err 11302 } 11303 defer googleapi.CloseBody(res) 11304 if err := googleapi.CheckResponse(res); err != nil { 11305 return nil, gensupport.WrapError(err) 11306 } 11307 ret := &GoogleLongrunningOperation{ 11308 ServerResponse: googleapi.ServerResponse{ 11309 Header: res.Header, 11310 HTTPStatusCode: res.StatusCode, 11311 }, 11312 } 11313 target := &ret 11314 if err := gensupport.DecodeResponse(target, res); err != nil { 11315 return nil, err 11316 } 11317 return ret, nil 11318 } 11319 11320 type ProjectsLocationsCatalogsBranchesProductsRemoveFulfillmentPlacesCall struct { 11321 s *Service 11322 product string 11323 googlecloudretailv2betaremovefulfillmentplacesrequest *GoogleCloudRetailV2betaRemoveFulfillmentPlacesRequest 11324 urlParams_ gensupport.URLParams 11325 ctx_ context.Context 11326 header_ http.Header 11327 } 11328 11329 // RemoveFulfillmentPlaces: We recommend that you use the 11330 // ProductService.RemoveLocalInventories method instead of the 11331 // ProductService.RemoveFulfillmentPlaces method. 11332 // ProductService.RemoveLocalInventories achieves the same results but provides 11333 // more fine-grained control over ingesting local inventory data. Incrementally 11334 // removes place IDs from a Product.fulfillment_info.place_ids. This process is 11335 // asynchronous and does not require the Product to exist before updating 11336 // fulfillment information. If the request is valid, the update will be 11337 // enqueued and processed downstream. As a consequence, when a response is 11338 // returned, the removed place IDs are not immediately manifested in the 11339 // Product queried by ProductService.GetProduct or ProductService.ListProducts. 11340 // The returned Operations will be obsolete after 1 day, and GetOperation API 11341 // will return NOT_FOUND afterwards. If conflicting updates are issued, the 11342 // Operations associated with the stale updates will not be marked as done 11343 // until being obsolete. 11344 // 11345 // - product: Full resource name of Product, such as 11346 // `projects/*/locations/global/catalogs/default_catalog/branches/default_bran 11347 // ch/products/some_product_id`. If the caller does not have permission to 11348 // access the Product, regardless of whether or not it exists, a 11349 // PERMISSION_DENIED error is returned. 11350 func (r *ProjectsLocationsCatalogsBranchesProductsService) RemoveFulfillmentPlaces(product string, googlecloudretailv2betaremovefulfillmentplacesrequest *GoogleCloudRetailV2betaRemoveFulfillmentPlacesRequest) *ProjectsLocationsCatalogsBranchesProductsRemoveFulfillmentPlacesCall { 11351 c := &ProjectsLocationsCatalogsBranchesProductsRemoveFulfillmentPlacesCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11352 c.product = product 11353 c.googlecloudretailv2betaremovefulfillmentplacesrequest = googlecloudretailv2betaremovefulfillmentplacesrequest 11354 return c 11355 } 11356 11357 // Fields allows partial responses to be retrieved. See 11358 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 11359 // details. 11360 func (c *ProjectsLocationsCatalogsBranchesProductsRemoveFulfillmentPlacesCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesProductsRemoveFulfillmentPlacesCall { 11361 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11362 return c 11363 } 11364 11365 // Context sets the context to be used in this call's Do method. 11366 func (c *ProjectsLocationsCatalogsBranchesProductsRemoveFulfillmentPlacesCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesProductsRemoveFulfillmentPlacesCall { 11367 c.ctx_ = ctx 11368 return c 11369 } 11370 11371 // Header returns a http.Header that can be modified by the caller to add 11372 // headers to the request. 11373 func (c *ProjectsLocationsCatalogsBranchesProductsRemoveFulfillmentPlacesCall) Header() http.Header { 11374 if c.header_ == nil { 11375 c.header_ = make(http.Header) 11376 } 11377 return c.header_ 11378 } 11379 11380 func (c *ProjectsLocationsCatalogsBranchesProductsRemoveFulfillmentPlacesCall) doRequest(alt string) (*http.Response, error) { 11381 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 11382 var body io.Reader = nil 11383 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betaremovefulfillmentplacesrequest) 11384 if err != nil { 11385 return nil, err 11386 } 11387 c.urlParams_.Set("alt", alt) 11388 c.urlParams_.Set("prettyPrint", "false") 11389 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+product}:removeFulfillmentPlaces") 11390 urls += "?" + c.urlParams_.Encode() 11391 req, err := http.NewRequest("POST", urls, body) 11392 if err != nil { 11393 return nil, err 11394 } 11395 req.Header = reqHeaders 11396 googleapi.Expand(req.URL, map[string]string{ 11397 "product": c.product, 11398 }) 11399 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11400 } 11401 11402 // Do executes the "retail.projects.locations.catalogs.branches.products.removeFulfillmentPlaces" call. 11403 // Any non-2xx status code is an error. Response headers are in either 11404 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was 11405 // returned at all) in error.(*googleapi.Error).Header. Use 11406 // googleapi.IsNotModified to check whether the returned error was because 11407 // http.StatusNotModified was returned. 11408 func (c *ProjectsLocationsCatalogsBranchesProductsRemoveFulfillmentPlacesCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 11409 gensupport.SetOptions(c.urlParams_, opts...) 11410 res, err := c.doRequest("json") 11411 if res != nil && res.StatusCode == http.StatusNotModified { 11412 if res.Body != nil { 11413 res.Body.Close() 11414 } 11415 return nil, gensupport.WrapError(&googleapi.Error{ 11416 Code: res.StatusCode, 11417 Header: res.Header, 11418 }) 11419 } 11420 if err != nil { 11421 return nil, err 11422 } 11423 defer googleapi.CloseBody(res) 11424 if err := googleapi.CheckResponse(res); err != nil { 11425 return nil, gensupport.WrapError(err) 11426 } 11427 ret := &GoogleLongrunningOperation{ 11428 ServerResponse: googleapi.ServerResponse{ 11429 Header: res.Header, 11430 HTTPStatusCode: res.StatusCode, 11431 }, 11432 } 11433 target := &ret 11434 if err := gensupport.DecodeResponse(target, res); err != nil { 11435 return nil, err 11436 } 11437 return ret, nil 11438 } 11439 11440 type ProjectsLocationsCatalogsBranchesProductsRemoveLocalInventoriesCall struct { 11441 s *Service 11442 product string 11443 googlecloudretailv2betaremovelocalinventoriesrequest *GoogleCloudRetailV2betaRemoveLocalInventoriesRequest 11444 urlParams_ gensupport.URLParams 11445 ctx_ context.Context 11446 header_ http.Header 11447 } 11448 11449 // RemoveLocalInventories: Remove local inventory information for a Product at 11450 // a list of places at a removal timestamp. This process is asynchronous. If 11451 // the request is valid, the removal will be enqueued and processed downstream. 11452 // As a consequence, when a response is returned, removals are not immediately 11453 // manifested in the Product queried by ProductService.GetProduct or 11454 // ProductService.ListProducts. Local inventory information can only be removed 11455 // using this method. ProductService.CreateProduct and 11456 // ProductService.UpdateProduct has no effect on local inventories. The 11457 // returned Operations will be obsolete after 1 day, and GetOperation API will 11458 // return NOT_FOUND afterwards. If conflicting updates are issued, the 11459 // Operations associated with the stale updates will not be marked as done 11460 // until being obsolete. 11461 // 11462 // - product: Full resource name of Product, such as 11463 // `projects/*/locations/global/catalogs/default_catalog/branches/default_bran 11464 // ch/products/some_product_id`. If the caller does not have permission to 11465 // access the Product, regardless of whether or not it exists, a 11466 // PERMISSION_DENIED error is returned. 11467 func (r *ProjectsLocationsCatalogsBranchesProductsService) RemoveLocalInventories(product string, googlecloudretailv2betaremovelocalinventoriesrequest *GoogleCloudRetailV2betaRemoveLocalInventoriesRequest) *ProjectsLocationsCatalogsBranchesProductsRemoveLocalInventoriesCall { 11468 c := &ProjectsLocationsCatalogsBranchesProductsRemoveLocalInventoriesCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11469 c.product = product 11470 c.googlecloudretailv2betaremovelocalinventoriesrequest = googlecloudretailv2betaremovelocalinventoriesrequest 11471 return c 11472 } 11473 11474 // Fields allows partial responses to be retrieved. See 11475 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 11476 // details. 11477 func (c *ProjectsLocationsCatalogsBranchesProductsRemoveLocalInventoriesCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesProductsRemoveLocalInventoriesCall { 11478 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11479 return c 11480 } 11481 11482 // Context sets the context to be used in this call's Do method. 11483 func (c *ProjectsLocationsCatalogsBranchesProductsRemoveLocalInventoriesCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesProductsRemoveLocalInventoriesCall { 11484 c.ctx_ = ctx 11485 return c 11486 } 11487 11488 // Header returns a http.Header that can be modified by the caller to add 11489 // headers to the request. 11490 func (c *ProjectsLocationsCatalogsBranchesProductsRemoveLocalInventoriesCall) Header() http.Header { 11491 if c.header_ == nil { 11492 c.header_ = make(http.Header) 11493 } 11494 return c.header_ 11495 } 11496 11497 func (c *ProjectsLocationsCatalogsBranchesProductsRemoveLocalInventoriesCall) doRequest(alt string) (*http.Response, error) { 11498 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 11499 var body io.Reader = nil 11500 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betaremovelocalinventoriesrequest) 11501 if err != nil { 11502 return nil, err 11503 } 11504 c.urlParams_.Set("alt", alt) 11505 c.urlParams_.Set("prettyPrint", "false") 11506 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+product}:removeLocalInventories") 11507 urls += "?" + c.urlParams_.Encode() 11508 req, err := http.NewRequest("POST", urls, body) 11509 if err != nil { 11510 return nil, err 11511 } 11512 req.Header = reqHeaders 11513 googleapi.Expand(req.URL, map[string]string{ 11514 "product": c.product, 11515 }) 11516 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11517 } 11518 11519 // Do executes the "retail.projects.locations.catalogs.branches.products.removeLocalInventories" call. 11520 // Any non-2xx status code is an error. Response headers are in either 11521 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was 11522 // returned at all) in error.(*googleapi.Error).Header. Use 11523 // googleapi.IsNotModified to check whether the returned error was because 11524 // http.StatusNotModified was returned. 11525 func (c *ProjectsLocationsCatalogsBranchesProductsRemoveLocalInventoriesCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 11526 gensupport.SetOptions(c.urlParams_, opts...) 11527 res, err := c.doRequest("json") 11528 if res != nil && res.StatusCode == http.StatusNotModified { 11529 if res.Body != nil { 11530 res.Body.Close() 11531 } 11532 return nil, gensupport.WrapError(&googleapi.Error{ 11533 Code: res.StatusCode, 11534 Header: res.Header, 11535 }) 11536 } 11537 if err != nil { 11538 return nil, err 11539 } 11540 defer googleapi.CloseBody(res) 11541 if err := googleapi.CheckResponse(res); err != nil { 11542 return nil, gensupport.WrapError(err) 11543 } 11544 ret := &GoogleLongrunningOperation{ 11545 ServerResponse: googleapi.ServerResponse{ 11546 Header: res.Header, 11547 HTTPStatusCode: res.StatusCode, 11548 }, 11549 } 11550 target := &ret 11551 if err := gensupport.DecodeResponse(target, res); err != nil { 11552 return nil, err 11553 } 11554 return ret, nil 11555 } 11556 11557 type ProjectsLocationsCatalogsBranchesProductsSetInventoryCall struct { 11558 s *Service 11559 name string 11560 googlecloudretailv2betasetinventoryrequest *GoogleCloudRetailV2betaSetInventoryRequest 11561 urlParams_ gensupport.URLParams 11562 ctx_ context.Context 11563 header_ http.Header 11564 } 11565 11566 // SetInventory: Updates inventory information for a Product while respecting 11567 // the last update timestamps of each inventory field. This process is 11568 // asynchronous and does not require the Product to exist before updating 11569 // fulfillment information. If the request is valid, the update is enqueued and 11570 // processed downstream. As a consequence, when a response is returned, updates 11571 // are not immediately manifested in the Product queried by 11572 // ProductService.GetProduct or ProductService.ListProducts. When inventory is 11573 // updated with ProductService.CreateProduct and ProductService.UpdateProduct, 11574 // the specified inventory field value(s) overwrite any existing value(s) while 11575 // ignoring the last update time for this field. Furthermore, the last update 11576 // times for the specified inventory fields are overwritten by the times of the 11577 // ProductService.CreateProduct or ProductService.UpdateProduct request. If no 11578 // inventory fields are set in CreateProductRequest.product, then any 11579 // pre-existing inventory information for this product is used. If no inventory 11580 // fields are set in SetInventoryRequest.set_mask, then any existing inventory 11581 // information is preserved. Pre-existing inventory information can only be 11582 // updated with ProductService.SetInventory, 11583 // ProductService.AddFulfillmentPlaces, and 11584 // ProductService.RemoveFulfillmentPlaces. The returned Operations is obsolete 11585 // after one day, and the GetOperation API returns `NOT_FOUND` afterwards. If 11586 // conflicting updates are issued, the Operations associated with the stale 11587 // updates are not marked as done until they are obsolete. 11588 // 11589 // - name: Immutable. Full resource name of the product, such as 11590 // `projects/*/locations/global/catalogs/default_catalog/branches/default_bran 11591 // ch/products/product_id`. 11592 func (r *ProjectsLocationsCatalogsBranchesProductsService) SetInventory(name string, googlecloudretailv2betasetinventoryrequest *GoogleCloudRetailV2betaSetInventoryRequest) *ProjectsLocationsCatalogsBranchesProductsSetInventoryCall { 11593 c := &ProjectsLocationsCatalogsBranchesProductsSetInventoryCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11594 c.name = name 11595 c.googlecloudretailv2betasetinventoryrequest = googlecloudretailv2betasetinventoryrequest 11596 return c 11597 } 11598 11599 // Fields allows partial responses to be retrieved. See 11600 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 11601 // details. 11602 func (c *ProjectsLocationsCatalogsBranchesProductsSetInventoryCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesProductsSetInventoryCall { 11603 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11604 return c 11605 } 11606 11607 // Context sets the context to be used in this call's Do method. 11608 func (c *ProjectsLocationsCatalogsBranchesProductsSetInventoryCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesProductsSetInventoryCall { 11609 c.ctx_ = ctx 11610 return c 11611 } 11612 11613 // Header returns a http.Header that can be modified by the caller to add 11614 // headers to the request. 11615 func (c *ProjectsLocationsCatalogsBranchesProductsSetInventoryCall) Header() http.Header { 11616 if c.header_ == nil { 11617 c.header_ = make(http.Header) 11618 } 11619 return c.header_ 11620 } 11621 11622 func (c *ProjectsLocationsCatalogsBranchesProductsSetInventoryCall) doRequest(alt string) (*http.Response, error) { 11623 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 11624 var body io.Reader = nil 11625 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betasetinventoryrequest) 11626 if err != nil { 11627 return nil, err 11628 } 11629 c.urlParams_.Set("alt", alt) 11630 c.urlParams_.Set("prettyPrint", "false") 11631 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}:setInventory") 11632 urls += "?" + c.urlParams_.Encode() 11633 req, err := http.NewRequest("POST", urls, body) 11634 if err != nil { 11635 return nil, err 11636 } 11637 req.Header = reqHeaders 11638 googleapi.Expand(req.URL, map[string]string{ 11639 "name": c.name, 11640 }) 11641 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11642 } 11643 11644 // Do executes the "retail.projects.locations.catalogs.branches.products.setInventory" call. 11645 // Any non-2xx status code is an error. Response headers are in either 11646 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was 11647 // returned at all) in error.(*googleapi.Error).Header. Use 11648 // googleapi.IsNotModified to check whether the returned error was because 11649 // http.StatusNotModified was returned. 11650 func (c *ProjectsLocationsCatalogsBranchesProductsSetInventoryCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 11651 gensupport.SetOptions(c.urlParams_, opts...) 11652 res, err := c.doRequest("json") 11653 if res != nil && res.StatusCode == http.StatusNotModified { 11654 if res.Body != nil { 11655 res.Body.Close() 11656 } 11657 return nil, gensupport.WrapError(&googleapi.Error{ 11658 Code: res.StatusCode, 11659 Header: res.Header, 11660 }) 11661 } 11662 if err != nil { 11663 return nil, err 11664 } 11665 defer googleapi.CloseBody(res) 11666 if err := googleapi.CheckResponse(res); err != nil { 11667 return nil, gensupport.WrapError(err) 11668 } 11669 ret := &GoogleLongrunningOperation{ 11670 ServerResponse: googleapi.ServerResponse{ 11671 Header: res.Header, 11672 HTTPStatusCode: res.StatusCode, 11673 }, 11674 } 11675 target := &ret 11676 if err := gensupport.DecodeResponse(target, res); err != nil { 11677 return nil, err 11678 } 11679 return ret, nil 11680 } 11681 11682 type ProjectsLocationsCatalogsCompletionDataImportCall struct { 11683 s *Service 11684 parent string 11685 googlecloudretailv2betaimportcompletiondatarequest *GoogleCloudRetailV2betaImportCompletionDataRequest 11686 urlParams_ gensupport.URLParams 11687 ctx_ context.Context 11688 header_ http.Header 11689 } 11690 11691 // Import: Bulk import of processed completion dataset. Request processing is 11692 // asynchronous. Partial updating is not supported. The operation is 11693 // successfully finished only after the imported suggestions are indexed 11694 // successfully and ready for serving. The process takes hours. This feature is 11695 // only available for users who have Retail Search enabled. Enable Retail 11696 // Search on Cloud Console before using this feature. 11697 // 11698 // - parent: The catalog which the suggestions dataset belongs to. Format: 11699 // `projects/1234/locations/global/catalogs/default_catalog`. 11700 func (r *ProjectsLocationsCatalogsCompletionDataService) Import(parent string, googlecloudretailv2betaimportcompletiondatarequest *GoogleCloudRetailV2betaImportCompletionDataRequest) *ProjectsLocationsCatalogsCompletionDataImportCall { 11701 c := &ProjectsLocationsCatalogsCompletionDataImportCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11702 c.parent = parent 11703 c.googlecloudretailv2betaimportcompletiondatarequest = googlecloudretailv2betaimportcompletiondatarequest 11704 return c 11705 } 11706 11707 // Fields allows partial responses to be retrieved. See 11708 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 11709 // details. 11710 func (c *ProjectsLocationsCatalogsCompletionDataImportCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsCompletionDataImportCall { 11711 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11712 return c 11713 } 11714 11715 // Context sets the context to be used in this call's Do method. 11716 func (c *ProjectsLocationsCatalogsCompletionDataImportCall) Context(ctx context.Context) *ProjectsLocationsCatalogsCompletionDataImportCall { 11717 c.ctx_ = ctx 11718 return c 11719 } 11720 11721 // Header returns a http.Header that can be modified by the caller to add 11722 // headers to the request. 11723 func (c *ProjectsLocationsCatalogsCompletionDataImportCall) Header() http.Header { 11724 if c.header_ == nil { 11725 c.header_ = make(http.Header) 11726 } 11727 return c.header_ 11728 } 11729 11730 func (c *ProjectsLocationsCatalogsCompletionDataImportCall) doRequest(alt string) (*http.Response, error) { 11731 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 11732 var body io.Reader = nil 11733 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betaimportcompletiondatarequest) 11734 if err != nil { 11735 return nil, err 11736 } 11737 c.urlParams_.Set("alt", alt) 11738 c.urlParams_.Set("prettyPrint", "false") 11739 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+parent}/completionData:import") 11740 urls += "?" + c.urlParams_.Encode() 11741 req, err := http.NewRequest("POST", urls, body) 11742 if err != nil { 11743 return nil, err 11744 } 11745 req.Header = reqHeaders 11746 googleapi.Expand(req.URL, map[string]string{ 11747 "parent": c.parent, 11748 }) 11749 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11750 } 11751 11752 // Do executes the "retail.projects.locations.catalogs.completionData.import" call. 11753 // Any non-2xx status code is an error. Response headers are in either 11754 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was 11755 // returned at all) in error.(*googleapi.Error).Header. Use 11756 // googleapi.IsNotModified to check whether the returned error was because 11757 // http.StatusNotModified was returned. 11758 func (c *ProjectsLocationsCatalogsCompletionDataImportCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 11759 gensupport.SetOptions(c.urlParams_, opts...) 11760 res, err := c.doRequest("json") 11761 if res != nil && res.StatusCode == http.StatusNotModified { 11762 if res.Body != nil { 11763 res.Body.Close() 11764 } 11765 return nil, gensupport.WrapError(&googleapi.Error{ 11766 Code: res.StatusCode, 11767 Header: res.Header, 11768 }) 11769 } 11770 if err != nil { 11771 return nil, err 11772 } 11773 defer googleapi.CloseBody(res) 11774 if err := googleapi.CheckResponse(res); err != nil { 11775 return nil, gensupport.WrapError(err) 11776 } 11777 ret := &GoogleLongrunningOperation{ 11778 ServerResponse: googleapi.ServerResponse{ 11779 Header: res.Header, 11780 HTTPStatusCode: res.StatusCode, 11781 }, 11782 } 11783 target := &ret 11784 if err := gensupport.DecodeResponse(target, res); err != nil { 11785 return nil, err 11786 } 11787 return ret, nil 11788 } 11789 11790 type ProjectsLocationsCatalogsControlsCreateCall struct { 11791 s *Service 11792 parent string 11793 googlecloudretailv2betacontrol *GoogleCloudRetailV2betaControl 11794 urlParams_ gensupport.URLParams 11795 ctx_ context.Context 11796 header_ http.Header 11797 } 11798 11799 // Create: Creates a Control. If the Control to create already exists, an 11800 // ALREADY_EXISTS error is returned. 11801 // 11802 // - parent: Full resource name of parent catalog. Format: 11803 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`. 11804 func (r *ProjectsLocationsCatalogsControlsService) Create(parent string, googlecloudretailv2betacontrol *GoogleCloudRetailV2betaControl) *ProjectsLocationsCatalogsControlsCreateCall { 11805 c := &ProjectsLocationsCatalogsControlsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11806 c.parent = parent 11807 c.googlecloudretailv2betacontrol = googlecloudretailv2betacontrol 11808 return c 11809 } 11810 11811 // ControlId sets the optional parameter "controlId": Required. The ID to use 11812 // for the Control, which will become the final component of the Control's 11813 // resource name. This value should be 4-63 characters, and valid characters 11814 // are /a-z-_/. 11815 func (c *ProjectsLocationsCatalogsControlsCreateCall) ControlId(controlId string) *ProjectsLocationsCatalogsControlsCreateCall { 11816 c.urlParams_.Set("controlId", controlId) 11817 return c 11818 } 11819 11820 // Fields allows partial responses to be retrieved. See 11821 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 11822 // details. 11823 func (c *ProjectsLocationsCatalogsControlsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsControlsCreateCall { 11824 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11825 return c 11826 } 11827 11828 // Context sets the context to be used in this call's Do method. 11829 func (c *ProjectsLocationsCatalogsControlsCreateCall) Context(ctx context.Context) *ProjectsLocationsCatalogsControlsCreateCall { 11830 c.ctx_ = ctx 11831 return c 11832 } 11833 11834 // Header returns a http.Header that can be modified by the caller to add 11835 // headers to the request. 11836 func (c *ProjectsLocationsCatalogsControlsCreateCall) Header() http.Header { 11837 if c.header_ == nil { 11838 c.header_ = make(http.Header) 11839 } 11840 return c.header_ 11841 } 11842 11843 func (c *ProjectsLocationsCatalogsControlsCreateCall) doRequest(alt string) (*http.Response, error) { 11844 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 11845 var body io.Reader = nil 11846 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betacontrol) 11847 if err != nil { 11848 return nil, err 11849 } 11850 c.urlParams_.Set("alt", alt) 11851 c.urlParams_.Set("prettyPrint", "false") 11852 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+parent}/controls") 11853 urls += "?" + c.urlParams_.Encode() 11854 req, err := http.NewRequest("POST", urls, body) 11855 if err != nil { 11856 return nil, err 11857 } 11858 req.Header = reqHeaders 11859 googleapi.Expand(req.URL, map[string]string{ 11860 "parent": c.parent, 11861 }) 11862 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11863 } 11864 11865 // Do executes the "retail.projects.locations.catalogs.controls.create" call. 11866 // Any non-2xx status code is an error. Response headers are in either 11867 // *GoogleCloudRetailV2betaControl.ServerResponse.Header or (if a response was 11868 // returned at all) in error.(*googleapi.Error).Header. Use 11869 // googleapi.IsNotModified to check whether the returned error was because 11870 // http.StatusNotModified was returned. 11871 func (c *ProjectsLocationsCatalogsControlsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2betaControl, error) { 11872 gensupport.SetOptions(c.urlParams_, opts...) 11873 res, err := c.doRequest("json") 11874 if res != nil && res.StatusCode == http.StatusNotModified { 11875 if res.Body != nil { 11876 res.Body.Close() 11877 } 11878 return nil, gensupport.WrapError(&googleapi.Error{ 11879 Code: res.StatusCode, 11880 Header: res.Header, 11881 }) 11882 } 11883 if err != nil { 11884 return nil, err 11885 } 11886 defer googleapi.CloseBody(res) 11887 if err := googleapi.CheckResponse(res); err != nil { 11888 return nil, gensupport.WrapError(err) 11889 } 11890 ret := &GoogleCloudRetailV2betaControl{ 11891 ServerResponse: googleapi.ServerResponse{ 11892 Header: res.Header, 11893 HTTPStatusCode: res.StatusCode, 11894 }, 11895 } 11896 target := &ret 11897 if err := gensupport.DecodeResponse(target, res); err != nil { 11898 return nil, err 11899 } 11900 return ret, nil 11901 } 11902 11903 type ProjectsLocationsCatalogsControlsDeleteCall struct { 11904 s *Service 11905 name string 11906 urlParams_ gensupport.URLParams 11907 ctx_ context.Context 11908 header_ http.Header 11909 } 11910 11911 // Delete: Deletes a Control. If the Control to delete does not exist, a 11912 // NOT_FOUND error is returned. 11913 // 11914 // - name: The resource name of the Control to delete. Format: 11915 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/co 11916 // ntrols/{control_id}`. 11917 func (r *ProjectsLocationsCatalogsControlsService) Delete(name string) *ProjectsLocationsCatalogsControlsDeleteCall { 11918 c := &ProjectsLocationsCatalogsControlsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11919 c.name = name 11920 return c 11921 } 11922 11923 // Fields allows partial responses to be retrieved. See 11924 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 11925 // details. 11926 func (c *ProjectsLocationsCatalogsControlsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsControlsDeleteCall { 11927 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11928 return c 11929 } 11930 11931 // Context sets the context to be used in this call's Do method. 11932 func (c *ProjectsLocationsCatalogsControlsDeleteCall) Context(ctx context.Context) *ProjectsLocationsCatalogsControlsDeleteCall { 11933 c.ctx_ = ctx 11934 return c 11935 } 11936 11937 // Header returns a http.Header that can be modified by the caller to add 11938 // headers to the request. 11939 func (c *ProjectsLocationsCatalogsControlsDeleteCall) Header() http.Header { 11940 if c.header_ == nil { 11941 c.header_ = make(http.Header) 11942 } 11943 return c.header_ 11944 } 11945 11946 func (c *ProjectsLocationsCatalogsControlsDeleteCall) doRequest(alt string) (*http.Response, error) { 11947 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 11948 var body io.Reader = nil 11949 c.urlParams_.Set("alt", alt) 11950 c.urlParams_.Set("prettyPrint", "false") 11951 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}") 11952 urls += "?" + c.urlParams_.Encode() 11953 req, err := http.NewRequest("DELETE", urls, body) 11954 if err != nil { 11955 return nil, err 11956 } 11957 req.Header = reqHeaders 11958 googleapi.Expand(req.URL, map[string]string{ 11959 "name": c.name, 11960 }) 11961 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11962 } 11963 11964 // Do executes the "retail.projects.locations.catalogs.controls.delete" call. 11965 // Any non-2xx status code is an error. Response headers are in either 11966 // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at 11967 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 11968 // check whether the returned error was because http.StatusNotModified was 11969 // returned. 11970 func (c *ProjectsLocationsCatalogsControlsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { 11971 gensupport.SetOptions(c.urlParams_, opts...) 11972 res, err := c.doRequest("json") 11973 if res != nil && res.StatusCode == http.StatusNotModified { 11974 if res.Body != nil { 11975 res.Body.Close() 11976 } 11977 return nil, gensupport.WrapError(&googleapi.Error{ 11978 Code: res.StatusCode, 11979 Header: res.Header, 11980 }) 11981 } 11982 if err != nil { 11983 return nil, err 11984 } 11985 defer googleapi.CloseBody(res) 11986 if err := googleapi.CheckResponse(res); err != nil { 11987 return nil, gensupport.WrapError(err) 11988 } 11989 ret := &GoogleProtobufEmpty{ 11990 ServerResponse: googleapi.ServerResponse{ 11991 Header: res.Header, 11992 HTTPStatusCode: res.StatusCode, 11993 }, 11994 } 11995 target := &ret 11996 if err := gensupport.DecodeResponse(target, res); err != nil { 11997 return nil, err 11998 } 11999 return ret, nil 12000 } 12001 12002 type ProjectsLocationsCatalogsControlsGetCall struct { 12003 s *Service 12004 name string 12005 urlParams_ gensupport.URLParams 12006 ifNoneMatch_ string 12007 ctx_ context.Context 12008 header_ http.Header 12009 } 12010 12011 // Get: Gets a Control. 12012 // 12013 // - name: The resource name of the Control to get. Format: 12014 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/co 12015 // ntrols/{control_id}`. 12016 func (r *ProjectsLocationsCatalogsControlsService) Get(name string) *ProjectsLocationsCatalogsControlsGetCall { 12017 c := &ProjectsLocationsCatalogsControlsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12018 c.name = name 12019 return c 12020 } 12021 12022 // Fields allows partial responses to be retrieved. See 12023 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 12024 // details. 12025 func (c *ProjectsLocationsCatalogsControlsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsControlsGetCall { 12026 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12027 return c 12028 } 12029 12030 // IfNoneMatch sets an optional parameter which makes the operation fail if the 12031 // object's ETag matches the given value. This is useful for getting updates 12032 // only after the object has changed since the last request. 12033 func (c *ProjectsLocationsCatalogsControlsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsControlsGetCall { 12034 c.ifNoneMatch_ = entityTag 12035 return c 12036 } 12037 12038 // Context sets the context to be used in this call's Do method. 12039 func (c *ProjectsLocationsCatalogsControlsGetCall) Context(ctx context.Context) *ProjectsLocationsCatalogsControlsGetCall { 12040 c.ctx_ = ctx 12041 return c 12042 } 12043 12044 // Header returns a http.Header that can be modified by the caller to add 12045 // headers to the request. 12046 func (c *ProjectsLocationsCatalogsControlsGetCall) Header() http.Header { 12047 if c.header_ == nil { 12048 c.header_ = make(http.Header) 12049 } 12050 return c.header_ 12051 } 12052 12053 func (c *ProjectsLocationsCatalogsControlsGetCall) doRequest(alt string) (*http.Response, error) { 12054 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 12055 if c.ifNoneMatch_ != "" { 12056 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 12057 } 12058 var body io.Reader = nil 12059 c.urlParams_.Set("alt", alt) 12060 c.urlParams_.Set("prettyPrint", "false") 12061 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}") 12062 urls += "?" + c.urlParams_.Encode() 12063 req, err := http.NewRequest("GET", urls, body) 12064 if err != nil { 12065 return nil, err 12066 } 12067 req.Header = reqHeaders 12068 googleapi.Expand(req.URL, map[string]string{ 12069 "name": c.name, 12070 }) 12071 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12072 } 12073 12074 // Do executes the "retail.projects.locations.catalogs.controls.get" call. 12075 // Any non-2xx status code is an error. Response headers are in either 12076 // *GoogleCloudRetailV2betaControl.ServerResponse.Header or (if a response was 12077 // returned at all) in error.(*googleapi.Error).Header. Use 12078 // googleapi.IsNotModified to check whether the returned error was because 12079 // http.StatusNotModified was returned. 12080 func (c *ProjectsLocationsCatalogsControlsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2betaControl, error) { 12081 gensupport.SetOptions(c.urlParams_, opts...) 12082 res, err := c.doRequest("json") 12083 if res != nil && res.StatusCode == http.StatusNotModified { 12084 if res.Body != nil { 12085 res.Body.Close() 12086 } 12087 return nil, gensupport.WrapError(&googleapi.Error{ 12088 Code: res.StatusCode, 12089 Header: res.Header, 12090 }) 12091 } 12092 if err != nil { 12093 return nil, err 12094 } 12095 defer googleapi.CloseBody(res) 12096 if err := googleapi.CheckResponse(res); err != nil { 12097 return nil, gensupport.WrapError(err) 12098 } 12099 ret := &GoogleCloudRetailV2betaControl{ 12100 ServerResponse: googleapi.ServerResponse{ 12101 Header: res.Header, 12102 HTTPStatusCode: res.StatusCode, 12103 }, 12104 } 12105 target := &ret 12106 if err := gensupport.DecodeResponse(target, res); err != nil { 12107 return nil, err 12108 } 12109 return ret, nil 12110 } 12111 12112 type ProjectsLocationsCatalogsControlsListCall struct { 12113 s *Service 12114 parent string 12115 urlParams_ gensupport.URLParams 12116 ifNoneMatch_ string 12117 ctx_ context.Context 12118 header_ http.Header 12119 } 12120 12121 // List: Lists all Controls by their parent Catalog. 12122 // 12123 // - parent: The catalog resource name. Format: 12124 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`. 12125 func (r *ProjectsLocationsCatalogsControlsService) List(parent string) *ProjectsLocationsCatalogsControlsListCall { 12126 c := &ProjectsLocationsCatalogsControlsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12127 c.parent = parent 12128 return c 12129 } 12130 12131 // Filter sets the optional parameter "filter": A filter to apply on the list 12132 // results. Supported features: * List all the products under the parent branch 12133 // if filter is unset. * List controls that are used in a single ServingConfig: 12134 // 'serving_config = "boosted_home_page_cvr"' 12135 func (c *ProjectsLocationsCatalogsControlsListCall) Filter(filter string) *ProjectsLocationsCatalogsControlsListCall { 12136 c.urlParams_.Set("filter", filter) 12137 return c 12138 } 12139 12140 // PageSize sets the optional parameter "pageSize": Maximum number of results 12141 // to return. If unspecified, defaults to 50. Max allowed value is 1000. 12142 func (c *ProjectsLocationsCatalogsControlsListCall) PageSize(pageSize int64) *ProjectsLocationsCatalogsControlsListCall { 12143 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 12144 return c 12145 } 12146 12147 // PageToken sets the optional parameter "pageToken": A page token, received 12148 // from a previous `ListControls` call. Provide this to retrieve the subsequent 12149 // page. 12150 func (c *ProjectsLocationsCatalogsControlsListCall) PageToken(pageToken string) *ProjectsLocationsCatalogsControlsListCall { 12151 c.urlParams_.Set("pageToken", pageToken) 12152 return c 12153 } 12154 12155 // Fields allows partial responses to be retrieved. See 12156 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 12157 // details. 12158 func (c *ProjectsLocationsCatalogsControlsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsControlsListCall { 12159 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12160 return c 12161 } 12162 12163 // IfNoneMatch sets an optional parameter which makes the operation fail if the 12164 // object's ETag matches the given value. This is useful for getting updates 12165 // only after the object has changed since the last request. 12166 func (c *ProjectsLocationsCatalogsControlsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsControlsListCall { 12167 c.ifNoneMatch_ = entityTag 12168 return c 12169 } 12170 12171 // Context sets the context to be used in this call's Do method. 12172 func (c *ProjectsLocationsCatalogsControlsListCall) Context(ctx context.Context) *ProjectsLocationsCatalogsControlsListCall { 12173 c.ctx_ = ctx 12174 return c 12175 } 12176 12177 // Header returns a http.Header that can be modified by the caller to add 12178 // headers to the request. 12179 func (c *ProjectsLocationsCatalogsControlsListCall) Header() http.Header { 12180 if c.header_ == nil { 12181 c.header_ = make(http.Header) 12182 } 12183 return c.header_ 12184 } 12185 12186 func (c *ProjectsLocationsCatalogsControlsListCall) doRequest(alt string) (*http.Response, error) { 12187 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 12188 if c.ifNoneMatch_ != "" { 12189 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 12190 } 12191 var body io.Reader = nil 12192 c.urlParams_.Set("alt", alt) 12193 c.urlParams_.Set("prettyPrint", "false") 12194 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+parent}/controls") 12195 urls += "?" + c.urlParams_.Encode() 12196 req, err := http.NewRequest("GET", urls, body) 12197 if err != nil { 12198 return nil, err 12199 } 12200 req.Header = reqHeaders 12201 googleapi.Expand(req.URL, map[string]string{ 12202 "parent": c.parent, 12203 }) 12204 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12205 } 12206 12207 // Do executes the "retail.projects.locations.catalogs.controls.list" call. 12208 // Any non-2xx status code is an error. Response headers are in either 12209 // *GoogleCloudRetailV2betaListControlsResponse.ServerResponse.Header or (if a 12210 // response was returned at all) in error.(*googleapi.Error).Header. Use 12211 // googleapi.IsNotModified to check whether the returned error was because 12212 // http.StatusNotModified was returned. 12213 func (c *ProjectsLocationsCatalogsControlsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2betaListControlsResponse, error) { 12214 gensupport.SetOptions(c.urlParams_, opts...) 12215 res, err := c.doRequest("json") 12216 if res != nil && res.StatusCode == http.StatusNotModified { 12217 if res.Body != nil { 12218 res.Body.Close() 12219 } 12220 return nil, gensupport.WrapError(&googleapi.Error{ 12221 Code: res.StatusCode, 12222 Header: res.Header, 12223 }) 12224 } 12225 if err != nil { 12226 return nil, err 12227 } 12228 defer googleapi.CloseBody(res) 12229 if err := googleapi.CheckResponse(res); err != nil { 12230 return nil, gensupport.WrapError(err) 12231 } 12232 ret := &GoogleCloudRetailV2betaListControlsResponse{ 12233 ServerResponse: googleapi.ServerResponse{ 12234 Header: res.Header, 12235 HTTPStatusCode: res.StatusCode, 12236 }, 12237 } 12238 target := &ret 12239 if err := gensupport.DecodeResponse(target, res); err != nil { 12240 return nil, err 12241 } 12242 return ret, nil 12243 } 12244 12245 // Pages invokes f for each page of results. 12246 // A non-nil error returned from f will halt the iteration. 12247 // The provided context supersedes any context provided to the Context method. 12248 func (c *ProjectsLocationsCatalogsControlsListCall) Pages(ctx context.Context, f func(*GoogleCloudRetailV2betaListControlsResponse) error) error { 12249 c.ctx_ = ctx 12250 defer c.PageToken(c.urlParams_.Get("pageToken")) 12251 for { 12252 x, err := c.Do() 12253 if err != nil { 12254 return err 12255 } 12256 if err := f(x); err != nil { 12257 return err 12258 } 12259 if x.NextPageToken == "" { 12260 return nil 12261 } 12262 c.PageToken(x.NextPageToken) 12263 } 12264 } 12265 12266 type ProjectsLocationsCatalogsControlsPatchCall struct { 12267 s *Service 12268 name string 12269 googlecloudretailv2betacontrol *GoogleCloudRetailV2betaControl 12270 urlParams_ gensupport.URLParams 12271 ctx_ context.Context 12272 header_ http.Header 12273 } 12274 12275 // Patch: Updates a Control. Control cannot be set to a different oneof field, 12276 // if so an INVALID_ARGUMENT is returned. If the Control to update does not 12277 // exist, a NOT_FOUND error is returned. 12278 // 12279 // - name: Immutable. Fully qualified name 12280 // `projects/*/locations/global/catalogs/*/controls/*`. 12281 func (r *ProjectsLocationsCatalogsControlsService) Patch(name string, googlecloudretailv2betacontrol *GoogleCloudRetailV2betaControl) *ProjectsLocationsCatalogsControlsPatchCall { 12282 c := &ProjectsLocationsCatalogsControlsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12283 c.name = name 12284 c.googlecloudretailv2betacontrol = googlecloudretailv2betacontrol 12285 return c 12286 } 12287 12288 // UpdateMask sets the optional parameter "updateMask": Indicates which fields 12289 // in the provided Control to update. The following are NOT supported: * 12290 // Control.name If not set or empty, all supported fields are updated. 12291 func (c *ProjectsLocationsCatalogsControlsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsCatalogsControlsPatchCall { 12292 c.urlParams_.Set("updateMask", updateMask) 12293 return c 12294 } 12295 12296 // Fields allows partial responses to be retrieved. See 12297 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 12298 // details. 12299 func (c *ProjectsLocationsCatalogsControlsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsControlsPatchCall { 12300 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12301 return c 12302 } 12303 12304 // Context sets the context to be used in this call's Do method. 12305 func (c *ProjectsLocationsCatalogsControlsPatchCall) Context(ctx context.Context) *ProjectsLocationsCatalogsControlsPatchCall { 12306 c.ctx_ = ctx 12307 return c 12308 } 12309 12310 // Header returns a http.Header that can be modified by the caller to add 12311 // headers to the request. 12312 func (c *ProjectsLocationsCatalogsControlsPatchCall) Header() http.Header { 12313 if c.header_ == nil { 12314 c.header_ = make(http.Header) 12315 } 12316 return c.header_ 12317 } 12318 12319 func (c *ProjectsLocationsCatalogsControlsPatchCall) doRequest(alt string) (*http.Response, error) { 12320 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 12321 var body io.Reader = nil 12322 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betacontrol) 12323 if err != nil { 12324 return nil, err 12325 } 12326 c.urlParams_.Set("alt", alt) 12327 c.urlParams_.Set("prettyPrint", "false") 12328 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}") 12329 urls += "?" + c.urlParams_.Encode() 12330 req, err := http.NewRequest("PATCH", urls, body) 12331 if err != nil { 12332 return nil, err 12333 } 12334 req.Header = reqHeaders 12335 googleapi.Expand(req.URL, map[string]string{ 12336 "name": c.name, 12337 }) 12338 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12339 } 12340 12341 // Do executes the "retail.projects.locations.catalogs.controls.patch" call. 12342 // Any non-2xx status code is an error. Response headers are in either 12343 // *GoogleCloudRetailV2betaControl.ServerResponse.Header or (if a response was 12344 // returned at all) in error.(*googleapi.Error).Header. Use 12345 // googleapi.IsNotModified to check whether the returned error was because 12346 // http.StatusNotModified was returned. 12347 func (c *ProjectsLocationsCatalogsControlsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2betaControl, error) { 12348 gensupport.SetOptions(c.urlParams_, opts...) 12349 res, err := c.doRequest("json") 12350 if res != nil && res.StatusCode == http.StatusNotModified { 12351 if res.Body != nil { 12352 res.Body.Close() 12353 } 12354 return nil, gensupport.WrapError(&googleapi.Error{ 12355 Code: res.StatusCode, 12356 Header: res.Header, 12357 }) 12358 } 12359 if err != nil { 12360 return nil, err 12361 } 12362 defer googleapi.CloseBody(res) 12363 if err := googleapi.CheckResponse(res); err != nil { 12364 return nil, gensupport.WrapError(err) 12365 } 12366 ret := &GoogleCloudRetailV2betaControl{ 12367 ServerResponse: googleapi.ServerResponse{ 12368 Header: res.Header, 12369 HTTPStatusCode: res.StatusCode, 12370 }, 12371 } 12372 target := &ret 12373 if err := gensupport.DecodeResponse(target, res); err != nil { 12374 return nil, err 12375 } 12376 return ret, nil 12377 } 12378 12379 type ProjectsLocationsCatalogsModelsCreateCall struct { 12380 s *Service 12381 parent string 12382 googlecloudretailv2betamodel *GoogleCloudRetailV2betaModel 12383 urlParams_ gensupport.URLParams 12384 ctx_ context.Context 12385 header_ http.Header 12386 } 12387 12388 // Create: Creates a new model. 12389 // 12390 // - parent: The parent resource under which to create the model. Format: 12391 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`. 12392 func (r *ProjectsLocationsCatalogsModelsService) Create(parent string, googlecloudretailv2betamodel *GoogleCloudRetailV2betaModel) *ProjectsLocationsCatalogsModelsCreateCall { 12393 c := &ProjectsLocationsCatalogsModelsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12394 c.parent = parent 12395 c.googlecloudretailv2betamodel = googlecloudretailv2betamodel 12396 return c 12397 } 12398 12399 // DryRun sets the optional parameter "dryRun": Whether to run a dry run to 12400 // validate the request (without actually creating the model). 12401 func (c *ProjectsLocationsCatalogsModelsCreateCall) DryRun(dryRun bool) *ProjectsLocationsCatalogsModelsCreateCall { 12402 c.urlParams_.Set("dryRun", fmt.Sprint(dryRun)) 12403 return c 12404 } 12405 12406 // Fields allows partial responses to be retrieved. See 12407 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 12408 // details. 12409 func (c *ProjectsLocationsCatalogsModelsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsModelsCreateCall { 12410 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12411 return c 12412 } 12413 12414 // Context sets the context to be used in this call's Do method. 12415 func (c *ProjectsLocationsCatalogsModelsCreateCall) Context(ctx context.Context) *ProjectsLocationsCatalogsModelsCreateCall { 12416 c.ctx_ = ctx 12417 return c 12418 } 12419 12420 // Header returns a http.Header that can be modified by the caller to add 12421 // headers to the request. 12422 func (c *ProjectsLocationsCatalogsModelsCreateCall) Header() http.Header { 12423 if c.header_ == nil { 12424 c.header_ = make(http.Header) 12425 } 12426 return c.header_ 12427 } 12428 12429 func (c *ProjectsLocationsCatalogsModelsCreateCall) doRequest(alt string) (*http.Response, error) { 12430 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 12431 var body io.Reader = nil 12432 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betamodel) 12433 if err != nil { 12434 return nil, err 12435 } 12436 c.urlParams_.Set("alt", alt) 12437 c.urlParams_.Set("prettyPrint", "false") 12438 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+parent}/models") 12439 urls += "?" + c.urlParams_.Encode() 12440 req, err := http.NewRequest("POST", urls, body) 12441 if err != nil { 12442 return nil, err 12443 } 12444 req.Header = reqHeaders 12445 googleapi.Expand(req.URL, map[string]string{ 12446 "parent": c.parent, 12447 }) 12448 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12449 } 12450 12451 // Do executes the "retail.projects.locations.catalogs.models.create" call. 12452 // Any non-2xx status code is an error. Response headers are in either 12453 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was 12454 // returned at all) in error.(*googleapi.Error).Header. Use 12455 // googleapi.IsNotModified to check whether the returned error was because 12456 // http.StatusNotModified was returned. 12457 func (c *ProjectsLocationsCatalogsModelsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 12458 gensupport.SetOptions(c.urlParams_, opts...) 12459 res, err := c.doRequest("json") 12460 if res != nil && res.StatusCode == http.StatusNotModified { 12461 if res.Body != nil { 12462 res.Body.Close() 12463 } 12464 return nil, gensupport.WrapError(&googleapi.Error{ 12465 Code: res.StatusCode, 12466 Header: res.Header, 12467 }) 12468 } 12469 if err != nil { 12470 return nil, err 12471 } 12472 defer googleapi.CloseBody(res) 12473 if err := googleapi.CheckResponse(res); err != nil { 12474 return nil, gensupport.WrapError(err) 12475 } 12476 ret := &GoogleLongrunningOperation{ 12477 ServerResponse: googleapi.ServerResponse{ 12478 Header: res.Header, 12479 HTTPStatusCode: res.StatusCode, 12480 }, 12481 } 12482 target := &ret 12483 if err := gensupport.DecodeResponse(target, res); err != nil { 12484 return nil, err 12485 } 12486 return ret, nil 12487 } 12488 12489 type ProjectsLocationsCatalogsModelsDeleteCall struct { 12490 s *Service 12491 name string 12492 urlParams_ gensupport.URLParams 12493 ctx_ context.Context 12494 header_ http.Header 12495 } 12496 12497 // Delete: Deletes an existing model. 12498 // 12499 // - name: The resource name of the Model to delete. Format: 12500 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/mo 12501 // dels/{model_id}`. 12502 func (r *ProjectsLocationsCatalogsModelsService) Delete(name string) *ProjectsLocationsCatalogsModelsDeleteCall { 12503 c := &ProjectsLocationsCatalogsModelsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12504 c.name = name 12505 return c 12506 } 12507 12508 // Fields allows partial responses to be retrieved. See 12509 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 12510 // details. 12511 func (c *ProjectsLocationsCatalogsModelsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsModelsDeleteCall { 12512 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12513 return c 12514 } 12515 12516 // Context sets the context to be used in this call's Do method. 12517 func (c *ProjectsLocationsCatalogsModelsDeleteCall) Context(ctx context.Context) *ProjectsLocationsCatalogsModelsDeleteCall { 12518 c.ctx_ = ctx 12519 return c 12520 } 12521 12522 // Header returns a http.Header that can be modified by the caller to add 12523 // headers to the request. 12524 func (c *ProjectsLocationsCatalogsModelsDeleteCall) Header() http.Header { 12525 if c.header_ == nil { 12526 c.header_ = make(http.Header) 12527 } 12528 return c.header_ 12529 } 12530 12531 func (c *ProjectsLocationsCatalogsModelsDeleteCall) doRequest(alt string) (*http.Response, error) { 12532 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 12533 var body io.Reader = nil 12534 c.urlParams_.Set("alt", alt) 12535 c.urlParams_.Set("prettyPrint", "false") 12536 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}") 12537 urls += "?" + c.urlParams_.Encode() 12538 req, err := http.NewRequest("DELETE", urls, body) 12539 if err != nil { 12540 return nil, err 12541 } 12542 req.Header = reqHeaders 12543 googleapi.Expand(req.URL, map[string]string{ 12544 "name": c.name, 12545 }) 12546 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12547 } 12548 12549 // Do executes the "retail.projects.locations.catalogs.models.delete" call. 12550 // Any non-2xx status code is an error. Response headers are in either 12551 // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at 12552 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 12553 // check whether the returned error was because http.StatusNotModified was 12554 // returned. 12555 func (c *ProjectsLocationsCatalogsModelsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { 12556 gensupport.SetOptions(c.urlParams_, opts...) 12557 res, err := c.doRequest("json") 12558 if res != nil && res.StatusCode == http.StatusNotModified { 12559 if res.Body != nil { 12560 res.Body.Close() 12561 } 12562 return nil, gensupport.WrapError(&googleapi.Error{ 12563 Code: res.StatusCode, 12564 Header: res.Header, 12565 }) 12566 } 12567 if err != nil { 12568 return nil, err 12569 } 12570 defer googleapi.CloseBody(res) 12571 if err := googleapi.CheckResponse(res); err != nil { 12572 return nil, gensupport.WrapError(err) 12573 } 12574 ret := &GoogleProtobufEmpty{ 12575 ServerResponse: googleapi.ServerResponse{ 12576 Header: res.Header, 12577 HTTPStatusCode: res.StatusCode, 12578 }, 12579 } 12580 target := &ret 12581 if err := gensupport.DecodeResponse(target, res); err != nil { 12582 return nil, err 12583 } 12584 return ret, nil 12585 } 12586 12587 type ProjectsLocationsCatalogsModelsGetCall struct { 12588 s *Service 12589 name string 12590 urlParams_ gensupport.URLParams 12591 ifNoneMatch_ string 12592 ctx_ context.Context 12593 header_ http.Header 12594 } 12595 12596 // Get: Gets a model. 12597 // 12598 // - name: The resource name of the Model to get. Format: 12599 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog}/model 12600 // s/{model_id}`. 12601 func (r *ProjectsLocationsCatalogsModelsService) Get(name string) *ProjectsLocationsCatalogsModelsGetCall { 12602 c := &ProjectsLocationsCatalogsModelsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12603 c.name = name 12604 return c 12605 } 12606 12607 // Fields allows partial responses to be retrieved. See 12608 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 12609 // details. 12610 func (c *ProjectsLocationsCatalogsModelsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsModelsGetCall { 12611 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12612 return c 12613 } 12614 12615 // IfNoneMatch sets an optional parameter which makes the operation fail if the 12616 // object's ETag matches the given value. This is useful for getting updates 12617 // only after the object has changed since the last request. 12618 func (c *ProjectsLocationsCatalogsModelsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsModelsGetCall { 12619 c.ifNoneMatch_ = entityTag 12620 return c 12621 } 12622 12623 // Context sets the context to be used in this call's Do method. 12624 func (c *ProjectsLocationsCatalogsModelsGetCall) Context(ctx context.Context) *ProjectsLocationsCatalogsModelsGetCall { 12625 c.ctx_ = ctx 12626 return c 12627 } 12628 12629 // Header returns a http.Header that can be modified by the caller to add 12630 // headers to the request. 12631 func (c *ProjectsLocationsCatalogsModelsGetCall) Header() http.Header { 12632 if c.header_ == nil { 12633 c.header_ = make(http.Header) 12634 } 12635 return c.header_ 12636 } 12637 12638 func (c *ProjectsLocationsCatalogsModelsGetCall) doRequest(alt string) (*http.Response, error) { 12639 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 12640 if c.ifNoneMatch_ != "" { 12641 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 12642 } 12643 var body io.Reader = nil 12644 c.urlParams_.Set("alt", alt) 12645 c.urlParams_.Set("prettyPrint", "false") 12646 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}") 12647 urls += "?" + c.urlParams_.Encode() 12648 req, err := http.NewRequest("GET", urls, body) 12649 if err != nil { 12650 return nil, err 12651 } 12652 req.Header = reqHeaders 12653 googleapi.Expand(req.URL, map[string]string{ 12654 "name": c.name, 12655 }) 12656 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12657 } 12658 12659 // Do executes the "retail.projects.locations.catalogs.models.get" call. 12660 // Any non-2xx status code is an error. Response headers are in either 12661 // *GoogleCloudRetailV2betaModel.ServerResponse.Header or (if a response was 12662 // returned at all) in error.(*googleapi.Error).Header. Use 12663 // googleapi.IsNotModified to check whether the returned error was because 12664 // http.StatusNotModified was returned. 12665 func (c *ProjectsLocationsCatalogsModelsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2betaModel, error) { 12666 gensupport.SetOptions(c.urlParams_, opts...) 12667 res, err := c.doRequest("json") 12668 if res != nil && res.StatusCode == http.StatusNotModified { 12669 if res.Body != nil { 12670 res.Body.Close() 12671 } 12672 return nil, gensupport.WrapError(&googleapi.Error{ 12673 Code: res.StatusCode, 12674 Header: res.Header, 12675 }) 12676 } 12677 if err != nil { 12678 return nil, err 12679 } 12680 defer googleapi.CloseBody(res) 12681 if err := googleapi.CheckResponse(res); err != nil { 12682 return nil, gensupport.WrapError(err) 12683 } 12684 ret := &GoogleCloudRetailV2betaModel{ 12685 ServerResponse: googleapi.ServerResponse{ 12686 Header: res.Header, 12687 HTTPStatusCode: res.StatusCode, 12688 }, 12689 } 12690 target := &ret 12691 if err := gensupport.DecodeResponse(target, res); err != nil { 12692 return nil, err 12693 } 12694 return ret, nil 12695 } 12696 12697 type ProjectsLocationsCatalogsModelsListCall struct { 12698 s *Service 12699 parent string 12700 urlParams_ gensupport.URLParams 12701 ifNoneMatch_ string 12702 ctx_ context.Context 12703 header_ http.Header 12704 } 12705 12706 // List: Lists all the models linked to this event store. 12707 // 12708 // - parent: The parent for which to list models. Format: 12709 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`. 12710 func (r *ProjectsLocationsCatalogsModelsService) List(parent string) *ProjectsLocationsCatalogsModelsListCall { 12711 c := &ProjectsLocationsCatalogsModelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12712 c.parent = parent 12713 return c 12714 } 12715 12716 // PageSize sets the optional parameter "pageSize": Maximum number of results 12717 // to return. If unspecified, defaults to 50. Max allowed value is 1000. 12718 func (c *ProjectsLocationsCatalogsModelsListCall) PageSize(pageSize int64) *ProjectsLocationsCatalogsModelsListCall { 12719 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 12720 return c 12721 } 12722 12723 // PageToken sets the optional parameter "pageToken": A page token, received 12724 // from a previous `ListModels` call. Provide this to retrieve the subsequent 12725 // page. 12726 func (c *ProjectsLocationsCatalogsModelsListCall) PageToken(pageToken string) *ProjectsLocationsCatalogsModelsListCall { 12727 c.urlParams_.Set("pageToken", pageToken) 12728 return c 12729 } 12730 12731 // Fields allows partial responses to be retrieved. See 12732 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 12733 // details. 12734 func (c *ProjectsLocationsCatalogsModelsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsModelsListCall { 12735 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12736 return c 12737 } 12738 12739 // IfNoneMatch sets an optional parameter which makes the operation fail if the 12740 // object's ETag matches the given value. This is useful for getting updates 12741 // only after the object has changed since the last request. 12742 func (c *ProjectsLocationsCatalogsModelsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsModelsListCall { 12743 c.ifNoneMatch_ = entityTag 12744 return c 12745 } 12746 12747 // Context sets the context to be used in this call's Do method. 12748 func (c *ProjectsLocationsCatalogsModelsListCall) Context(ctx context.Context) *ProjectsLocationsCatalogsModelsListCall { 12749 c.ctx_ = ctx 12750 return c 12751 } 12752 12753 // Header returns a http.Header that can be modified by the caller to add 12754 // headers to the request. 12755 func (c *ProjectsLocationsCatalogsModelsListCall) Header() http.Header { 12756 if c.header_ == nil { 12757 c.header_ = make(http.Header) 12758 } 12759 return c.header_ 12760 } 12761 12762 func (c *ProjectsLocationsCatalogsModelsListCall) doRequest(alt string) (*http.Response, error) { 12763 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 12764 if c.ifNoneMatch_ != "" { 12765 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 12766 } 12767 var body io.Reader = nil 12768 c.urlParams_.Set("alt", alt) 12769 c.urlParams_.Set("prettyPrint", "false") 12770 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+parent}/models") 12771 urls += "?" + c.urlParams_.Encode() 12772 req, err := http.NewRequest("GET", urls, body) 12773 if err != nil { 12774 return nil, err 12775 } 12776 req.Header = reqHeaders 12777 googleapi.Expand(req.URL, map[string]string{ 12778 "parent": c.parent, 12779 }) 12780 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12781 } 12782 12783 // Do executes the "retail.projects.locations.catalogs.models.list" call. 12784 // Any non-2xx status code is an error. Response headers are in either 12785 // *GoogleCloudRetailV2betaListModelsResponse.ServerResponse.Header or (if a 12786 // response was returned at all) in error.(*googleapi.Error).Header. Use 12787 // googleapi.IsNotModified to check whether the returned error was because 12788 // http.StatusNotModified was returned. 12789 func (c *ProjectsLocationsCatalogsModelsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2betaListModelsResponse, error) { 12790 gensupport.SetOptions(c.urlParams_, opts...) 12791 res, err := c.doRequest("json") 12792 if res != nil && res.StatusCode == http.StatusNotModified { 12793 if res.Body != nil { 12794 res.Body.Close() 12795 } 12796 return nil, gensupport.WrapError(&googleapi.Error{ 12797 Code: res.StatusCode, 12798 Header: res.Header, 12799 }) 12800 } 12801 if err != nil { 12802 return nil, err 12803 } 12804 defer googleapi.CloseBody(res) 12805 if err := googleapi.CheckResponse(res); err != nil { 12806 return nil, gensupport.WrapError(err) 12807 } 12808 ret := &GoogleCloudRetailV2betaListModelsResponse{ 12809 ServerResponse: googleapi.ServerResponse{ 12810 Header: res.Header, 12811 HTTPStatusCode: res.StatusCode, 12812 }, 12813 } 12814 target := &ret 12815 if err := gensupport.DecodeResponse(target, res); err != nil { 12816 return nil, err 12817 } 12818 return ret, nil 12819 } 12820 12821 // Pages invokes f for each page of results. 12822 // A non-nil error returned from f will halt the iteration. 12823 // The provided context supersedes any context provided to the Context method. 12824 func (c *ProjectsLocationsCatalogsModelsListCall) Pages(ctx context.Context, f func(*GoogleCloudRetailV2betaListModelsResponse) error) error { 12825 c.ctx_ = ctx 12826 defer c.PageToken(c.urlParams_.Get("pageToken")) 12827 for { 12828 x, err := c.Do() 12829 if err != nil { 12830 return err 12831 } 12832 if err := f(x); err != nil { 12833 return err 12834 } 12835 if x.NextPageToken == "" { 12836 return nil 12837 } 12838 c.PageToken(x.NextPageToken) 12839 } 12840 } 12841 12842 type ProjectsLocationsCatalogsModelsPatchCall struct { 12843 s *Service 12844 name string 12845 googlecloudretailv2betamodel *GoogleCloudRetailV2betaModel 12846 urlParams_ gensupport.URLParams 12847 ctx_ context.Context 12848 header_ http.Header 12849 } 12850 12851 // Patch: Update of model metadata. Only fields that currently can be updated 12852 // are: `filtering_option` and `periodic_tuning_state`. If other values are 12853 // provided, this API method ignores them. 12854 // 12855 // - name: The fully qualified resource name of the model. Format: 12856 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/mo 12857 // dels/{model_id}` catalog_id has char limit of 50. recommendation_model_id 12858 // has char limit of 40. 12859 func (r *ProjectsLocationsCatalogsModelsService) Patch(name string, googlecloudretailv2betamodel *GoogleCloudRetailV2betaModel) *ProjectsLocationsCatalogsModelsPatchCall { 12860 c := &ProjectsLocationsCatalogsModelsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12861 c.name = name 12862 c.googlecloudretailv2betamodel = googlecloudretailv2betamodel 12863 return c 12864 } 12865 12866 // UpdateMask sets the optional parameter "updateMask": Indicates which fields 12867 // in the provided 'model' to update. If not set, by default updates all 12868 // fields. 12869 func (c *ProjectsLocationsCatalogsModelsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsCatalogsModelsPatchCall { 12870 c.urlParams_.Set("updateMask", updateMask) 12871 return c 12872 } 12873 12874 // Fields allows partial responses to be retrieved. See 12875 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 12876 // details. 12877 func (c *ProjectsLocationsCatalogsModelsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsModelsPatchCall { 12878 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12879 return c 12880 } 12881 12882 // Context sets the context to be used in this call's Do method. 12883 func (c *ProjectsLocationsCatalogsModelsPatchCall) Context(ctx context.Context) *ProjectsLocationsCatalogsModelsPatchCall { 12884 c.ctx_ = ctx 12885 return c 12886 } 12887 12888 // Header returns a http.Header that can be modified by the caller to add 12889 // headers to the request. 12890 func (c *ProjectsLocationsCatalogsModelsPatchCall) Header() http.Header { 12891 if c.header_ == nil { 12892 c.header_ = make(http.Header) 12893 } 12894 return c.header_ 12895 } 12896 12897 func (c *ProjectsLocationsCatalogsModelsPatchCall) doRequest(alt string) (*http.Response, error) { 12898 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 12899 var body io.Reader = nil 12900 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betamodel) 12901 if err != nil { 12902 return nil, err 12903 } 12904 c.urlParams_.Set("alt", alt) 12905 c.urlParams_.Set("prettyPrint", "false") 12906 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}") 12907 urls += "?" + c.urlParams_.Encode() 12908 req, err := http.NewRequest("PATCH", urls, body) 12909 if err != nil { 12910 return nil, err 12911 } 12912 req.Header = reqHeaders 12913 googleapi.Expand(req.URL, map[string]string{ 12914 "name": c.name, 12915 }) 12916 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12917 } 12918 12919 // Do executes the "retail.projects.locations.catalogs.models.patch" call. 12920 // Any non-2xx status code is an error. Response headers are in either 12921 // *GoogleCloudRetailV2betaModel.ServerResponse.Header or (if a response was 12922 // returned at all) in error.(*googleapi.Error).Header. Use 12923 // googleapi.IsNotModified to check whether the returned error was because 12924 // http.StatusNotModified was returned. 12925 func (c *ProjectsLocationsCatalogsModelsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2betaModel, error) { 12926 gensupport.SetOptions(c.urlParams_, opts...) 12927 res, err := c.doRequest("json") 12928 if res != nil && res.StatusCode == http.StatusNotModified { 12929 if res.Body != nil { 12930 res.Body.Close() 12931 } 12932 return nil, gensupport.WrapError(&googleapi.Error{ 12933 Code: res.StatusCode, 12934 Header: res.Header, 12935 }) 12936 } 12937 if err != nil { 12938 return nil, err 12939 } 12940 defer googleapi.CloseBody(res) 12941 if err := googleapi.CheckResponse(res); err != nil { 12942 return nil, gensupport.WrapError(err) 12943 } 12944 ret := &GoogleCloudRetailV2betaModel{ 12945 ServerResponse: googleapi.ServerResponse{ 12946 Header: res.Header, 12947 HTTPStatusCode: res.StatusCode, 12948 }, 12949 } 12950 target := &ret 12951 if err := gensupport.DecodeResponse(target, res); err != nil { 12952 return nil, err 12953 } 12954 return ret, nil 12955 } 12956 12957 type ProjectsLocationsCatalogsModelsPauseCall struct { 12958 s *Service 12959 name string 12960 googlecloudretailv2betapausemodelrequest *GoogleCloudRetailV2betaPauseModelRequest 12961 urlParams_ gensupport.URLParams 12962 ctx_ context.Context 12963 header_ http.Header 12964 } 12965 12966 // Pause: Pauses the training of an existing model. 12967 // 12968 // - name: The name of the model to pause. Format: 12969 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/mo 12970 // dels/{model_id}`. 12971 func (r *ProjectsLocationsCatalogsModelsService) Pause(name string, googlecloudretailv2betapausemodelrequest *GoogleCloudRetailV2betaPauseModelRequest) *ProjectsLocationsCatalogsModelsPauseCall { 12972 c := &ProjectsLocationsCatalogsModelsPauseCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12973 c.name = name 12974 c.googlecloudretailv2betapausemodelrequest = googlecloudretailv2betapausemodelrequest 12975 return c 12976 } 12977 12978 // Fields allows partial responses to be retrieved. See 12979 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 12980 // details. 12981 func (c *ProjectsLocationsCatalogsModelsPauseCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsModelsPauseCall { 12982 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12983 return c 12984 } 12985 12986 // Context sets the context to be used in this call's Do method. 12987 func (c *ProjectsLocationsCatalogsModelsPauseCall) Context(ctx context.Context) *ProjectsLocationsCatalogsModelsPauseCall { 12988 c.ctx_ = ctx 12989 return c 12990 } 12991 12992 // Header returns a http.Header that can be modified by the caller to add 12993 // headers to the request. 12994 func (c *ProjectsLocationsCatalogsModelsPauseCall) Header() http.Header { 12995 if c.header_ == nil { 12996 c.header_ = make(http.Header) 12997 } 12998 return c.header_ 12999 } 13000 13001 func (c *ProjectsLocationsCatalogsModelsPauseCall) doRequest(alt string) (*http.Response, error) { 13002 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 13003 var body io.Reader = nil 13004 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betapausemodelrequest) 13005 if err != nil { 13006 return nil, err 13007 } 13008 c.urlParams_.Set("alt", alt) 13009 c.urlParams_.Set("prettyPrint", "false") 13010 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}:pause") 13011 urls += "?" + c.urlParams_.Encode() 13012 req, err := http.NewRequest("POST", urls, body) 13013 if err != nil { 13014 return nil, err 13015 } 13016 req.Header = reqHeaders 13017 googleapi.Expand(req.URL, map[string]string{ 13018 "name": c.name, 13019 }) 13020 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13021 } 13022 13023 // Do executes the "retail.projects.locations.catalogs.models.pause" call. 13024 // Any non-2xx status code is an error. Response headers are in either 13025 // *GoogleCloudRetailV2betaModel.ServerResponse.Header or (if a response was 13026 // returned at all) in error.(*googleapi.Error).Header. Use 13027 // googleapi.IsNotModified to check whether the returned error was because 13028 // http.StatusNotModified was returned. 13029 func (c *ProjectsLocationsCatalogsModelsPauseCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2betaModel, error) { 13030 gensupport.SetOptions(c.urlParams_, opts...) 13031 res, err := c.doRequest("json") 13032 if res != nil && res.StatusCode == http.StatusNotModified { 13033 if res.Body != nil { 13034 res.Body.Close() 13035 } 13036 return nil, gensupport.WrapError(&googleapi.Error{ 13037 Code: res.StatusCode, 13038 Header: res.Header, 13039 }) 13040 } 13041 if err != nil { 13042 return nil, err 13043 } 13044 defer googleapi.CloseBody(res) 13045 if err := googleapi.CheckResponse(res); err != nil { 13046 return nil, gensupport.WrapError(err) 13047 } 13048 ret := &GoogleCloudRetailV2betaModel{ 13049 ServerResponse: googleapi.ServerResponse{ 13050 Header: res.Header, 13051 HTTPStatusCode: res.StatusCode, 13052 }, 13053 } 13054 target := &ret 13055 if err := gensupport.DecodeResponse(target, res); err != nil { 13056 return nil, err 13057 } 13058 return ret, nil 13059 } 13060 13061 type ProjectsLocationsCatalogsModelsResumeCall struct { 13062 s *Service 13063 name string 13064 googlecloudretailv2betaresumemodelrequest *GoogleCloudRetailV2betaResumeModelRequest 13065 urlParams_ gensupport.URLParams 13066 ctx_ context.Context 13067 header_ http.Header 13068 } 13069 13070 // Resume: Resumes the training of an existing model. 13071 // 13072 // - name: The name of the model to resume. Format: 13073 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/mo 13074 // dels/{model_id}`. 13075 func (r *ProjectsLocationsCatalogsModelsService) Resume(name string, googlecloudretailv2betaresumemodelrequest *GoogleCloudRetailV2betaResumeModelRequest) *ProjectsLocationsCatalogsModelsResumeCall { 13076 c := &ProjectsLocationsCatalogsModelsResumeCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13077 c.name = name 13078 c.googlecloudretailv2betaresumemodelrequest = googlecloudretailv2betaresumemodelrequest 13079 return c 13080 } 13081 13082 // Fields allows partial responses to be retrieved. See 13083 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 13084 // details. 13085 func (c *ProjectsLocationsCatalogsModelsResumeCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsModelsResumeCall { 13086 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13087 return c 13088 } 13089 13090 // Context sets the context to be used in this call's Do method. 13091 func (c *ProjectsLocationsCatalogsModelsResumeCall) Context(ctx context.Context) *ProjectsLocationsCatalogsModelsResumeCall { 13092 c.ctx_ = ctx 13093 return c 13094 } 13095 13096 // Header returns a http.Header that can be modified by the caller to add 13097 // headers to the request. 13098 func (c *ProjectsLocationsCatalogsModelsResumeCall) Header() http.Header { 13099 if c.header_ == nil { 13100 c.header_ = make(http.Header) 13101 } 13102 return c.header_ 13103 } 13104 13105 func (c *ProjectsLocationsCatalogsModelsResumeCall) doRequest(alt string) (*http.Response, error) { 13106 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 13107 var body io.Reader = nil 13108 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betaresumemodelrequest) 13109 if err != nil { 13110 return nil, err 13111 } 13112 c.urlParams_.Set("alt", alt) 13113 c.urlParams_.Set("prettyPrint", "false") 13114 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}:resume") 13115 urls += "?" + c.urlParams_.Encode() 13116 req, err := http.NewRequest("POST", urls, body) 13117 if err != nil { 13118 return nil, err 13119 } 13120 req.Header = reqHeaders 13121 googleapi.Expand(req.URL, map[string]string{ 13122 "name": c.name, 13123 }) 13124 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13125 } 13126 13127 // Do executes the "retail.projects.locations.catalogs.models.resume" call. 13128 // Any non-2xx status code is an error. Response headers are in either 13129 // *GoogleCloudRetailV2betaModel.ServerResponse.Header or (if a response was 13130 // returned at all) in error.(*googleapi.Error).Header. Use 13131 // googleapi.IsNotModified to check whether the returned error was because 13132 // http.StatusNotModified was returned. 13133 func (c *ProjectsLocationsCatalogsModelsResumeCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2betaModel, error) { 13134 gensupport.SetOptions(c.urlParams_, opts...) 13135 res, err := c.doRequest("json") 13136 if res != nil && res.StatusCode == http.StatusNotModified { 13137 if res.Body != nil { 13138 res.Body.Close() 13139 } 13140 return nil, gensupport.WrapError(&googleapi.Error{ 13141 Code: res.StatusCode, 13142 Header: res.Header, 13143 }) 13144 } 13145 if err != nil { 13146 return nil, err 13147 } 13148 defer googleapi.CloseBody(res) 13149 if err := googleapi.CheckResponse(res); err != nil { 13150 return nil, gensupport.WrapError(err) 13151 } 13152 ret := &GoogleCloudRetailV2betaModel{ 13153 ServerResponse: googleapi.ServerResponse{ 13154 Header: res.Header, 13155 HTTPStatusCode: res.StatusCode, 13156 }, 13157 } 13158 target := &ret 13159 if err := gensupport.DecodeResponse(target, res); err != nil { 13160 return nil, err 13161 } 13162 return ret, nil 13163 } 13164 13165 type ProjectsLocationsCatalogsModelsTuneCall struct { 13166 s *Service 13167 name string 13168 googlecloudretailv2betatunemodelrequest *GoogleCloudRetailV2betaTuneModelRequest 13169 urlParams_ gensupport.URLParams 13170 ctx_ context.Context 13171 header_ http.Header 13172 } 13173 13174 // Tune: Tunes an existing model. 13175 // 13176 // - name: The resource name of the model to tune. Format: 13177 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/mo 13178 // dels/{model_id}`. 13179 func (r *ProjectsLocationsCatalogsModelsService) Tune(name string, googlecloudretailv2betatunemodelrequest *GoogleCloudRetailV2betaTuneModelRequest) *ProjectsLocationsCatalogsModelsTuneCall { 13180 c := &ProjectsLocationsCatalogsModelsTuneCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13181 c.name = name 13182 c.googlecloudretailv2betatunemodelrequest = googlecloudretailv2betatunemodelrequest 13183 return c 13184 } 13185 13186 // Fields allows partial responses to be retrieved. See 13187 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 13188 // details. 13189 func (c *ProjectsLocationsCatalogsModelsTuneCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsModelsTuneCall { 13190 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13191 return c 13192 } 13193 13194 // Context sets the context to be used in this call's Do method. 13195 func (c *ProjectsLocationsCatalogsModelsTuneCall) Context(ctx context.Context) *ProjectsLocationsCatalogsModelsTuneCall { 13196 c.ctx_ = ctx 13197 return c 13198 } 13199 13200 // Header returns a http.Header that can be modified by the caller to add 13201 // headers to the request. 13202 func (c *ProjectsLocationsCatalogsModelsTuneCall) Header() http.Header { 13203 if c.header_ == nil { 13204 c.header_ = make(http.Header) 13205 } 13206 return c.header_ 13207 } 13208 13209 func (c *ProjectsLocationsCatalogsModelsTuneCall) doRequest(alt string) (*http.Response, error) { 13210 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 13211 var body io.Reader = nil 13212 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betatunemodelrequest) 13213 if err != nil { 13214 return nil, err 13215 } 13216 c.urlParams_.Set("alt", alt) 13217 c.urlParams_.Set("prettyPrint", "false") 13218 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}:tune") 13219 urls += "?" + c.urlParams_.Encode() 13220 req, err := http.NewRequest("POST", urls, body) 13221 if err != nil { 13222 return nil, err 13223 } 13224 req.Header = reqHeaders 13225 googleapi.Expand(req.URL, map[string]string{ 13226 "name": c.name, 13227 }) 13228 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13229 } 13230 13231 // Do executes the "retail.projects.locations.catalogs.models.tune" call. 13232 // Any non-2xx status code is an error. Response headers are in either 13233 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was 13234 // returned at all) in error.(*googleapi.Error).Header. Use 13235 // googleapi.IsNotModified to check whether the returned error was because 13236 // http.StatusNotModified was returned. 13237 func (c *ProjectsLocationsCatalogsModelsTuneCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 13238 gensupport.SetOptions(c.urlParams_, opts...) 13239 res, err := c.doRequest("json") 13240 if res != nil && res.StatusCode == http.StatusNotModified { 13241 if res.Body != nil { 13242 res.Body.Close() 13243 } 13244 return nil, gensupport.WrapError(&googleapi.Error{ 13245 Code: res.StatusCode, 13246 Header: res.Header, 13247 }) 13248 } 13249 if err != nil { 13250 return nil, err 13251 } 13252 defer googleapi.CloseBody(res) 13253 if err := googleapi.CheckResponse(res); err != nil { 13254 return nil, gensupport.WrapError(err) 13255 } 13256 ret := &GoogleLongrunningOperation{ 13257 ServerResponse: googleapi.ServerResponse{ 13258 Header: res.Header, 13259 HTTPStatusCode: res.StatusCode, 13260 }, 13261 } 13262 target := &ret 13263 if err := gensupport.DecodeResponse(target, res); err != nil { 13264 return nil, err 13265 } 13266 return ret, nil 13267 } 13268 13269 type ProjectsLocationsCatalogsOperationsGetCall struct { 13270 s *Service 13271 name string 13272 urlParams_ gensupport.URLParams 13273 ifNoneMatch_ string 13274 ctx_ context.Context 13275 header_ http.Header 13276 } 13277 13278 // Get: Gets the latest state of a long-running operation. Clients can use this 13279 // method to poll the operation result at intervals as recommended by the API 13280 // service. 13281 // 13282 // - name: The name of the operation resource. 13283 func (r *ProjectsLocationsCatalogsOperationsService) Get(name string) *ProjectsLocationsCatalogsOperationsGetCall { 13284 c := &ProjectsLocationsCatalogsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13285 c.name = name 13286 return c 13287 } 13288 13289 // Fields allows partial responses to be retrieved. See 13290 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 13291 // details. 13292 func (c *ProjectsLocationsCatalogsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsOperationsGetCall { 13293 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13294 return c 13295 } 13296 13297 // IfNoneMatch sets an optional parameter which makes the operation fail if the 13298 // object's ETag matches the given value. This is useful for getting updates 13299 // only after the object has changed since the last request. 13300 func (c *ProjectsLocationsCatalogsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsOperationsGetCall { 13301 c.ifNoneMatch_ = entityTag 13302 return c 13303 } 13304 13305 // Context sets the context to be used in this call's Do method. 13306 func (c *ProjectsLocationsCatalogsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsCatalogsOperationsGetCall { 13307 c.ctx_ = ctx 13308 return c 13309 } 13310 13311 // Header returns a http.Header that can be modified by the caller to add 13312 // headers to the request. 13313 func (c *ProjectsLocationsCatalogsOperationsGetCall) Header() http.Header { 13314 if c.header_ == nil { 13315 c.header_ = make(http.Header) 13316 } 13317 return c.header_ 13318 } 13319 13320 func (c *ProjectsLocationsCatalogsOperationsGetCall) doRequest(alt string) (*http.Response, error) { 13321 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 13322 if c.ifNoneMatch_ != "" { 13323 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 13324 } 13325 var body io.Reader = nil 13326 c.urlParams_.Set("alt", alt) 13327 c.urlParams_.Set("prettyPrint", "false") 13328 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}") 13329 urls += "?" + c.urlParams_.Encode() 13330 req, err := http.NewRequest("GET", urls, body) 13331 if err != nil { 13332 return nil, err 13333 } 13334 req.Header = reqHeaders 13335 googleapi.Expand(req.URL, map[string]string{ 13336 "name": c.name, 13337 }) 13338 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13339 } 13340 13341 // Do executes the "retail.projects.locations.catalogs.operations.get" call. 13342 // Any non-2xx status code is an error. Response headers are in either 13343 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was 13344 // returned at all) in error.(*googleapi.Error).Header. Use 13345 // googleapi.IsNotModified to check whether the returned error was because 13346 // http.StatusNotModified was returned. 13347 func (c *ProjectsLocationsCatalogsOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 13348 gensupport.SetOptions(c.urlParams_, opts...) 13349 res, err := c.doRequest("json") 13350 if res != nil && res.StatusCode == http.StatusNotModified { 13351 if res.Body != nil { 13352 res.Body.Close() 13353 } 13354 return nil, gensupport.WrapError(&googleapi.Error{ 13355 Code: res.StatusCode, 13356 Header: res.Header, 13357 }) 13358 } 13359 if err != nil { 13360 return nil, err 13361 } 13362 defer googleapi.CloseBody(res) 13363 if err := googleapi.CheckResponse(res); err != nil { 13364 return nil, gensupport.WrapError(err) 13365 } 13366 ret := &GoogleLongrunningOperation{ 13367 ServerResponse: googleapi.ServerResponse{ 13368 Header: res.Header, 13369 HTTPStatusCode: res.StatusCode, 13370 }, 13371 } 13372 target := &ret 13373 if err := gensupport.DecodeResponse(target, res); err != nil { 13374 return nil, err 13375 } 13376 return ret, nil 13377 } 13378 13379 type ProjectsLocationsCatalogsOperationsListCall struct { 13380 s *Service 13381 name string 13382 urlParams_ gensupport.URLParams 13383 ifNoneMatch_ string 13384 ctx_ context.Context 13385 header_ http.Header 13386 } 13387 13388 // List: Lists operations that match the specified filter in the request. If 13389 // the server doesn't support this method, it returns `UNIMPLEMENTED`. 13390 // 13391 // - name: The name of the operation's parent resource. 13392 func (r *ProjectsLocationsCatalogsOperationsService) List(name string) *ProjectsLocationsCatalogsOperationsListCall { 13393 c := &ProjectsLocationsCatalogsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13394 c.name = name 13395 return c 13396 } 13397 13398 // Filter sets the optional parameter "filter": The standard list filter. 13399 func (c *ProjectsLocationsCatalogsOperationsListCall) Filter(filter string) *ProjectsLocationsCatalogsOperationsListCall { 13400 c.urlParams_.Set("filter", filter) 13401 return c 13402 } 13403 13404 // PageSize sets the optional parameter "pageSize": The standard list page 13405 // size. 13406 func (c *ProjectsLocationsCatalogsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsCatalogsOperationsListCall { 13407 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 13408 return c 13409 } 13410 13411 // PageToken sets the optional parameter "pageToken": The standard list page 13412 // token. 13413 func (c *ProjectsLocationsCatalogsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsCatalogsOperationsListCall { 13414 c.urlParams_.Set("pageToken", pageToken) 13415 return c 13416 } 13417 13418 // Fields allows partial responses to be retrieved. See 13419 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 13420 // details. 13421 func (c *ProjectsLocationsCatalogsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsOperationsListCall { 13422 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13423 return c 13424 } 13425 13426 // IfNoneMatch sets an optional parameter which makes the operation fail if the 13427 // object's ETag matches the given value. This is useful for getting updates 13428 // only after the object has changed since the last request. 13429 func (c *ProjectsLocationsCatalogsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsOperationsListCall { 13430 c.ifNoneMatch_ = entityTag 13431 return c 13432 } 13433 13434 // Context sets the context to be used in this call's Do method. 13435 func (c *ProjectsLocationsCatalogsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsCatalogsOperationsListCall { 13436 c.ctx_ = ctx 13437 return c 13438 } 13439 13440 // Header returns a http.Header that can be modified by the caller to add 13441 // headers to the request. 13442 func (c *ProjectsLocationsCatalogsOperationsListCall) Header() http.Header { 13443 if c.header_ == nil { 13444 c.header_ = make(http.Header) 13445 } 13446 return c.header_ 13447 } 13448 13449 func (c *ProjectsLocationsCatalogsOperationsListCall) doRequest(alt string) (*http.Response, error) { 13450 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 13451 if c.ifNoneMatch_ != "" { 13452 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 13453 } 13454 var body io.Reader = nil 13455 c.urlParams_.Set("alt", alt) 13456 c.urlParams_.Set("prettyPrint", "false") 13457 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}/operations") 13458 urls += "?" + c.urlParams_.Encode() 13459 req, err := http.NewRequest("GET", urls, body) 13460 if err != nil { 13461 return nil, err 13462 } 13463 req.Header = reqHeaders 13464 googleapi.Expand(req.URL, map[string]string{ 13465 "name": c.name, 13466 }) 13467 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13468 } 13469 13470 // Do executes the "retail.projects.locations.catalogs.operations.list" call. 13471 // Any non-2xx status code is an error. Response headers are in either 13472 // *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if a 13473 // response was returned at all) in error.(*googleapi.Error).Header. Use 13474 // googleapi.IsNotModified to check whether the returned error was because 13475 // http.StatusNotModified was returned. 13476 func (c *ProjectsLocationsCatalogsOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { 13477 gensupport.SetOptions(c.urlParams_, opts...) 13478 res, err := c.doRequest("json") 13479 if res != nil && res.StatusCode == http.StatusNotModified { 13480 if res.Body != nil { 13481 res.Body.Close() 13482 } 13483 return nil, gensupport.WrapError(&googleapi.Error{ 13484 Code: res.StatusCode, 13485 Header: res.Header, 13486 }) 13487 } 13488 if err != nil { 13489 return nil, err 13490 } 13491 defer googleapi.CloseBody(res) 13492 if err := googleapi.CheckResponse(res); err != nil { 13493 return nil, gensupport.WrapError(err) 13494 } 13495 ret := &GoogleLongrunningListOperationsResponse{ 13496 ServerResponse: googleapi.ServerResponse{ 13497 Header: res.Header, 13498 HTTPStatusCode: res.StatusCode, 13499 }, 13500 } 13501 target := &ret 13502 if err := gensupport.DecodeResponse(target, res); err != nil { 13503 return nil, err 13504 } 13505 return ret, nil 13506 } 13507 13508 // Pages invokes f for each page of results. 13509 // A non-nil error returned from f will halt the iteration. 13510 // The provided context supersedes any context provided to the Context method. 13511 func (c *ProjectsLocationsCatalogsOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { 13512 c.ctx_ = ctx 13513 defer c.PageToken(c.urlParams_.Get("pageToken")) 13514 for { 13515 x, err := c.Do() 13516 if err != nil { 13517 return err 13518 } 13519 if err := f(x); err != nil { 13520 return err 13521 } 13522 if x.NextPageToken == "" { 13523 return nil 13524 } 13525 c.PageToken(x.NextPageToken) 13526 } 13527 } 13528 13529 type ProjectsLocationsCatalogsPlacementsPredictCall struct { 13530 s *Service 13531 placement string 13532 googlecloudretailv2betapredictrequest *GoogleCloudRetailV2betaPredictRequest 13533 urlParams_ gensupport.URLParams 13534 ctx_ context.Context 13535 header_ http.Header 13536 } 13537 13538 // Predict: Makes a recommendation prediction. 13539 // 13540 // - placement: Full resource name of the format: 13541 // `{placement=projects/*/locations/global/catalogs/default_catalog/servingCon 13542 // figs/*}` or 13543 // `{placement=projects/*/locations/global/catalogs/default_catalog/placements 13544 // /*}`. We recommend using the `servingConfigs` resource. `placements` is a 13545 // legacy resource. The ID of the Recommendations AI serving config or 13546 // placement. Before you can request predictions from your model, you must 13547 // create at least one serving config or placement for it. For more 13548 // information, see [Manage serving configs] 13549 // (https://cloud.google.com/retail/docs/manage-configs). The full list of 13550 // available serving configs can be seen at 13551 // https://console.cloud.google.com/ai/retail/catalogs/default_catalog/configs. 13552 func (r *ProjectsLocationsCatalogsPlacementsService) Predict(placement string, googlecloudretailv2betapredictrequest *GoogleCloudRetailV2betaPredictRequest) *ProjectsLocationsCatalogsPlacementsPredictCall { 13553 c := &ProjectsLocationsCatalogsPlacementsPredictCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13554 c.placement = placement 13555 c.googlecloudretailv2betapredictrequest = googlecloudretailv2betapredictrequest 13556 return c 13557 } 13558 13559 // Fields allows partial responses to be retrieved. See 13560 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 13561 // details. 13562 func (c *ProjectsLocationsCatalogsPlacementsPredictCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsPlacementsPredictCall { 13563 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13564 return c 13565 } 13566 13567 // Context sets the context to be used in this call's Do method. 13568 func (c *ProjectsLocationsCatalogsPlacementsPredictCall) Context(ctx context.Context) *ProjectsLocationsCatalogsPlacementsPredictCall { 13569 c.ctx_ = ctx 13570 return c 13571 } 13572 13573 // Header returns a http.Header that can be modified by the caller to add 13574 // headers to the request. 13575 func (c *ProjectsLocationsCatalogsPlacementsPredictCall) Header() http.Header { 13576 if c.header_ == nil { 13577 c.header_ = make(http.Header) 13578 } 13579 return c.header_ 13580 } 13581 13582 func (c *ProjectsLocationsCatalogsPlacementsPredictCall) doRequest(alt string) (*http.Response, error) { 13583 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 13584 var body io.Reader = nil 13585 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betapredictrequest) 13586 if err != nil { 13587 return nil, err 13588 } 13589 c.urlParams_.Set("alt", alt) 13590 c.urlParams_.Set("prettyPrint", "false") 13591 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+placement}:predict") 13592 urls += "?" + c.urlParams_.Encode() 13593 req, err := http.NewRequest("POST", urls, body) 13594 if err != nil { 13595 return nil, err 13596 } 13597 req.Header = reqHeaders 13598 googleapi.Expand(req.URL, map[string]string{ 13599 "placement": c.placement, 13600 }) 13601 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13602 } 13603 13604 // Do executes the "retail.projects.locations.catalogs.placements.predict" call. 13605 // Any non-2xx status code is an error. Response headers are in either 13606 // *GoogleCloudRetailV2betaPredictResponse.ServerResponse.Header or (if a 13607 // response was returned at all) in error.(*googleapi.Error).Header. Use 13608 // googleapi.IsNotModified to check whether the returned error was because 13609 // http.StatusNotModified was returned. 13610 func (c *ProjectsLocationsCatalogsPlacementsPredictCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2betaPredictResponse, error) { 13611 gensupport.SetOptions(c.urlParams_, opts...) 13612 res, err := c.doRequest("json") 13613 if res != nil && res.StatusCode == http.StatusNotModified { 13614 if res.Body != nil { 13615 res.Body.Close() 13616 } 13617 return nil, gensupport.WrapError(&googleapi.Error{ 13618 Code: res.StatusCode, 13619 Header: res.Header, 13620 }) 13621 } 13622 if err != nil { 13623 return nil, err 13624 } 13625 defer googleapi.CloseBody(res) 13626 if err := googleapi.CheckResponse(res); err != nil { 13627 return nil, gensupport.WrapError(err) 13628 } 13629 ret := &GoogleCloudRetailV2betaPredictResponse{ 13630 ServerResponse: googleapi.ServerResponse{ 13631 Header: res.Header, 13632 HTTPStatusCode: res.StatusCode, 13633 }, 13634 } 13635 target := &ret 13636 if err := gensupport.DecodeResponse(target, res); err != nil { 13637 return nil, err 13638 } 13639 return ret, nil 13640 } 13641 13642 type ProjectsLocationsCatalogsPlacementsSearchCall struct { 13643 s *Service 13644 placement string 13645 googlecloudretailv2betasearchrequest *GoogleCloudRetailV2betaSearchRequest 13646 urlParams_ gensupport.URLParams 13647 ctx_ context.Context 13648 header_ http.Header 13649 } 13650 13651 // Search: Performs a search. This feature is only available for users who have 13652 // Retail Search enabled. Enable Retail Search on Cloud Console before using 13653 // this feature. 13654 // 13655 // - placement: The resource name of the Retail Search serving config, such as 13656 // `projects/*/locations/global/catalogs/default_catalog/servingConfigs/defaul 13657 // t_serving_config` or the name of the legacy placement resource, such as 13658 // `projects/*/locations/global/catalogs/default_catalog/placements/default_se 13659 // arch`. This field is used to identify the serving config name and the set 13660 // of models that are used to make the search. 13661 func (r *ProjectsLocationsCatalogsPlacementsService) Search(placement string, googlecloudretailv2betasearchrequest *GoogleCloudRetailV2betaSearchRequest) *ProjectsLocationsCatalogsPlacementsSearchCall { 13662 c := &ProjectsLocationsCatalogsPlacementsSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13663 c.placement = placement 13664 c.googlecloudretailv2betasearchrequest = googlecloudretailv2betasearchrequest 13665 return c 13666 } 13667 13668 // Fields allows partial responses to be retrieved. See 13669 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 13670 // details. 13671 func (c *ProjectsLocationsCatalogsPlacementsSearchCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsPlacementsSearchCall { 13672 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13673 return c 13674 } 13675 13676 // Context sets the context to be used in this call's Do method. 13677 func (c *ProjectsLocationsCatalogsPlacementsSearchCall) Context(ctx context.Context) *ProjectsLocationsCatalogsPlacementsSearchCall { 13678 c.ctx_ = ctx 13679 return c 13680 } 13681 13682 // Header returns a http.Header that can be modified by the caller to add 13683 // headers to the request. 13684 func (c *ProjectsLocationsCatalogsPlacementsSearchCall) Header() http.Header { 13685 if c.header_ == nil { 13686 c.header_ = make(http.Header) 13687 } 13688 return c.header_ 13689 } 13690 13691 func (c *ProjectsLocationsCatalogsPlacementsSearchCall) doRequest(alt string) (*http.Response, error) { 13692 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 13693 var body io.Reader = nil 13694 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betasearchrequest) 13695 if err != nil { 13696 return nil, err 13697 } 13698 c.urlParams_.Set("alt", alt) 13699 c.urlParams_.Set("prettyPrint", "false") 13700 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+placement}:search") 13701 urls += "?" + c.urlParams_.Encode() 13702 req, err := http.NewRequest("POST", urls, body) 13703 if err != nil { 13704 return nil, err 13705 } 13706 req.Header = reqHeaders 13707 googleapi.Expand(req.URL, map[string]string{ 13708 "placement": c.placement, 13709 }) 13710 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13711 } 13712 13713 // Do executes the "retail.projects.locations.catalogs.placements.search" call. 13714 // Any non-2xx status code is an error. Response headers are in either 13715 // *GoogleCloudRetailV2betaSearchResponse.ServerResponse.Header or (if a 13716 // response was returned at all) in error.(*googleapi.Error).Header. Use 13717 // googleapi.IsNotModified to check whether the returned error was because 13718 // http.StatusNotModified was returned. 13719 func (c *ProjectsLocationsCatalogsPlacementsSearchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2betaSearchResponse, error) { 13720 gensupport.SetOptions(c.urlParams_, opts...) 13721 res, err := c.doRequest("json") 13722 if res != nil && res.StatusCode == http.StatusNotModified { 13723 if res.Body != nil { 13724 res.Body.Close() 13725 } 13726 return nil, gensupport.WrapError(&googleapi.Error{ 13727 Code: res.StatusCode, 13728 Header: res.Header, 13729 }) 13730 } 13731 if err != nil { 13732 return nil, err 13733 } 13734 defer googleapi.CloseBody(res) 13735 if err := googleapi.CheckResponse(res); err != nil { 13736 return nil, gensupport.WrapError(err) 13737 } 13738 ret := &GoogleCloudRetailV2betaSearchResponse{ 13739 ServerResponse: googleapi.ServerResponse{ 13740 Header: res.Header, 13741 HTTPStatusCode: res.StatusCode, 13742 }, 13743 } 13744 target := &ret 13745 if err := gensupport.DecodeResponse(target, res); err != nil { 13746 return nil, err 13747 } 13748 return ret, nil 13749 } 13750 13751 // Pages invokes f for each page of results. 13752 // A non-nil error returned from f will halt the iteration. 13753 // The provided context supersedes any context provided to the Context method. 13754 func (c *ProjectsLocationsCatalogsPlacementsSearchCall) Pages(ctx context.Context, f func(*GoogleCloudRetailV2betaSearchResponse) error) error { 13755 c.ctx_ = ctx 13756 defer func(pt string) { c.googlecloudretailv2betasearchrequest.PageToken = pt }(c.googlecloudretailv2betasearchrequest.PageToken) 13757 for { 13758 x, err := c.Do() 13759 if err != nil { 13760 return err 13761 } 13762 if err := f(x); err != nil { 13763 return err 13764 } 13765 if x.NextPageToken == "" { 13766 return nil 13767 } 13768 c.googlecloudretailv2betasearchrequest.PageToken = x.NextPageToken 13769 } 13770 } 13771 13772 type ProjectsLocationsCatalogsServingConfigsAddControlCall struct { 13773 s *Service 13774 servingConfig string 13775 googlecloudretailv2betaaddcontrolrequest *GoogleCloudRetailV2betaAddControlRequest 13776 urlParams_ gensupport.URLParams 13777 ctx_ context.Context 13778 header_ http.Header 13779 } 13780 13781 // AddControl: Enables a Control on the specified ServingConfig. The control is 13782 // added in the last position of the list of controls it belongs to (e.g. if 13783 // it's a facet spec control it will be applied in the last position of 13784 // servingConfig.facetSpecIds) Returns a ALREADY_EXISTS error if the control 13785 // has already been applied. Returns a FAILED_PRECONDITION error if the 13786 // addition could exceed maximum number of control allowed for that type of 13787 // control. 13788 // 13789 // - servingConfig: The source ServingConfig resource name . Format: 13790 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/se 13791 // rvingConfigs/{serving_config_id}`. 13792 func (r *ProjectsLocationsCatalogsServingConfigsService) AddControl(servingConfig string, googlecloudretailv2betaaddcontrolrequest *GoogleCloudRetailV2betaAddControlRequest) *ProjectsLocationsCatalogsServingConfigsAddControlCall { 13793 c := &ProjectsLocationsCatalogsServingConfigsAddControlCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13794 c.servingConfig = servingConfig 13795 c.googlecloudretailv2betaaddcontrolrequest = googlecloudretailv2betaaddcontrolrequest 13796 return c 13797 } 13798 13799 // Fields allows partial responses to be retrieved. See 13800 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 13801 // details. 13802 func (c *ProjectsLocationsCatalogsServingConfigsAddControlCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsServingConfigsAddControlCall { 13803 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13804 return c 13805 } 13806 13807 // Context sets the context to be used in this call's Do method. 13808 func (c *ProjectsLocationsCatalogsServingConfigsAddControlCall) Context(ctx context.Context) *ProjectsLocationsCatalogsServingConfigsAddControlCall { 13809 c.ctx_ = ctx 13810 return c 13811 } 13812 13813 // Header returns a http.Header that can be modified by the caller to add 13814 // headers to the request. 13815 func (c *ProjectsLocationsCatalogsServingConfigsAddControlCall) Header() http.Header { 13816 if c.header_ == nil { 13817 c.header_ = make(http.Header) 13818 } 13819 return c.header_ 13820 } 13821 13822 func (c *ProjectsLocationsCatalogsServingConfigsAddControlCall) doRequest(alt string) (*http.Response, error) { 13823 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 13824 var body io.Reader = nil 13825 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betaaddcontrolrequest) 13826 if err != nil { 13827 return nil, err 13828 } 13829 c.urlParams_.Set("alt", alt) 13830 c.urlParams_.Set("prettyPrint", "false") 13831 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+servingConfig}:addControl") 13832 urls += "?" + c.urlParams_.Encode() 13833 req, err := http.NewRequest("POST", urls, body) 13834 if err != nil { 13835 return nil, err 13836 } 13837 req.Header = reqHeaders 13838 googleapi.Expand(req.URL, map[string]string{ 13839 "servingConfig": c.servingConfig, 13840 }) 13841 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13842 } 13843 13844 // Do executes the "retail.projects.locations.catalogs.servingConfigs.addControl" call. 13845 // Any non-2xx status code is an error. Response headers are in either 13846 // *GoogleCloudRetailV2betaServingConfig.ServerResponse.Header or (if a 13847 // response was returned at all) in error.(*googleapi.Error).Header. Use 13848 // googleapi.IsNotModified to check whether the returned error was because 13849 // http.StatusNotModified was returned. 13850 func (c *ProjectsLocationsCatalogsServingConfigsAddControlCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2betaServingConfig, error) { 13851 gensupport.SetOptions(c.urlParams_, opts...) 13852 res, err := c.doRequest("json") 13853 if res != nil && res.StatusCode == http.StatusNotModified { 13854 if res.Body != nil { 13855 res.Body.Close() 13856 } 13857 return nil, gensupport.WrapError(&googleapi.Error{ 13858 Code: res.StatusCode, 13859 Header: res.Header, 13860 }) 13861 } 13862 if err != nil { 13863 return nil, err 13864 } 13865 defer googleapi.CloseBody(res) 13866 if err := googleapi.CheckResponse(res); err != nil { 13867 return nil, gensupport.WrapError(err) 13868 } 13869 ret := &GoogleCloudRetailV2betaServingConfig{ 13870 ServerResponse: googleapi.ServerResponse{ 13871 Header: res.Header, 13872 HTTPStatusCode: res.StatusCode, 13873 }, 13874 } 13875 target := &ret 13876 if err := gensupport.DecodeResponse(target, res); err != nil { 13877 return nil, err 13878 } 13879 return ret, nil 13880 } 13881 13882 type ProjectsLocationsCatalogsServingConfigsCreateCall struct { 13883 s *Service 13884 parent string 13885 googlecloudretailv2betaservingconfig *GoogleCloudRetailV2betaServingConfig 13886 urlParams_ gensupport.URLParams 13887 ctx_ context.Context 13888 header_ http.Header 13889 } 13890 13891 // Create: Creates a ServingConfig. A maximum of 100 ServingConfigs are allowed 13892 // in a Catalog, otherwise a FAILED_PRECONDITION error is returned. 13893 // 13894 // - parent: Full resource name of parent. Format: 13895 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`. 13896 func (r *ProjectsLocationsCatalogsServingConfigsService) Create(parent string, googlecloudretailv2betaservingconfig *GoogleCloudRetailV2betaServingConfig) *ProjectsLocationsCatalogsServingConfigsCreateCall { 13897 c := &ProjectsLocationsCatalogsServingConfigsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13898 c.parent = parent 13899 c.googlecloudretailv2betaservingconfig = googlecloudretailv2betaservingconfig 13900 return c 13901 } 13902 13903 // ServingConfigId sets the optional parameter "servingConfigId": Required. The 13904 // ID to use for the ServingConfig, which will become the final component of 13905 // the ServingConfig's resource name. This value should be 4-63 characters, and 13906 // valid characters are /a-z-_/. 13907 func (c *ProjectsLocationsCatalogsServingConfigsCreateCall) ServingConfigId(servingConfigId string) *ProjectsLocationsCatalogsServingConfigsCreateCall { 13908 c.urlParams_.Set("servingConfigId", servingConfigId) 13909 return c 13910 } 13911 13912 // Fields allows partial responses to be retrieved. See 13913 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 13914 // details. 13915 func (c *ProjectsLocationsCatalogsServingConfigsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsServingConfigsCreateCall { 13916 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13917 return c 13918 } 13919 13920 // Context sets the context to be used in this call's Do method. 13921 func (c *ProjectsLocationsCatalogsServingConfigsCreateCall) Context(ctx context.Context) *ProjectsLocationsCatalogsServingConfigsCreateCall { 13922 c.ctx_ = ctx 13923 return c 13924 } 13925 13926 // Header returns a http.Header that can be modified by the caller to add 13927 // headers to the request. 13928 func (c *ProjectsLocationsCatalogsServingConfigsCreateCall) Header() http.Header { 13929 if c.header_ == nil { 13930 c.header_ = make(http.Header) 13931 } 13932 return c.header_ 13933 } 13934 13935 func (c *ProjectsLocationsCatalogsServingConfigsCreateCall) doRequest(alt string) (*http.Response, error) { 13936 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 13937 var body io.Reader = nil 13938 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betaservingconfig) 13939 if err != nil { 13940 return nil, err 13941 } 13942 c.urlParams_.Set("alt", alt) 13943 c.urlParams_.Set("prettyPrint", "false") 13944 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+parent}/servingConfigs") 13945 urls += "?" + c.urlParams_.Encode() 13946 req, err := http.NewRequest("POST", urls, body) 13947 if err != nil { 13948 return nil, err 13949 } 13950 req.Header = reqHeaders 13951 googleapi.Expand(req.URL, map[string]string{ 13952 "parent": c.parent, 13953 }) 13954 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13955 } 13956 13957 // Do executes the "retail.projects.locations.catalogs.servingConfigs.create" call. 13958 // Any non-2xx status code is an error. Response headers are in either 13959 // *GoogleCloudRetailV2betaServingConfig.ServerResponse.Header or (if a 13960 // response was returned at all) in error.(*googleapi.Error).Header. Use 13961 // googleapi.IsNotModified to check whether the returned error was because 13962 // http.StatusNotModified was returned. 13963 func (c *ProjectsLocationsCatalogsServingConfigsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2betaServingConfig, error) { 13964 gensupport.SetOptions(c.urlParams_, opts...) 13965 res, err := c.doRequest("json") 13966 if res != nil && res.StatusCode == http.StatusNotModified { 13967 if res.Body != nil { 13968 res.Body.Close() 13969 } 13970 return nil, gensupport.WrapError(&googleapi.Error{ 13971 Code: res.StatusCode, 13972 Header: res.Header, 13973 }) 13974 } 13975 if err != nil { 13976 return nil, err 13977 } 13978 defer googleapi.CloseBody(res) 13979 if err := googleapi.CheckResponse(res); err != nil { 13980 return nil, gensupport.WrapError(err) 13981 } 13982 ret := &GoogleCloudRetailV2betaServingConfig{ 13983 ServerResponse: googleapi.ServerResponse{ 13984 Header: res.Header, 13985 HTTPStatusCode: res.StatusCode, 13986 }, 13987 } 13988 target := &ret 13989 if err := gensupport.DecodeResponse(target, res); err != nil { 13990 return nil, err 13991 } 13992 return ret, nil 13993 } 13994 13995 type ProjectsLocationsCatalogsServingConfigsDeleteCall struct { 13996 s *Service 13997 name string 13998 urlParams_ gensupport.URLParams 13999 ctx_ context.Context 14000 header_ http.Header 14001 } 14002 14003 // Delete: Deletes a ServingConfig. Returns a NotFound error if the 14004 // ServingConfig does not exist. 14005 // 14006 // - name: The resource name of the ServingConfig to delete. Format: 14007 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/se 14008 // rvingConfigs/{serving_config_id}`. 14009 func (r *ProjectsLocationsCatalogsServingConfigsService) Delete(name string) *ProjectsLocationsCatalogsServingConfigsDeleteCall { 14010 c := &ProjectsLocationsCatalogsServingConfigsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14011 c.name = name 14012 return c 14013 } 14014 14015 // Fields allows partial responses to be retrieved. See 14016 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 14017 // details. 14018 func (c *ProjectsLocationsCatalogsServingConfigsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsServingConfigsDeleteCall { 14019 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14020 return c 14021 } 14022 14023 // Context sets the context to be used in this call's Do method. 14024 func (c *ProjectsLocationsCatalogsServingConfigsDeleteCall) Context(ctx context.Context) *ProjectsLocationsCatalogsServingConfigsDeleteCall { 14025 c.ctx_ = ctx 14026 return c 14027 } 14028 14029 // Header returns a http.Header that can be modified by the caller to add 14030 // headers to the request. 14031 func (c *ProjectsLocationsCatalogsServingConfigsDeleteCall) Header() http.Header { 14032 if c.header_ == nil { 14033 c.header_ = make(http.Header) 14034 } 14035 return c.header_ 14036 } 14037 14038 func (c *ProjectsLocationsCatalogsServingConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { 14039 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 14040 var body io.Reader = nil 14041 c.urlParams_.Set("alt", alt) 14042 c.urlParams_.Set("prettyPrint", "false") 14043 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}") 14044 urls += "?" + c.urlParams_.Encode() 14045 req, err := http.NewRequest("DELETE", urls, body) 14046 if err != nil { 14047 return nil, err 14048 } 14049 req.Header = reqHeaders 14050 googleapi.Expand(req.URL, map[string]string{ 14051 "name": c.name, 14052 }) 14053 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14054 } 14055 14056 // Do executes the "retail.projects.locations.catalogs.servingConfigs.delete" call. 14057 // Any non-2xx status code is an error. Response headers are in either 14058 // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at 14059 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 14060 // check whether the returned error was because http.StatusNotModified was 14061 // returned. 14062 func (c *ProjectsLocationsCatalogsServingConfigsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { 14063 gensupport.SetOptions(c.urlParams_, opts...) 14064 res, err := c.doRequest("json") 14065 if res != nil && res.StatusCode == http.StatusNotModified { 14066 if res.Body != nil { 14067 res.Body.Close() 14068 } 14069 return nil, gensupport.WrapError(&googleapi.Error{ 14070 Code: res.StatusCode, 14071 Header: res.Header, 14072 }) 14073 } 14074 if err != nil { 14075 return nil, err 14076 } 14077 defer googleapi.CloseBody(res) 14078 if err := googleapi.CheckResponse(res); err != nil { 14079 return nil, gensupport.WrapError(err) 14080 } 14081 ret := &GoogleProtobufEmpty{ 14082 ServerResponse: googleapi.ServerResponse{ 14083 Header: res.Header, 14084 HTTPStatusCode: res.StatusCode, 14085 }, 14086 } 14087 target := &ret 14088 if err := gensupport.DecodeResponse(target, res); err != nil { 14089 return nil, err 14090 } 14091 return ret, nil 14092 } 14093 14094 type ProjectsLocationsCatalogsServingConfigsGetCall struct { 14095 s *Service 14096 name string 14097 urlParams_ gensupport.URLParams 14098 ifNoneMatch_ string 14099 ctx_ context.Context 14100 header_ http.Header 14101 } 14102 14103 // Get: Gets a ServingConfig. Returns a NotFound error if the ServingConfig 14104 // does not exist. 14105 // 14106 // - name: The resource name of the ServingConfig to get. Format: 14107 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/se 14108 // rvingConfigs/{serving_config_id}`. 14109 func (r *ProjectsLocationsCatalogsServingConfigsService) Get(name string) *ProjectsLocationsCatalogsServingConfigsGetCall { 14110 c := &ProjectsLocationsCatalogsServingConfigsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14111 c.name = name 14112 return c 14113 } 14114 14115 // Fields allows partial responses to be retrieved. See 14116 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 14117 // details. 14118 func (c *ProjectsLocationsCatalogsServingConfigsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsServingConfigsGetCall { 14119 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14120 return c 14121 } 14122 14123 // IfNoneMatch sets an optional parameter which makes the operation fail if the 14124 // object's ETag matches the given value. This is useful for getting updates 14125 // only after the object has changed since the last request. 14126 func (c *ProjectsLocationsCatalogsServingConfigsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsServingConfigsGetCall { 14127 c.ifNoneMatch_ = entityTag 14128 return c 14129 } 14130 14131 // Context sets the context to be used in this call's Do method. 14132 func (c *ProjectsLocationsCatalogsServingConfigsGetCall) Context(ctx context.Context) *ProjectsLocationsCatalogsServingConfigsGetCall { 14133 c.ctx_ = ctx 14134 return c 14135 } 14136 14137 // Header returns a http.Header that can be modified by the caller to add 14138 // headers to the request. 14139 func (c *ProjectsLocationsCatalogsServingConfigsGetCall) Header() http.Header { 14140 if c.header_ == nil { 14141 c.header_ = make(http.Header) 14142 } 14143 return c.header_ 14144 } 14145 14146 func (c *ProjectsLocationsCatalogsServingConfigsGetCall) doRequest(alt string) (*http.Response, error) { 14147 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 14148 if c.ifNoneMatch_ != "" { 14149 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 14150 } 14151 var body io.Reader = nil 14152 c.urlParams_.Set("alt", alt) 14153 c.urlParams_.Set("prettyPrint", "false") 14154 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}") 14155 urls += "?" + c.urlParams_.Encode() 14156 req, err := http.NewRequest("GET", urls, body) 14157 if err != nil { 14158 return nil, err 14159 } 14160 req.Header = reqHeaders 14161 googleapi.Expand(req.URL, map[string]string{ 14162 "name": c.name, 14163 }) 14164 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14165 } 14166 14167 // Do executes the "retail.projects.locations.catalogs.servingConfigs.get" call. 14168 // Any non-2xx status code is an error. Response headers are in either 14169 // *GoogleCloudRetailV2betaServingConfig.ServerResponse.Header or (if a 14170 // response was returned at all) in error.(*googleapi.Error).Header. Use 14171 // googleapi.IsNotModified to check whether the returned error was because 14172 // http.StatusNotModified was returned. 14173 func (c *ProjectsLocationsCatalogsServingConfigsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2betaServingConfig, error) { 14174 gensupport.SetOptions(c.urlParams_, opts...) 14175 res, err := c.doRequest("json") 14176 if res != nil && res.StatusCode == http.StatusNotModified { 14177 if res.Body != nil { 14178 res.Body.Close() 14179 } 14180 return nil, gensupport.WrapError(&googleapi.Error{ 14181 Code: res.StatusCode, 14182 Header: res.Header, 14183 }) 14184 } 14185 if err != nil { 14186 return nil, err 14187 } 14188 defer googleapi.CloseBody(res) 14189 if err := googleapi.CheckResponse(res); err != nil { 14190 return nil, gensupport.WrapError(err) 14191 } 14192 ret := &GoogleCloudRetailV2betaServingConfig{ 14193 ServerResponse: googleapi.ServerResponse{ 14194 Header: res.Header, 14195 HTTPStatusCode: res.StatusCode, 14196 }, 14197 } 14198 target := &ret 14199 if err := gensupport.DecodeResponse(target, res); err != nil { 14200 return nil, err 14201 } 14202 return ret, nil 14203 } 14204 14205 type ProjectsLocationsCatalogsServingConfigsListCall struct { 14206 s *Service 14207 parent string 14208 urlParams_ gensupport.URLParams 14209 ifNoneMatch_ string 14210 ctx_ context.Context 14211 header_ http.Header 14212 } 14213 14214 // List: Lists all ServingConfigs linked to this catalog. 14215 // 14216 // - parent: The catalog resource name. Format: 14217 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`. 14218 func (r *ProjectsLocationsCatalogsServingConfigsService) List(parent string) *ProjectsLocationsCatalogsServingConfigsListCall { 14219 c := &ProjectsLocationsCatalogsServingConfigsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14220 c.parent = parent 14221 return c 14222 } 14223 14224 // PageSize sets the optional parameter "pageSize": Maximum number of results 14225 // to return. If unspecified, defaults to 100. If a value greater than 100 is 14226 // provided, at most 100 results are returned. 14227 func (c *ProjectsLocationsCatalogsServingConfigsListCall) PageSize(pageSize int64) *ProjectsLocationsCatalogsServingConfigsListCall { 14228 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 14229 return c 14230 } 14231 14232 // PageToken sets the optional parameter "pageToken": A page token, received 14233 // from a previous `ListServingConfigs` call. Provide this to retrieve the 14234 // subsequent page. 14235 func (c *ProjectsLocationsCatalogsServingConfigsListCall) PageToken(pageToken string) *ProjectsLocationsCatalogsServingConfigsListCall { 14236 c.urlParams_.Set("pageToken", pageToken) 14237 return c 14238 } 14239 14240 // Fields allows partial responses to be retrieved. See 14241 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 14242 // details. 14243 func (c *ProjectsLocationsCatalogsServingConfigsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsServingConfigsListCall { 14244 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14245 return c 14246 } 14247 14248 // IfNoneMatch sets an optional parameter which makes the operation fail if the 14249 // object's ETag matches the given value. This is useful for getting updates 14250 // only after the object has changed since the last request. 14251 func (c *ProjectsLocationsCatalogsServingConfigsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsServingConfigsListCall { 14252 c.ifNoneMatch_ = entityTag 14253 return c 14254 } 14255 14256 // Context sets the context to be used in this call's Do method. 14257 func (c *ProjectsLocationsCatalogsServingConfigsListCall) Context(ctx context.Context) *ProjectsLocationsCatalogsServingConfigsListCall { 14258 c.ctx_ = ctx 14259 return c 14260 } 14261 14262 // Header returns a http.Header that can be modified by the caller to add 14263 // headers to the request. 14264 func (c *ProjectsLocationsCatalogsServingConfigsListCall) Header() http.Header { 14265 if c.header_ == nil { 14266 c.header_ = make(http.Header) 14267 } 14268 return c.header_ 14269 } 14270 14271 func (c *ProjectsLocationsCatalogsServingConfigsListCall) doRequest(alt string) (*http.Response, error) { 14272 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 14273 if c.ifNoneMatch_ != "" { 14274 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 14275 } 14276 var body io.Reader = nil 14277 c.urlParams_.Set("alt", alt) 14278 c.urlParams_.Set("prettyPrint", "false") 14279 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+parent}/servingConfigs") 14280 urls += "?" + c.urlParams_.Encode() 14281 req, err := http.NewRequest("GET", urls, body) 14282 if err != nil { 14283 return nil, err 14284 } 14285 req.Header = reqHeaders 14286 googleapi.Expand(req.URL, map[string]string{ 14287 "parent": c.parent, 14288 }) 14289 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14290 } 14291 14292 // Do executes the "retail.projects.locations.catalogs.servingConfigs.list" call. 14293 // Any non-2xx status code is an error. Response headers are in either 14294 // *GoogleCloudRetailV2betaListServingConfigsResponse.ServerResponse.Header or 14295 // (if a response was returned at all) in error.(*googleapi.Error).Header. Use 14296 // googleapi.IsNotModified to check whether the returned error was because 14297 // http.StatusNotModified was returned. 14298 func (c *ProjectsLocationsCatalogsServingConfigsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2betaListServingConfigsResponse, error) { 14299 gensupport.SetOptions(c.urlParams_, opts...) 14300 res, err := c.doRequest("json") 14301 if res != nil && res.StatusCode == http.StatusNotModified { 14302 if res.Body != nil { 14303 res.Body.Close() 14304 } 14305 return nil, gensupport.WrapError(&googleapi.Error{ 14306 Code: res.StatusCode, 14307 Header: res.Header, 14308 }) 14309 } 14310 if err != nil { 14311 return nil, err 14312 } 14313 defer googleapi.CloseBody(res) 14314 if err := googleapi.CheckResponse(res); err != nil { 14315 return nil, gensupport.WrapError(err) 14316 } 14317 ret := &GoogleCloudRetailV2betaListServingConfigsResponse{ 14318 ServerResponse: googleapi.ServerResponse{ 14319 Header: res.Header, 14320 HTTPStatusCode: res.StatusCode, 14321 }, 14322 } 14323 target := &ret 14324 if err := gensupport.DecodeResponse(target, res); err != nil { 14325 return nil, err 14326 } 14327 return ret, nil 14328 } 14329 14330 // Pages invokes f for each page of results. 14331 // A non-nil error returned from f will halt the iteration. 14332 // The provided context supersedes any context provided to the Context method. 14333 func (c *ProjectsLocationsCatalogsServingConfigsListCall) Pages(ctx context.Context, f func(*GoogleCloudRetailV2betaListServingConfigsResponse) error) error { 14334 c.ctx_ = ctx 14335 defer c.PageToken(c.urlParams_.Get("pageToken")) 14336 for { 14337 x, err := c.Do() 14338 if err != nil { 14339 return err 14340 } 14341 if err := f(x); err != nil { 14342 return err 14343 } 14344 if x.NextPageToken == "" { 14345 return nil 14346 } 14347 c.PageToken(x.NextPageToken) 14348 } 14349 } 14350 14351 type ProjectsLocationsCatalogsServingConfigsPatchCall struct { 14352 s *Service 14353 name string 14354 googlecloudretailv2betaservingconfig *GoogleCloudRetailV2betaServingConfig 14355 urlParams_ gensupport.URLParams 14356 ctx_ context.Context 14357 header_ http.Header 14358 } 14359 14360 // Patch: Updates a ServingConfig. 14361 // 14362 // - name: Immutable. Fully qualified name 14363 // `projects/*/locations/global/catalogs/*/servingConfig/*`. 14364 func (r *ProjectsLocationsCatalogsServingConfigsService) Patch(name string, googlecloudretailv2betaservingconfig *GoogleCloudRetailV2betaServingConfig) *ProjectsLocationsCatalogsServingConfigsPatchCall { 14365 c := &ProjectsLocationsCatalogsServingConfigsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14366 c.name = name 14367 c.googlecloudretailv2betaservingconfig = googlecloudretailv2betaservingconfig 14368 return c 14369 } 14370 14371 // UpdateMask sets the optional parameter "updateMask": Indicates which fields 14372 // in the provided ServingConfig to update. The following are NOT supported: * 14373 // ServingConfig.name If not set, all supported fields are updated. 14374 func (c *ProjectsLocationsCatalogsServingConfigsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsCatalogsServingConfigsPatchCall { 14375 c.urlParams_.Set("updateMask", updateMask) 14376 return c 14377 } 14378 14379 // Fields allows partial responses to be retrieved. See 14380 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 14381 // details. 14382 func (c *ProjectsLocationsCatalogsServingConfigsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsServingConfigsPatchCall { 14383 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14384 return c 14385 } 14386 14387 // Context sets the context to be used in this call's Do method. 14388 func (c *ProjectsLocationsCatalogsServingConfigsPatchCall) Context(ctx context.Context) *ProjectsLocationsCatalogsServingConfigsPatchCall { 14389 c.ctx_ = ctx 14390 return c 14391 } 14392 14393 // Header returns a http.Header that can be modified by the caller to add 14394 // headers to the request. 14395 func (c *ProjectsLocationsCatalogsServingConfigsPatchCall) Header() http.Header { 14396 if c.header_ == nil { 14397 c.header_ = make(http.Header) 14398 } 14399 return c.header_ 14400 } 14401 14402 func (c *ProjectsLocationsCatalogsServingConfigsPatchCall) doRequest(alt string) (*http.Response, error) { 14403 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 14404 var body io.Reader = nil 14405 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betaservingconfig) 14406 if err != nil { 14407 return nil, err 14408 } 14409 c.urlParams_.Set("alt", alt) 14410 c.urlParams_.Set("prettyPrint", "false") 14411 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}") 14412 urls += "?" + c.urlParams_.Encode() 14413 req, err := http.NewRequest("PATCH", urls, body) 14414 if err != nil { 14415 return nil, err 14416 } 14417 req.Header = reqHeaders 14418 googleapi.Expand(req.URL, map[string]string{ 14419 "name": c.name, 14420 }) 14421 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14422 } 14423 14424 // Do executes the "retail.projects.locations.catalogs.servingConfigs.patch" call. 14425 // Any non-2xx status code is an error. Response headers are in either 14426 // *GoogleCloudRetailV2betaServingConfig.ServerResponse.Header or (if a 14427 // response was returned at all) in error.(*googleapi.Error).Header. Use 14428 // googleapi.IsNotModified to check whether the returned error was because 14429 // http.StatusNotModified was returned. 14430 func (c *ProjectsLocationsCatalogsServingConfigsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2betaServingConfig, error) { 14431 gensupport.SetOptions(c.urlParams_, opts...) 14432 res, err := c.doRequest("json") 14433 if res != nil && res.StatusCode == http.StatusNotModified { 14434 if res.Body != nil { 14435 res.Body.Close() 14436 } 14437 return nil, gensupport.WrapError(&googleapi.Error{ 14438 Code: res.StatusCode, 14439 Header: res.Header, 14440 }) 14441 } 14442 if err != nil { 14443 return nil, err 14444 } 14445 defer googleapi.CloseBody(res) 14446 if err := googleapi.CheckResponse(res); err != nil { 14447 return nil, gensupport.WrapError(err) 14448 } 14449 ret := &GoogleCloudRetailV2betaServingConfig{ 14450 ServerResponse: googleapi.ServerResponse{ 14451 Header: res.Header, 14452 HTTPStatusCode: res.StatusCode, 14453 }, 14454 } 14455 target := &ret 14456 if err := gensupport.DecodeResponse(target, res); err != nil { 14457 return nil, err 14458 } 14459 return ret, nil 14460 } 14461 14462 type ProjectsLocationsCatalogsServingConfigsPredictCall struct { 14463 s *Service 14464 placement string 14465 googlecloudretailv2betapredictrequest *GoogleCloudRetailV2betaPredictRequest 14466 urlParams_ gensupport.URLParams 14467 ctx_ context.Context 14468 header_ http.Header 14469 } 14470 14471 // Predict: Makes a recommendation prediction. 14472 // 14473 // - placement: Full resource name of the format: 14474 // `{placement=projects/*/locations/global/catalogs/default_catalog/servingCon 14475 // figs/*}` or 14476 // `{placement=projects/*/locations/global/catalogs/default_catalog/placements 14477 // /*}`. We recommend using the `servingConfigs` resource. `placements` is a 14478 // legacy resource. The ID of the Recommendations AI serving config or 14479 // placement. Before you can request predictions from your model, you must 14480 // create at least one serving config or placement for it. For more 14481 // information, see [Manage serving configs] 14482 // (https://cloud.google.com/retail/docs/manage-configs). The full list of 14483 // available serving configs can be seen at 14484 // https://console.cloud.google.com/ai/retail/catalogs/default_catalog/configs. 14485 func (r *ProjectsLocationsCatalogsServingConfigsService) Predict(placement string, googlecloudretailv2betapredictrequest *GoogleCloudRetailV2betaPredictRequest) *ProjectsLocationsCatalogsServingConfigsPredictCall { 14486 c := &ProjectsLocationsCatalogsServingConfigsPredictCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14487 c.placement = placement 14488 c.googlecloudretailv2betapredictrequest = googlecloudretailv2betapredictrequest 14489 return c 14490 } 14491 14492 // Fields allows partial responses to be retrieved. See 14493 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 14494 // details. 14495 func (c *ProjectsLocationsCatalogsServingConfigsPredictCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsServingConfigsPredictCall { 14496 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14497 return c 14498 } 14499 14500 // Context sets the context to be used in this call's Do method. 14501 func (c *ProjectsLocationsCatalogsServingConfigsPredictCall) Context(ctx context.Context) *ProjectsLocationsCatalogsServingConfigsPredictCall { 14502 c.ctx_ = ctx 14503 return c 14504 } 14505 14506 // Header returns a http.Header that can be modified by the caller to add 14507 // headers to the request. 14508 func (c *ProjectsLocationsCatalogsServingConfigsPredictCall) Header() http.Header { 14509 if c.header_ == nil { 14510 c.header_ = make(http.Header) 14511 } 14512 return c.header_ 14513 } 14514 14515 func (c *ProjectsLocationsCatalogsServingConfigsPredictCall) doRequest(alt string) (*http.Response, error) { 14516 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 14517 var body io.Reader = nil 14518 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betapredictrequest) 14519 if err != nil { 14520 return nil, err 14521 } 14522 c.urlParams_.Set("alt", alt) 14523 c.urlParams_.Set("prettyPrint", "false") 14524 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+placement}:predict") 14525 urls += "?" + c.urlParams_.Encode() 14526 req, err := http.NewRequest("POST", urls, body) 14527 if err != nil { 14528 return nil, err 14529 } 14530 req.Header = reqHeaders 14531 googleapi.Expand(req.URL, map[string]string{ 14532 "placement": c.placement, 14533 }) 14534 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14535 } 14536 14537 // Do executes the "retail.projects.locations.catalogs.servingConfigs.predict" call. 14538 // Any non-2xx status code is an error. Response headers are in either 14539 // *GoogleCloudRetailV2betaPredictResponse.ServerResponse.Header or (if a 14540 // response was returned at all) in error.(*googleapi.Error).Header. Use 14541 // googleapi.IsNotModified to check whether the returned error was because 14542 // http.StatusNotModified was returned. 14543 func (c *ProjectsLocationsCatalogsServingConfigsPredictCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2betaPredictResponse, error) { 14544 gensupport.SetOptions(c.urlParams_, opts...) 14545 res, err := c.doRequest("json") 14546 if res != nil && res.StatusCode == http.StatusNotModified { 14547 if res.Body != nil { 14548 res.Body.Close() 14549 } 14550 return nil, gensupport.WrapError(&googleapi.Error{ 14551 Code: res.StatusCode, 14552 Header: res.Header, 14553 }) 14554 } 14555 if err != nil { 14556 return nil, err 14557 } 14558 defer googleapi.CloseBody(res) 14559 if err := googleapi.CheckResponse(res); err != nil { 14560 return nil, gensupport.WrapError(err) 14561 } 14562 ret := &GoogleCloudRetailV2betaPredictResponse{ 14563 ServerResponse: googleapi.ServerResponse{ 14564 Header: res.Header, 14565 HTTPStatusCode: res.StatusCode, 14566 }, 14567 } 14568 target := &ret 14569 if err := gensupport.DecodeResponse(target, res); err != nil { 14570 return nil, err 14571 } 14572 return ret, nil 14573 } 14574 14575 type ProjectsLocationsCatalogsServingConfigsRemoveControlCall struct { 14576 s *Service 14577 servingConfig string 14578 googlecloudretailv2betaremovecontrolrequest *GoogleCloudRetailV2betaRemoveControlRequest 14579 urlParams_ gensupport.URLParams 14580 ctx_ context.Context 14581 header_ http.Header 14582 } 14583 14584 // RemoveControl: Disables a Control on the specified ServingConfig. The 14585 // control is removed from the ServingConfig. Returns a NOT_FOUND error if the 14586 // Control is not enabled for the ServingConfig. 14587 // 14588 // - servingConfig: The source ServingConfig resource name . Format: 14589 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/se 14590 // rvingConfigs/{serving_config_id}`. 14591 func (r *ProjectsLocationsCatalogsServingConfigsService) RemoveControl(servingConfig string, googlecloudretailv2betaremovecontrolrequest *GoogleCloudRetailV2betaRemoveControlRequest) *ProjectsLocationsCatalogsServingConfigsRemoveControlCall { 14592 c := &ProjectsLocationsCatalogsServingConfigsRemoveControlCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14593 c.servingConfig = servingConfig 14594 c.googlecloudretailv2betaremovecontrolrequest = googlecloudretailv2betaremovecontrolrequest 14595 return c 14596 } 14597 14598 // Fields allows partial responses to be retrieved. See 14599 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 14600 // details. 14601 func (c *ProjectsLocationsCatalogsServingConfigsRemoveControlCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsServingConfigsRemoveControlCall { 14602 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14603 return c 14604 } 14605 14606 // Context sets the context to be used in this call's Do method. 14607 func (c *ProjectsLocationsCatalogsServingConfigsRemoveControlCall) Context(ctx context.Context) *ProjectsLocationsCatalogsServingConfigsRemoveControlCall { 14608 c.ctx_ = ctx 14609 return c 14610 } 14611 14612 // Header returns a http.Header that can be modified by the caller to add 14613 // headers to the request. 14614 func (c *ProjectsLocationsCatalogsServingConfigsRemoveControlCall) Header() http.Header { 14615 if c.header_ == nil { 14616 c.header_ = make(http.Header) 14617 } 14618 return c.header_ 14619 } 14620 14621 func (c *ProjectsLocationsCatalogsServingConfigsRemoveControlCall) doRequest(alt string) (*http.Response, error) { 14622 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 14623 var body io.Reader = nil 14624 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betaremovecontrolrequest) 14625 if err != nil { 14626 return nil, err 14627 } 14628 c.urlParams_.Set("alt", alt) 14629 c.urlParams_.Set("prettyPrint", "false") 14630 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+servingConfig}:removeControl") 14631 urls += "?" + c.urlParams_.Encode() 14632 req, err := http.NewRequest("POST", urls, body) 14633 if err != nil { 14634 return nil, err 14635 } 14636 req.Header = reqHeaders 14637 googleapi.Expand(req.URL, map[string]string{ 14638 "servingConfig": c.servingConfig, 14639 }) 14640 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14641 } 14642 14643 // Do executes the "retail.projects.locations.catalogs.servingConfigs.removeControl" call. 14644 // Any non-2xx status code is an error. Response headers are in either 14645 // *GoogleCloudRetailV2betaServingConfig.ServerResponse.Header or (if a 14646 // response was returned at all) in error.(*googleapi.Error).Header. Use 14647 // googleapi.IsNotModified to check whether the returned error was because 14648 // http.StatusNotModified was returned. 14649 func (c *ProjectsLocationsCatalogsServingConfigsRemoveControlCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2betaServingConfig, error) { 14650 gensupport.SetOptions(c.urlParams_, opts...) 14651 res, err := c.doRequest("json") 14652 if res != nil && res.StatusCode == http.StatusNotModified { 14653 if res.Body != nil { 14654 res.Body.Close() 14655 } 14656 return nil, gensupport.WrapError(&googleapi.Error{ 14657 Code: res.StatusCode, 14658 Header: res.Header, 14659 }) 14660 } 14661 if err != nil { 14662 return nil, err 14663 } 14664 defer googleapi.CloseBody(res) 14665 if err := googleapi.CheckResponse(res); err != nil { 14666 return nil, gensupport.WrapError(err) 14667 } 14668 ret := &GoogleCloudRetailV2betaServingConfig{ 14669 ServerResponse: googleapi.ServerResponse{ 14670 Header: res.Header, 14671 HTTPStatusCode: res.StatusCode, 14672 }, 14673 } 14674 target := &ret 14675 if err := gensupport.DecodeResponse(target, res); err != nil { 14676 return nil, err 14677 } 14678 return ret, nil 14679 } 14680 14681 type ProjectsLocationsCatalogsServingConfigsSearchCall struct { 14682 s *Service 14683 placement string 14684 googlecloudretailv2betasearchrequest *GoogleCloudRetailV2betaSearchRequest 14685 urlParams_ gensupport.URLParams 14686 ctx_ context.Context 14687 header_ http.Header 14688 } 14689 14690 // Search: Performs a search. This feature is only available for users who have 14691 // Retail Search enabled. Enable Retail Search on Cloud Console before using 14692 // this feature. 14693 // 14694 // - placement: The resource name of the Retail Search serving config, such as 14695 // `projects/*/locations/global/catalogs/default_catalog/servingConfigs/defaul 14696 // t_serving_config` or the name of the legacy placement resource, such as 14697 // `projects/*/locations/global/catalogs/default_catalog/placements/default_se 14698 // arch`. This field is used to identify the serving config name and the set 14699 // of models that are used to make the search. 14700 func (r *ProjectsLocationsCatalogsServingConfigsService) Search(placement string, googlecloudretailv2betasearchrequest *GoogleCloudRetailV2betaSearchRequest) *ProjectsLocationsCatalogsServingConfigsSearchCall { 14701 c := &ProjectsLocationsCatalogsServingConfigsSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14702 c.placement = placement 14703 c.googlecloudretailv2betasearchrequest = googlecloudretailv2betasearchrequest 14704 return c 14705 } 14706 14707 // Fields allows partial responses to be retrieved. See 14708 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 14709 // details. 14710 func (c *ProjectsLocationsCatalogsServingConfigsSearchCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsServingConfigsSearchCall { 14711 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14712 return c 14713 } 14714 14715 // Context sets the context to be used in this call's Do method. 14716 func (c *ProjectsLocationsCatalogsServingConfigsSearchCall) Context(ctx context.Context) *ProjectsLocationsCatalogsServingConfigsSearchCall { 14717 c.ctx_ = ctx 14718 return c 14719 } 14720 14721 // Header returns a http.Header that can be modified by the caller to add 14722 // headers to the request. 14723 func (c *ProjectsLocationsCatalogsServingConfigsSearchCall) Header() http.Header { 14724 if c.header_ == nil { 14725 c.header_ = make(http.Header) 14726 } 14727 return c.header_ 14728 } 14729 14730 func (c *ProjectsLocationsCatalogsServingConfigsSearchCall) doRequest(alt string) (*http.Response, error) { 14731 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 14732 var body io.Reader = nil 14733 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betasearchrequest) 14734 if err != nil { 14735 return nil, err 14736 } 14737 c.urlParams_.Set("alt", alt) 14738 c.urlParams_.Set("prettyPrint", "false") 14739 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+placement}:search") 14740 urls += "?" + c.urlParams_.Encode() 14741 req, err := http.NewRequest("POST", urls, body) 14742 if err != nil { 14743 return nil, err 14744 } 14745 req.Header = reqHeaders 14746 googleapi.Expand(req.URL, map[string]string{ 14747 "placement": c.placement, 14748 }) 14749 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14750 } 14751 14752 // Do executes the "retail.projects.locations.catalogs.servingConfigs.search" call. 14753 // Any non-2xx status code is an error. Response headers are in either 14754 // *GoogleCloudRetailV2betaSearchResponse.ServerResponse.Header or (if a 14755 // response was returned at all) in error.(*googleapi.Error).Header. Use 14756 // googleapi.IsNotModified to check whether the returned error was because 14757 // http.StatusNotModified was returned. 14758 func (c *ProjectsLocationsCatalogsServingConfigsSearchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2betaSearchResponse, error) { 14759 gensupport.SetOptions(c.urlParams_, opts...) 14760 res, err := c.doRequest("json") 14761 if res != nil && res.StatusCode == http.StatusNotModified { 14762 if res.Body != nil { 14763 res.Body.Close() 14764 } 14765 return nil, gensupport.WrapError(&googleapi.Error{ 14766 Code: res.StatusCode, 14767 Header: res.Header, 14768 }) 14769 } 14770 if err != nil { 14771 return nil, err 14772 } 14773 defer googleapi.CloseBody(res) 14774 if err := googleapi.CheckResponse(res); err != nil { 14775 return nil, gensupport.WrapError(err) 14776 } 14777 ret := &GoogleCloudRetailV2betaSearchResponse{ 14778 ServerResponse: googleapi.ServerResponse{ 14779 Header: res.Header, 14780 HTTPStatusCode: res.StatusCode, 14781 }, 14782 } 14783 target := &ret 14784 if err := gensupport.DecodeResponse(target, res); err != nil { 14785 return nil, err 14786 } 14787 return ret, nil 14788 } 14789 14790 // Pages invokes f for each page of results. 14791 // A non-nil error returned from f will halt the iteration. 14792 // The provided context supersedes any context provided to the Context method. 14793 func (c *ProjectsLocationsCatalogsServingConfigsSearchCall) Pages(ctx context.Context, f func(*GoogleCloudRetailV2betaSearchResponse) error) error { 14794 c.ctx_ = ctx 14795 defer func(pt string) { c.googlecloudretailv2betasearchrequest.PageToken = pt }(c.googlecloudretailv2betasearchrequest.PageToken) 14796 for { 14797 x, err := c.Do() 14798 if err != nil { 14799 return err 14800 } 14801 if err := f(x); err != nil { 14802 return err 14803 } 14804 if x.NextPageToken == "" { 14805 return nil 14806 } 14807 c.googlecloudretailv2betasearchrequest.PageToken = x.NextPageToken 14808 } 14809 } 14810 14811 type ProjectsLocationsCatalogsUserEventsCollectCall struct { 14812 s *Service 14813 parent string 14814 urlParams_ gensupport.URLParams 14815 ifNoneMatch_ string 14816 ctx_ context.Context 14817 header_ http.Header 14818 } 14819 14820 // Collect: Writes a single user event from the browser. This uses a GET 14821 // request to due to browser restriction of POST-ing to a 3rd party domain. 14822 // This method is used only by the Retail API JavaScript pixel and Google Tag 14823 // Manager. Users should not call this method directly. 14824 // 14825 // - parent: The parent catalog name, such as 14826 // `projects/1234/locations/global/catalogs/default_catalog`. 14827 func (r *ProjectsLocationsCatalogsUserEventsService) Collect(parent string) *ProjectsLocationsCatalogsUserEventsCollectCall { 14828 c := &ProjectsLocationsCatalogsUserEventsCollectCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14829 c.parent = parent 14830 return c 14831 } 14832 14833 // Ets sets the optional parameter "ets": The event timestamp in milliseconds. 14834 // This prevents browser caching of otherwise identical get requests. The name 14835 // is abbreviated to reduce the payload bytes. 14836 func (c *ProjectsLocationsCatalogsUserEventsCollectCall) Ets(ets int64) *ProjectsLocationsCatalogsUserEventsCollectCall { 14837 c.urlParams_.Set("ets", fmt.Sprint(ets)) 14838 return c 14839 } 14840 14841 // PrebuiltRule sets the optional parameter "prebuiltRule": The prebuilt rule 14842 // name that can convert a specific type of raw_json. For example: "ga4_bq" 14843 // rule for the GA4 user event schema. 14844 func (c *ProjectsLocationsCatalogsUserEventsCollectCall) PrebuiltRule(prebuiltRule string) *ProjectsLocationsCatalogsUserEventsCollectCall { 14845 c.urlParams_.Set("prebuiltRule", prebuiltRule) 14846 return c 14847 } 14848 14849 // RawJson sets the optional parameter "rawJson": An arbitrary serialized JSON 14850 // string that contains necessary information that can comprise a user event. 14851 // When this field is specified, the user_event field will be ignored. Note: 14852 // line-delimited JSON is not supported, a single JSON only. 14853 func (c *ProjectsLocationsCatalogsUserEventsCollectCall) RawJson(rawJson string) *ProjectsLocationsCatalogsUserEventsCollectCall { 14854 c.urlParams_.Set("rawJson", rawJson) 14855 return c 14856 } 14857 14858 // Uri sets the optional parameter "uri": The URL including cgi-parameters but 14859 // excluding the hash fragment with a length limit of 5,000 characters. This is 14860 // often more useful than the referer URL, because many browsers only send the 14861 // domain for 3rd party requests. 14862 func (c *ProjectsLocationsCatalogsUserEventsCollectCall) Uri(uri string) *ProjectsLocationsCatalogsUserEventsCollectCall { 14863 c.urlParams_.Set("uri", uri) 14864 return c 14865 } 14866 14867 // UserEvent sets the optional parameter "userEvent": Required. URL encoded 14868 // UserEvent proto with a length limit of 2,000,000 characters. 14869 func (c *ProjectsLocationsCatalogsUserEventsCollectCall) UserEvent(userEvent string) *ProjectsLocationsCatalogsUserEventsCollectCall { 14870 c.urlParams_.Set("userEvent", userEvent) 14871 return c 14872 } 14873 14874 // Fields allows partial responses to be retrieved. See 14875 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 14876 // details. 14877 func (c *ProjectsLocationsCatalogsUserEventsCollectCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsUserEventsCollectCall { 14878 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14879 return c 14880 } 14881 14882 // IfNoneMatch sets an optional parameter which makes the operation fail if the 14883 // object's ETag matches the given value. This is useful for getting updates 14884 // only after the object has changed since the last request. 14885 func (c *ProjectsLocationsCatalogsUserEventsCollectCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsUserEventsCollectCall { 14886 c.ifNoneMatch_ = entityTag 14887 return c 14888 } 14889 14890 // Context sets the context to be used in this call's Do method. 14891 func (c *ProjectsLocationsCatalogsUserEventsCollectCall) Context(ctx context.Context) *ProjectsLocationsCatalogsUserEventsCollectCall { 14892 c.ctx_ = ctx 14893 return c 14894 } 14895 14896 // Header returns a http.Header that can be modified by the caller to add 14897 // headers to the request. 14898 func (c *ProjectsLocationsCatalogsUserEventsCollectCall) Header() http.Header { 14899 if c.header_ == nil { 14900 c.header_ = make(http.Header) 14901 } 14902 return c.header_ 14903 } 14904 14905 func (c *ProjectsLocationsCatalogsUserEventsCollectCall) doRequest(alt string) (*http.Response, error) { 14906 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 14907 if c.ifNoneMatch_ != "" { 14908 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 14909 } 14910 var body io.Reader = nil 14911 c.urlParams_.Set("alt", alt) 14912 c.urlParams_.Set("prettyPrint", "false") 14913 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+parent}/userEvents:collect") 14914 urls += "?" + c.urlParams_.Encode() 14915 req, err := http.NewRequest("GET", urls, body) 14916 if err != nil { 14917 return nil, err 14918 } 14919 req.Header = reqHeaders 14920 googleapi.Expand(req.URL, map[string]string{ 14921 "parent": c.parent, 14922 }) 14923 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14924 } 14925 14926 // Do executes the "retail.projects.locations.catalogs.userEvents.collect" call. 14927 // Any non-2xx status code is an error. Response headers are in either 14928 // *GoogleApiHttpBody.ServerResponse.Header or (if a response was returned at 14929 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 14930 // check whether the returned error was because http.StatusNotModified was 14931 // returned. 14932 func (c *ProjectsLocationsCatalogsUserEventsCollectCall) Do(opts ...googleapi.CallOption) (*GoogleApiHttpBody, error) { 14933 gensupport.SetOptions(c.urlParams_, opts...) 14934 res, err := c.doRequest("json") 14935 if res != nil && res.StatusCode == http.StatusNotModified { 14936 if res.Body != nil { 14937 res.Body.Close() 14938 } 14939 return nil, gensupport.WrapError(&googleapi.Error{ 14940 Code: res.StatusCode, 14941 Header: res.Header, 14942 }) 14943 } 14944 if err != nil { 14945 return nil, err 14946 } 14947 defer googleapi.CloseBody(res) 14948 if err := googleapi.CheckResponse(res); err != nil { 14949 return nil, gensupport.WrapError(err) 14950 } 14951 ret := &GoogleApiHttpBody{ 14952 ServerResponse: googleapi.ServerResponse{ 14953 Header: res.Header, 14954 HTTPStatusCode: res.StatusCode, 14955 }, 14956 } 14957 target := &ret 14958 if err := gensupport.DecodeResponse(target, res); err != nil { 14959 return nil, err 14960 } 14961 return ret, nil 14962 } 14963 14964 type ProjectsLocationsCatalogsUserEventsImportCall struct { 14965 s *Service 14966 parent string 14967 googlecloudretailv2betaimportusereventsrequest *GoogleCloudRetailV2betaImportUserEventsRequest 14968 urlParams_ gensupport.URLParams 14969 ctx_ context.Context 14970 header_ http.Header 14971 } 14972 14973 // Import: Bulk import of User events. Request processing might be synchronous. 14974 // Events that already exist are skipped. Use this method for backfilling 14975 // historical user events. `Operation.response` is of type `ImportResponse`. 14976 // Note that it is possible for a subset of the items to be successfully 14977 // inserted. `Operation.metadata` is of type `ImportMetadata`. 14978 // 14979 // - parent: `projects/1234/locations/global/catalogs/default_catalog`. 14980 func (r *ProjectsLocationsCatalogsUserEventsService) Import(parent string, googlecloudretailv2betaimportusereventsrequest *GoogleCloudRetailV2betaImportUserEventsRequest) *ProjectsLocationsCatalogsUserEventsImportCall { 14981 c := &ProjectsLocationsCatalogsUserEventsImportCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14982 c.parent = parent 14983 c.googlecloudretailv2betaimportusereventsrequest = googlecloudretailv2betaimportusereventsrequest 14984 return c 14985 } 14986 14987 // Fields allows partial responses to be retrieved. See 14988 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 14989 // details. 14990 func (c *ProjectsLocationsCatalogsUserEventsImportCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsUserEventsImportCall { 14991 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14992 return c 14993 } 14994 14995 // Context sets the context to be used in this call's Do method. 14996 func (c *ProjectsLocationsCatalogsUserEventsImportCall) Context(ctx context.Context) *ProjectsLocationsCatalogsUserEventsImportCall { 14997 c.ctx_ = ctx 14998 return c 14999 } 15000 15001 // Header returns a http.Header that can be modified by the caller to add 15002 // headers to the request. 15003 func (c *ProjectsLocationsCatalogsUserEventsImportCall) Header() http.Header { 15004 if c.header_ == nil { 15005 c.header_ = make(http.Header) 15006 } 15007 return c.header_ 15008 } 15009 15010 func (c *ProjectsLocationsCatalogsUserEventsImportCall) doRequest(alt string) (*http.Response, error) { 15011 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 15012 var body io.Reader = nil 15013 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betaimportusereventsrequest) 15014 if err != nil { 15015 return nil, err 15016 } 15017 c.urlParams_.Set("alt", alt) 15018 c.urlParams_.Set("prettyPrint", "false") 15019 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+parent}/userEvents:import") 15020 urls += "?" + c.urlParams_.Encode() 15021 req, err := http.NewRequest("POST", urls, body) 15022 if err != nil { 15023 return nil, err 15024 } 15025 req.Header = reqHeaders 15026 googleapi.Expand(req.URL, map[string]string{ 15027 "parent": c.parent, 15028 }) 15029 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15030 } 15031 15032 // Do executes the "retail.projects.locations.catalogs.userEvents.import" call. 15033 // Any non-2xx status code is an error. Response headers are in either 15034 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was 15035 // returned at all) in error.(*googleapi.Error).Header. Use 15036 // googleapi.IsNotModified to check whether the returned error was because 15037 // http.StatusNotModified was returned. 15038 func (c *ProjectsLocationsCatalogsUserEventsImportCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 15039 gensupport.SetOptions(c.urlParams_, opts...) 15040 res, err := c.doRequest("json") 15041 if res != nil && res.StatusCode == http.StatusNotModified { 15042 if res.Body != nil { 15043 res.Body.Close() 15044 } 15045 return nil, gensupport.WrapError(&googleapi.Error{ 15046 Code: res.StatusCode, 15047 Header: res.Header, 15048 }) 15049 } 15050 if err != nil { 15051 return nil, err 15052 } 15053 defer googleapi.CloseBody(res) 15054 if err := googleapi.CheckResponse(res); err != nil { 15055 return nil, gensupport.WrapError(err) 15056 } 15057 ret := &GoogleLongrunningOperation{ 15058 ServerResponse: googleapi.ServerResponse{ 15059 Header: res.Header, 15060 HTTPStatusCode: res.StatusCode, 15061 }, 15062 } 15063 target := &ret 15064 if err := gensupport.DecodeResponse(target, res); err != nil { 15065 return nil, err 15066 } 15067 return ret, nil 15068 } 15069 15070 type ProjectsLocationsCatalogsUserEventsPurgeCall struct { 15071 s *Service 15072 parent string 15073 googlecloudretailv2betapurgeusereventsrequest *GoogleCloudRetailV2betaPurgeUserEventsRequest 15074 urlParams_ gensupport.URLParams 15075 ctx_ context.Context 15076 header_ http.Header 15077 } 15078 15079 // Purge: Deletes permanently all user events specified by the filter provided. 15080 // Depending on the number of events specified by the filter, this operation 15081 // could take hours or days to complete. To test a filter, use the list command 15082 // first. 15083 // 15084 // - parent: The resource name of the catalog under which the events are 15085 // created. The format is 15086 // `projects/${projectId}/locations/global/catalogs/${catalogId}`. 15087 func (r *ProjectsLocationsCatalogsUserEventsService) Purge(parent string, googlecloudretailv2betapurgeusereventsrequest *GoogleCloudRetailV2betaPurgeUserEventsRequest) *ProjectsLocationsCatalogsUserEventsPurgeCall { 15088 c := &ProjectsLocationsCatalogsUserEventsPurgeCall{s: r.s, urlParams_: make(gensupport.URLParams)} 15089 c.parent = parent 15090 c.googlecloudretailv2betapurgeusereventsrequest = googlecloudretailv2betapurgeusereventsrequest 15091 return c 15092 } 15093 15094 // Fields allows partial responses to be retrieved. See 15095 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 15096 // details. 15097 func (c *ProjectsLocationsCatalogsUserEventsPurgeCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsUserEventsPurgeCall { 15098 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 15099 return c 15100 } 15101 15102 // Context sets the context to be used in this call's Do method. 15103 func (c *ProjectsLocationsCatalogsUserEventsPurgeCall) Context(ctx context.Context) *ProjectsLocationsCatalogsUserEventsPurgeCall { 15104 c.ctx_ = ctx 15105 return c 15106 } 15107 15108 // Header returns a http.Header that can be modified by the caller to add 15109 // headers to the request. 15110 func (c *ProjectsLocationsCatalogsUserEventsPurgeCall) Header() http.Header { 15111 if c.header_ == nil { 15112 c.header_ = make(http.Header) 15113 } 15114 return c.header_ 15115 } 15116 15117 func (c *ProjectsLocationsCatalogsUserEventsPurgeCall) doRequest(alt string) (*http.Response, error) { 15118 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 15119 var body io.Reader = nil 15120 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betapurgeusereventsrequest) 15121 if err != nil { 15122 return nil, err 15123 } 15124 c.urlParams_.Set("alt", alt) 15125 c.urlParams_.Set("prettyPrint", "false") 15126 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+parent}/userEvents:purge") 15127 urls += "?" + c.urlParams_.Encode() 15128 req, err := http.NewRequest("POST", urls, body) 15129 if err != nil { 15130 return nil, err 15131 } 15132 req.Header = reqHeaders 15133 googleapi.Expand(req.URL, map[string]string{ 15134 "parent": c.parent, 15135 }) 15136 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15137 } 15138 15139 // Do executes the "retail.projects.locations.catalogs.userEvents.purge" call. 15140 // Any non-2xx status code is an error. Response headers are in either 15141 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was 15142 // returned at all) in error.(*googleapi.Error).Header. Use 15143 // googleapi.IsNotModified to check whether the returned error was because 15144 // http.StatusNotModified was returned. 15145 func (c *ProjectsLocationsCatalogsUserEventsPurgeCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 15146 gensupport.SetOptions(c.urlParams_, opts...) 15147 res, err := c.doRequest("json") 15148 if res != nil && res.StatusCode == http.StatusNotModified { 15149 if res.Body != nil { 15150 res.Body.Close() 15151 } 15152 return nil, gensupport.WrapError(&googleapi.Error{ 15153 Code: res.StatusCode, 15154 Header: res.Header, 15155 }) 15156 } 15157 if err != nil { 15158 return nil, err 15159 } 15160 defer googleapi.CloseBody(res) 15161 if err := googleapi.CheckResponse(res); err != nil { 15162 return nil, gensupport.WrapError(err) 15163 } 15164 ret := &GoogleLongrunningOperation{ 15165 ServerResponse: googleapi.ServerResponse{ 15166 Header: res.Header, 15167 HTTPStatusCode: res.StatusCode, 15168 }, 15169 } 15170 target := &ret 15171 if err := gensupport.DecodeResponse(target, res); err != nil { 15172 return nil, err 15173 } 15174 return ret, nil 15175 } 15176 15177 type ProjectsLocationsCatalogsUserEventsRejoinCall struct { 15178 s *Service 15179 parent string 15180 googlecloudretailv2betarejoinusereventsrequest *GoogleCloudRetailV2betaRejoinUserEventsRequest 15181 urlParams_ gensupport.URLParams 15182 ctx_ context.Context 15183 header_ http.Header 15184 } 15185 15186 // Rejoin: Starts a user-event rejoin operation with latest product catalog. 15187 // Events are not annotated with detailed product information for products that 15188 // are missing from the catalog when the user event is ingested. These events 15189 // are stored as unjoined events with limited usage on training and serving. 15190 // You can use this method to start a join operation on specified events with 15191 // the latest version of product catalog. You can also use this method to 15192 // correct events joined with the wrong product catalog. A rejoin operation can 15193 // take hours or days to complete. 15194 // 15195 // - parent: The parent catalog resource name, such as 15196 // `projects/1234/locations/global/catalogs/default_catalog`. 15197 func (r *ProjectsLocationsCatalogsUserEventsService) Rejoin(parent string, googlecloudretailv2betarejoinusereventsrequest *GoogleCloudRetailV2betaRejoinUserEventsRequest) *ProjectsLocationsCatalogsUserEventsRejoinCall { 15198 c := &ProjectsLocationsCatalogsUserEventsRejoinCall{s: r.s, urlParams_: make(gensupport.URLParams)} 15199 c.parent = parent 15200 c.googlecloudretailv2betarejoinusereventsrequest = googlecloudretailv2betarejoinusereventsrequest 15201 return c 15202 } 15203 15204 // Fields allows partial responses to be retrieved. See 15205 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 15206 // details. 15207 func (c *ProjectsLocationsCatalogsUserEventsRejoinCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsUserEventsRejoinCall { 15208 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 15209 return c 15210 } 15211 15212 // Context sets the context to be used in this call's Do method. 15213 func (c *ProjectsLocationsCatalogsUserEventsRejoinCall) Context(ctx context.Context) *ProjectsLocationsCatalogsUserEventsRejoinCall { 15214 c.ctx_ = ctx 15215 return c 15216 } 15217 15218 // Header returns a http.Header that can be modified by the caller to add 15219 // headers to the request. 15220 func (c *ProjectsLocationsCatalogsUserEventsRejoinCall) Header() http.Header { 15221 if c.header_ == nil { 15222 c.header_ = make(http.Header) 15223 } 15224 return c.header_ 15225 } 15226 15227 func (c *ProjectsLocationsCatalogsUserEventsRejoinCall) doRequest(alt string) (*http.Response, error) { 15228 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 15229 var body io.Reader = nil 15230 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betarejoinusereventsrequest) 15231 if err != nil { 15232 return nil, err 15233 } 15234 c.urlParams_.Set("alt", alt) 15235 c.urlParams_.Set("prettyPrint", "false") 15236 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+parent}/userEvents:rejoin") 15237 urls += "?" + c.urlParams_.Encode() 15238 req, err := http.NewRequest("POST", urls, body) 15239 if err != nil { 15240 return nil, err 15241 } 15242 req.Header = reqHeaders 15243 googleapi.Expand(req.URL, map[string]string{ 15244 "parent": c.parent, 15245 }) 15246 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15247 } 15248 15249 // Do executes the "retail.projects.locations.catalogs.userEvents.rejoin" call. 15250 // Any non-2xx status code is an error. Response headers are in either 15251 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was 15252 // returned at all) in error.(*googleapi.Error).Header. Use 15253 // googleapi.IsNotModified to check whether the returned error was because 15254 // http.StatusNotModified was returned. 15255 func (c *ProjectsLocationsCatalogsUserEventsRejoinCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 15256 gensupport.SetOptions(c.urlParams_, opts...) 15257 res, err := c.doRequest("json") 15258 if res != nil && res.StatusCode == http.StatusNotModified { 15259 if res.Body != nil { 15260 res.Body.Close() 15261 } 15262 return nil, gensupport.WrapError(&googleapi.Error{ 15263 Code: res.StatusCode, 15264 Header: res.Header, 15265 }) 15266 } 15267 if err != nil { 15268 return nil, err 15269 } 15270 defer googleapi.CloseBody(res) 15271 if err := googleapi.CheckResponse(res); err != nil { 15272 return nil, gensupport.WrapError(err) 15273 } 15274 ret := &GoogleLongrunningOperation{ 15275 ServerResponse: googleapi.ServerResponse{ 15276 Header: res.Header, 15277 HTTPStatusCode: res.StatusCode, 15278 }, 15279 } 15280 target := &ret 15281 if err := gensupport.DecodeResponse(target, res); err != nil { 15282 return nil, err 15283 } 15284 return ret, nil 15285 } 15286 15287 type ProjectsLocationsCatalogsUserEventsWriteCall struct { 15288 s *Service 15289 parent string 15290 googlecloudretailv2betauserevent *GoogleCloudRetailV2betaUserEvent 15291 urlParams_ gensupport.URLParams 15292 ctx_ context.Context 15293 header_ http.Header 15294 } 15295 15296 // Write: Writes a single user event. 15297 // 15298 // - parent: The parent catalog resource name, such as 15299 // `projects/1234/locations/global/catalogs/default_catalog`. 15300 func (r *ProjectsLocationsCatalogsUserEventsService) Write(parent string, googlecloudretailv2betauserevent *GoogleCloudRetailV2betaUserEvent) *ProjectsLocationsCatalogsUserEventsWriteCall { 15301 c := &ProjectsLocationsCatalogsUserEventsWriteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 15302 c.parent = parent 15303 c.googlecloudretailv2betauserevent = googlecloudretailv2betauserevent 15304 return c 15305 } 15306 15307 // WriteAsync sets the optional parameter "writeAsync": If set to true, the 15308 // user event will be written asynchronously after validation, and the API will 15309 // respond without waiting for the write. Therefore, silent failures can occur 15310 // even if the API returns success. In case of silent failures, error messages 15311 // can be found in Stackdriver logs. 15312 func (c *ProjectsLocationsCatalogsUserEventsWriteCall) WriteAsync(writeAsync bool) *ProjectsLocationsCatalogsUserEventsWriteCall { 15313 c.urlParams_.Set("writeAsync", fmt.Sprint(writeAsync)) 15314 return c 15315 } 15316 15317 // Fields allows partial responses to be retrieved. See 15318 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 15319 // details. 15320 func (c *ProjectsLocationsCatalogsUserEventsWriteCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsUserEventsWriteCall { 15321 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 15322 return c 15323 } 15324 15325 // Context sets the context to be used in this call's Do method. 15326 func (c *ProjectsLocationsCatalogsUserEventsWriteCall) Context(ctx context.Context) *ProjectsLocationsCatalogsUserEventsWriteCall { 15327 c.ctx_ = ctx 15328 return c 15329 } 15330 15331 // Header returns a http.Header that can be modified by the caller to add 15332 // headers to the request. 15333 func (c *ProjectsLocationsCatalogsUserEventsWriteCall) Header() http.Header { 15334 if c.header_ == nil { 15335 c.header_ = make(http.Header) 15336 } 15337 return c.header_ 15338 } 15339 15340 func (c *ProjectsLocationsCatalogsUserEventsWriteCall) doRequest(alt string) (*http.Response, error) { 15341 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 15342 var body io.Reader = nil 15343 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2betauserevent) 15344 if err != nil { 15345 return nil, err 15346 } 15347 c.urlParams_.Set("alt", alt) 15348 c.urlParams_.Set("prettyPrint", "false") 15349 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+parent}/userEvents:write") 15350 urls += "?" + c.urlParams_.Encode() 15351 req, err := http.NewRequest("POST", urls, body) 15352 if err != nil { 15353 return nil, err 15354 } 15355 req.Header = reqHeaders 15356 googleapi.Expand(req.URL, map[string]string{ 15357 "parent": c.parent, 15358 }) 15359 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15360 } 15361 15362 // Do executes the "retail.projects.locations.catalogs.userEvents.write" call. 15363 // Any non-2xx status code is an error. Response headers are in either 15364 // *GoogleCloudRetailV2betaUserEvent.ServerResponse.Header or (if a response 15365 // was returned at all) in error.(*googleapi.Error).Header. Use 15366 // googleapi.IsNotModified to check whether the returned error was because 15367 // http.StatusNotModified was returned. 15368 func (c *ProjectsLocationsCatalogsUserEventsWriteCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2betaUserEvent, error) { 15369 gensupport.SetOptions(c.urlParams_, opts...) 15370 res, err := c.doRequest("json") 15371 if res != nil && res.StatusCode == http.StatusNotModified { 15372 if res.Body != nil { 15373 res.Body.Close() 15374 } 15375 return nil, gensupport.WrapError(&googleapi.Error{ 15376 Code: res.StatusCode, 15377 Header: res.Header, 15378 }) 15379 } 15380 if err != nil { 15381 return nil, err 15382 } 15383 defer googleapi.CloseBody(res) 15384 if err := googleapi.CheckResponse(res); err != nil { 15385 return nil, gensupport.WrapError(err) 15386 } 15387 ret := &GoogleCloudRetailV2betaUserEvent{ 15388 ServerResponse: googleapi.ServerResponse{ 15389 Header: res.Header, 15390 HTTPStatusCode: res.StatusCode, 15391 }, 15392 } 15393 target := &ret 15394 if err := gensupport.DecodeResponse(target, res); err != nil { 15395 return nil, err 15396 } 15397 return ret, nil 15398 } 15399 15400 type ProjectsLocationsOperationsGetCall struct { 15401 s *Service 15402 name string 15403 urlParams_ gensupport.URLParams 15404 ifNoneMatch_ string 15405 ctx_ context.Context 15406 header_ http.Header 15407 } 15408 15409 // Get: Gets the latest state of a long-running operation. Clients can use this 15410 // method to poll the operation result at intervals as recommended by the API 15411 // service. 15412 // 15413 // - name: The name of the operation resource. 15414 func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall { 15415 c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 15416 c.name = name 15417 return c 15418 } 15419 15420 // Fields allows partial responses to be retrieved. See 15421 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 15422 // details. 15423 func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall { 15424 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 15425 return c 15426 } 15427 15428 // IfNoneMatch sets an optional parameter which makes the operation fail if the 15429 // object's ETag matches the given value. This is useful for getting updates 15430 // only after the object has changed since the last request. 15431 func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall { 15432 c.ifNoneMatch_ = entityTag 15433 return c 15434 } 15435 15436 // Context sets the context to be used in this call's Do method. 15437 func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall { 15438 c.ctx_ = ctx 15439 return c 15440 } 15441 15442 // Header returns a http.Header that can be modified by the caller to add 15443 // headers to the request. 15444 func (c *ProjectsLocationsOperationsGetCall) Header() http.Header { 15445 if c.header_ == nil { 15446 c.header_ = make(http.Header) 15447 } 15448 return c.header_ 15449 } 15450 15451 func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) { 15452 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 15453 if c.ifNoneMatch_ != "" { 15454 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 15455 } 15456 var body io.Reader = nil 15457 c.urlParams_.Set("alt", alt) 15458 c.urlParams_.Set("prettyPrint", "false") 15459 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}") 15460 urls += "?" + c.urlParams_.Encode() 15461 req, err := http.NewRequest("GET", urls, body) 15462 if err != nil { 15463 return nil, err 15464 } 15465 req.Header = reqHeaders 15466 googleapi.Expand(req.URL, map[string]string{ 15467 "name": c.name, 15468 }) 15469 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15470 } 15471 15472 // Do executes the "retail.projects.locations.operations.get" call. 15473 // Any non-2xx status code is an error. Response headers are in either 15474 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was 15475 // returned at all) in error.(*googleapi.Error).Header. Use 15476 // googleapi.IsNotModified to check whether the returned error was because 15477 // http.StatusNotModified was returned. 15478 func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 15479 gensupport.SetOptions(c.urlParams_, opts...) 15480 res, err := c.doRequest("json") 15481 if res != nil && res.StatusCode == http.StatusNotModified { 15482 if res.Body != nil { 15483 res.Body.Close() 15484 } 15485 return nil, gensupport.WrapError(&googleapi.Error{ 15486 Code: res.StatusCode, 15487 Header: res.Header, 15488 }) 15489 } 15490 if err != nil { 15491 return nil, err 15492 } 15493 defer googleapi.CloseBody(res) 15494 if err := googleapi.CheckResponse(res); err != nil { 15495 return nil, gensupport.WrapError(err) 15496 } 15497 ret := &GoogleLongrunningOperation{ 15498 ServerResponse: googleapi.ServerResponse{ 15499 Header: res.Header, 15500 HTTPStatusCode: res.StatusCode, 15501 }, 15502 } 15503 target := &ret 15504 if err := gensupport.DecodeResponse(target, res); err != nil { 15505 return nil, err 15506 } 15507 return ret, nil 15508 } 15509 15510 type ProjectsLocationsOperationsListCall struct { 15511 s *Service 15512 name string 15513 urlParams_ gensupport.URLParams 15514 ifNoneMatch_ string 15515 ctx_ context.Context 15516 header_ http.Header 15517 } 15518 15519 // List: Lists operations that match the specified filter in the request. If 15520 // the server doesn't support this method, it returns `UNIMPLEMENTED`. 15521 // 15522 // - name: The name of the operation's parent resource. 15523 func (r *ProjectsLocationsOperationsService) List(name string) *ProjectsLocationsOperationsListCall { 15524 c := &ProjectsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 15525 c.name = name 15526 return c 15527 } 15528 15529 // Filter sets the optional parameter "filter": The standard list filter. 15530 func (c *ProjectsLocationsOperationsListCall) Filter(filter string) *ProjectsLocationsOperationsListCall { 15531 c.urlParams_.Set("filter", filter) 15532 return c 15533 } 15534 15535 // PageSize sets the optional parameter "pageSize": The standard list page 15536 // size. 15537 func (c *ProjectsLocationsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsOperationsListCall { 15538 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 15539 return c 15540 } 15541 15542 // PageToken sets the optional parameter "pageToken": The standard list page 15543 // token. 15544 func (c *ProjectsLocationsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsOperationsListCall { 15545 c.urlParams_.Set("pageToken", pageToken) 15546 return c 15547 } 15548 15549 // Fields allows partial responses to be retrieved. See 15550 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 15551 // details. 15552 func (c *ProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsListCall { 15553 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 15554 return c 15555 } 15556 15557 // IfNoneMatch sets an optional parameter which makes the operation fail if the 15558 // object's ETag matches the given value. This is useful for getting updates 15559 // only after the object has changed since the last request. 15560 func (c *ProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsListCall { 15561 c.ifNoneMatch_ = entityTag 15562 return c 15563 } 15564 15565 // Context sets the context to be used in this call's Do method. 15566 func (c *ProjectsLocationsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsOperationsListCall { 15567 c.ctx_ = ctx 15568 return c 15569 } 15570 15571 // Header returns a http.Header that can be modified by the caller to add 15572 // headers to the request. 15573 func (c *ProjectsLocationsOperationsListCall) Header() http.Header { 15574 if c.header_ == nil { 15575 c.header_ = make(http.Header) 15576 } 15577 return c.header_ 15578 } 15579 15580 func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) { 15581 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 15582 if c.ifNoneMatch_ != "" { 15583 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 15584 } 15585 var body io.Reader = nil 15586 c.urlParams_.Set("alt", alt) 15587 c.urlParams_.Set("prettyPrint", "false") 15588 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}/operations") 15589 urls += "?" + c.urlParams_.Encode() 15590 req, err := http.NewRequest("GET", urls, body) 15591 if err != nil { 15592 return nil, err 15593 } 15594 req.Header = reqHeaders 15595 googleapi.Expand(req.URL, map[string]string{ 15596 "name": c.name, 15597 }) 15598 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15599 } 15600 15601 // Do executes the "retail.projects.locations.operations.list" call. 15602 // Any non-2xx status code is an error. Response headers are in either 15603 // *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if a 15604 // response was returned at all) in error.(*googleapi.Error).Header. Use 15605 // googleapi.IsNotModified to check whether the returned error was because 15606 // http.StatusNotModified was returned. 15607 func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { 15608 gensupport.SetOptions(c.urlParams_, opts...) 15609 res, err := c.doRequest("json") 15610 if res != nil && res.StatusCode == http.StatusNotModified { 15611 if res.Body != nil { 15612 res.Body.Close() 15613 } 15614 return nil, gensupport.WrapError(&googleapi.Error{ 15615 Code: res.StatusCode, 15616 Header: res.Header, 15617 }) 15618 } 15619 if err != nil { 15620 return nil, err 15621 } 15622 defer googleapi.CloseBody(res) 15623 if err := googleapi.CheckResponse(res); err != nil { 15624 return nil, gensupport.WrapError(err) 15625 } 15626 ret := &GoogleLongrunningListOperationsResponse{ 15627 ServerResponse: googleapi.ServerResponse{ 15628 Header: res.Header, 15629 HTTPStatusCode: res.StatusCode, 15630 }, 15631 } 15632 target := &ret 15633 if err := gensupport.DecodeResponse(target, res); err != nil { 15634 return nil, err 15635 } 15636 return ret, nil 15637 } 15638 15639 // Pages invokes f for each page of results. 15640 // A non-nil error returned from f will halt the iteration. 15641 // The provided context supersedes any context provided to the Context method. 15642 func (c *ProjectsLocationsOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { 15643 c.ctx_ = ctx 15644 defer c.PageToken(c.urlParams_.Get("pageToken")) 15645 for { 15646 x, err := c.Do() 15647 if err != nil { 15648 return err 15649 } 15650 if err := f(x); err != nil { 15651 return err 15652 } 15653 if x.NextPageToken == "" { 15654 return nil 15655 } 15656 c.PageToken(x.NextPageToken) 15657 } 15658 } 15659 15660 type ProjectsOperationsGetCall struct { 15661 s *Service 15662 name string 15663 urlParams_ gensupport.URLParams 15664 ifNoneMatch_ string 15665 ctx_ context.Context 15666 header_ http.Header 15667 } 15668 15669 // Get: Gets the latest state of a long-running operation. Clients can use this 15670 // method to poll the operation result at intervals as recommended by the API 15671 // service. 15672 // 15673 // - name: The name of the operation resource. 15674 func (r *ProjectsOperationsService) Get(name string) *ProjectsOperationsGetCall { 15675 c := &ProjectsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 15676 c.name = name 15677 return c 15678 } 15679 15680 // Fields allows partial responses to be retrieved. See 15681 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 15682 // details. 15683 func (c *ProjectsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsOperationsGetCall { 15684 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 15685 return c 15686 } 15687 15688 // IfNoneMatch sets an optional parameter which makes the operation fail if the 15689 // object's ETag matches the given value. This is useful for getting updates 15690 // only after the object has changed since the last request. 15691 func (c *ProjectsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsOperationsGetCall { 15692 c.ifNoneMatch_ = entityTag 15693 return c 15694 } 15695 15696 // Context sets the context to be used in this call's Do method. 15697 func (c *ProjectsOperationsGetCall) Context(ctx context.Context) *ProjectsOperationsGetCall { 15698 c.ctx_ = ctx 15699 return c 15700 } 15701 15702 // Header returns a http.Header that can be modified by the caller to add 15703 // headers to the request. 15704 func (c *ProjectsOperationsGetCall) Header() http.Header { 15705 if c.header_ == nil { 15706 c.header_ = make(http.Header) 15707 } 15708 return c.header_ 15709 } 15710 15711 func (c *ProjectsOperationsGetCall) doRequest(alt string) (*http.Response, error) { 15712 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 15713 if c.ifNoneMatch_ != "" { 15714 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 15715 } 15716 var body io.Reader = nil 15717 c.urlParams_.Set("alt", alt) 15718 c.urlParams_.Set("prettyPrint", "false") 15719 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}") 15720 urls += "?" + c.urlParams_.Encode() 15721 req, err := http.NewRequest("GET", urls, body) 15722 if err != nil { 15723 return nil, err 15724 } 15725 req.Header = reqHeaders 15726 googleapi.Expand(req.URL, map[string]string{ 15727 "name": c.name, 15728 }) 15729 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15730 } 15731 15732 // Do executes the "retail.projects.operations.get" call. 15733 // Any non-2xx status code is an error. Response headers are in either 15734 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was 15735 // returned at all) in error.(*googleapi.Error).Header. Use 15736 // googleapi.IsNotModified to check whether the returned error was because 15737 // http.StatusNotModified was returned. 15738 func (c *ProjectsOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 15739 gensupport.SetOptions(c.urlParams_, opts...) 15740 res, err := c.doRequest("json") 15741 if res != nil && res.StatusCode == http.StatusNotModified { 15742 if res.Body != nil { 15743 res.Body.Close() 15744 } 15745 return nil, gensupport.WrapError(&googleapi.Error{ 15746 Code: res.StatusCode, 15747 Header: res.Header, 15748 }) 15749 } 15750 if err != nil { 15751 return nil, err 15752 } 15753 defer googleapi.CloseBody(res) 15754 if err := googleapi.CheckResponse(res); err != nil { 15755 return nil, gensupport.WrapError(err) 15756 } 15757 ret := &GoogleLongrunningOperation{ 15758 ServerResponse: googleapi.ServerResponse{ 15759 Header: res.Header, 15760 HTTPStatusCode: res.StatusCode, 15761 }, 15762 } 15763 target := &ret 15764 if err := gensupport.DecodeResponse(target, res); err != nil { 15765 return nil, err 15766 } 15767 return ret, nil 15768 } 15769 15770 type ProjectsOperationsListCall struct { 15771 s *Service 15772 name string 15773 urlParams_ gensupport.URLParams 15774 ifNoneMatch_ string 15775 ctx_ context.Context 15776 header_ http.Header 15777 } 15778 15779 // List: Lists operations that match the specified filter in the request. If 15780 // the server doesn't support this method, it returns `UNIMPLEMENTED`. 15781 // 15782 // - name: The name of the operation's parent resource. 15783 func (r *ProjectsOperationsService) List(name string) *ProjectsOperationsListCall { 15784 c := &ProjectsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 15785 c.name = name 15786 return c 15787 } 15788 15789 // Filter sets the optional parameter "filter": The standard list filter. 15790 func (c *ProjectsOperationsListCall) Filter(filter string) *ProjectsOperationsListCall { 15791 c.urlParams_.Set("filter", filter) 15792 return c 15793 } 15794 15795 // PageSize sets the optional parameter "pageSize": The standard list page 15796 // size. 15797 func (c *ProjectsOperationsListCall) PageSize(pageSize int64) *ProjectsOperationsListCall { 15798 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 15799 return c 15800 } 15801 15802 // PageToken sets the optional parameter "pageToken": The standard list page 15803 // token. 15804 func (c *ProjectsOperationsListCall) PageToken(pageToken string) *ProjectsOperationsListCall { 15805 c.urlParams_.Set("pageToken", pageToken) 15806 return c 15807 } 15808 15809 // Fields allows partial responses to be retrieved. See 15810 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 15811 // details. 15812 func (c *ProjectsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsOperationsListCall { 15813 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 15814 return c 15815 } 15816 15817 // IfNoneMatch sets an optional parameter which makes the operation fail if the 15818 // object's ETag matches the given value. This is useful for getting updates 15819 // only after the object has changed since the last request. 15820 func (c *ProjectsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsOperationsListCall { 15821 c.ifNoneMatch_ = entityTag 15822 return c 15823 } 15824 15825 // Context sets the context to be used in this call's Do method. 15826 func (c *ProjectsOperationsListCall) Context(ctx context.Context) *ProjectsOperationsListCall { 15827 c.ctx_ = ctx 15828 return c 15829 } 15830 15831 // Header returns a http.Header that can be modified by the caller to add 15832 // headers to the request. 15833 func (c *ProjectsOperationsListCall) Header() http.Header { 15834 if c.header_ == nil { 15835 c.header_ = make(http.Header) 15836 } 15837 return c.header_ 15838 } 15839 15840 func (c *ProjectsOperationsListCall) doRequest(alt string) (*http.Response, error) { 15841 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 15842 if c.ifNoneMatch_ != "" { 15843 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 15844 } 15845 var body io.Reader = nil 15846 c.urlParams_.Set("alt", alt) 15847 c.urlParams_.Set("prettyPrint", "false") 15848 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}/operations") 15849 urls += "?" + c.urlParams_.Encode() 15850 req, err := http.NewRequest("GET", urls, body) 15851 if err != nil { 15852 return nil, err 15853 } 15854 req.Header = reqHeaders 15855 googleapi.Expand(req.URL, map[string]string{ 15856 "name": c.name, 15857 }) 15858 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15859 } 15860 15861 // Do executes the "retail.projects.operations.list" call. 15862 // Any non-2xx status code is an error. Response headers are in either 15863 // *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if a 15864 // response was returned at all) in error.(*googleapi.Error).Header. Use 15865 // googleapi.IsNotModified to check whether the returned error was because 15866 // http.StatusNotModified was returned. 15867 func (c *ProjectsOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { 15868 gensupport.SetOptions(c.urlParams_, opts...) 15869 res, err := c.doRequest("json") 15870 if res != nil && res.StatusCode == http.StatusNotModified { 15871 if res.Body != nil { 15872 res.Body.Close() 15873 } 15874 return nil, gensupport.WrapError(&googleapi.Error{ 15875 Code: res.StatusCode, 15876 Header: res.Header, 15877 }) 15878 } 15879 if err != nil { 15880 return nil, err 15881 } 15882 defer googleapi.CloseBody(res) 15883 if err := googleapi.CheckResponse(res); err != nil { 15884 return nil, gensupport.WrapError(err) 15885 } 15886 ret := &GoogleLongrunningListOperationsResponse{ 15887 ServerResponse: googleapi.ServerResponse{ 15888 Header: res.Header, 15889 HTTPStatusCode: res.StatusCode, 15890 }, 15891 } 15892 target := &ret 15893 if err := gensupport.DecodeResponse(target, res); err != nil { 15894 return nil, err 15895 } 15896 return ret, nil 15897 } 15898 15899 // Pages invokes f for each page of results. 15900 // A non-nil error returned from f will halt the iteration. 15901 // The provided context supersedes any context provided to the Context method. 15902 func (c *ProjectsOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { 15903 c.ctx_ = ctx 15904 defer c.PageToken(c.urlParams_.Get("pageToken")) 15905 for { 15906 x, err := c.Do() 15907 if err != nil { 15908 return err 15909 } 15910 if err := f(x); err != nil { 15911 return err 15912 } 15913 if x.NextPageToken == "" { 15914 return nil 15915 } 15916 c.PageToken(x.NextPageToken) 15917 } 15918 } 15919