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/v2alpha" 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/v2alpha" 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:v2alpha" 90 const apiName = "retail" 91 const apiVersion = "v2alpha" 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 rs.RetailProject = NewProjectsRetailProjectService(s) 162 return rs 163 } 164 165 type ProjectsService struct { 166 s *Service 167 168 Locations *ProjectsLocationsService 169 170 Operations *ProjectsOperationsService 171 172 RetailProject *ProjectsRetailProjectService 173 } 174 175 func NewProjectsLocationsService(s *Service) *ProjectsLocationsService { 176 rs := &ProjectsLocationsService{s: s} 177 rs.Catalogs = NewProjectsLocationsCatalogsService(s) 178 rs.Operations = NewProjectsLocationsOperationsService(s) 179 return rs 180 } 181 182 type ProjectsLocationsService struct { 183 s *Service 184 185 Catalogs *ProjectsLocationsCatalogsService 186 187 Operations *ProjectsLocationsOperationsService 188 } 189 190 func NewProjectsLocationsCatalogsService(s *Service) *ProjectsLocationsCatalogsService { 191 rs := &ProjectsLocationsCatalogsService{s: s} 192 rs.AttributesConfig = NewProjectsLocationsCatalogsAttributesConfigService(s) 193 rs.Branches = NewProjectsLocationsCatalogsBranchesService(s) 194 rs.CompletionData = NewProjectsLocationsCatalogsCompletionDataService(s) 195 rs.Controls = NewProjectsLocationsCatalogsControlsService(s) 196 rs.MerchantCenterAccountLinks = NewProjectsLocationsCatalogsMerchantCenterAccountLinksService(s) 197 rs.Models = NewProjectsLocationsCatalogsModelsService(s) 198 rs.Operations = NewProjectsLocationsCatalogsOperationsService(s) 199 rs.Placements = NewProjectsLocationsCatalogsPlacementsService(s) 200 rs.ServingConfigs = NewProjectsLocationsCatalogsServingConfigsService(s) 201 rs.UserEvents = NewProjectsLocationsCatalogsUserEventsService(s) 202 return rs 203 } 204 205 type ProjectsLocationsCatalogsService struct { 206 s *Service 207 208 AttributesConfig *ProjectsLocationsCatalogsAttributesConfigService 209 210 Branches *ProjectsLocationsCatalogsBranchesService 211 212 CompletionData *ProjectsLocationsCatalogsCompletionDataService 213 214 Controls *ProjectsLocationsCatalogsControlsService 215 216 MerchantCenterAccountLinks *ProjectsLocationsCatalogsMerchantCenterAccountLinksService 217 218 Models *ProjectsLocationsCatalogsModelsService 219 220 Operations *ProjectsLocationsCatalogsOperationsService 221 222 Placements *ProjectsLocationsCatalogsPlacementsService 223 224 ServingConfigs *ProjectsLocationsCatalogsServingConfigsService 225 226 UserEvents *ProjectsLocationsCatalogsUserEventsService 227 } 228 229 func NewProjectsLocationsCatalogsAttributesConfigService(s *Service) *ProjectsLocationsCatalogsAttributesConfigService { 230 rs := &ProjectsLocationsCatalogsAttributesConfigService{s: s} 231 return rs 232 } 233 234 type ProjectsLocationsCatalogsAttributesConfigService struct { 235 s *Service 236 } 237 238 func NewProjectsLocationsCatalogsBranchesService(s *Service) *ProjectsLocationsCatalogsBranchesService { 239 rs := &ProjectsLocationsCatalogsBranchesService{s: s} 240 rs.Operations = NewProjectsLocationsCatalogsBranchesOperationsService(s) 241 rs.Places = NewProjectsLocationsCatalogsBranchesPlacesService(s) 242 rs.Products = NewProjectsLocationsCatalogsBranchesProductsService(s) 243 return rs 244 } 245 246 type ProjectsLocationsCatalogsBranchesService struct { 247 s *Service 248 249 Operations *ProjectsLocationsCatalogsBranchesOperationsService 250 251 Places *ProjectsLocationsCatalogsBranchesPlacesService 252 253 Products *ProjectsLocationsCatalogsBranchesProductsService 254 } 255 256 func NewProjectsLocationsCatalogsBranchesOperationsService(s *Service) *ProjectsLocationsCatalogsBranchesOperationsService { 257 rs := &ProjectsLocationsCatalogsBranchesOperationsService{s: s} 258 return rs 259 } 260 261 type ProjectsLocationsCatalogsBranchesOperationsService struct { 262 s *Service 263 } 264 265 func NewProjectsLocationsCatalogsBranchesPlacesService(s *Service) *ProjectsLocationsCatalogsBranchesPlacesService { 266 rs := &ProjectsLocationsCatalogsBranchesPlacesService{s: s} 267 rs.Operations = NewProjectsLocationsCatalogsBranchesPlacesOperationsService(s) 268 return rs 269 } 270 271 type ProjectsLocationsCatalogsBranchesPlacesService struct { 272 s *Service 273 274 Operations *ProjectsLocationsCatalogsBranchesPlacesOperationsService 275 } 276 277 func NewProjectsLocationsCatalogsBranchesPlacesOperationsService(s *Service) *ProjectsLocationsCatalogsBranchesPlacesOperationsService { 278 rs := &ProjectsLocationsCatalogsBranchesPlacesOperationsService{s: s} 279 return rs 280 } 281 282 type ProjectsLocationsCatalogsBranchesPlacesOperationsService struct { 283 s *Service 284 } 285 286 func NewProjectsLocationsCatalogsBranchesProductsService(s *Service) *ProjectsLocationsCatalogsBranchesProductsService { 287 rs := &ProjectsLocationsCatalogsBranchesProductsService{s: s} 288 return rs 289 } 290 291 type ProjectsLocationsCatalogsBranchesProductsService struct { 292 s *Service 293 } 294 295 func NewProjectsLocationsCatalogsCompletionDataService(s *Service) *ProjectsLocationsCatalogsCompletionDataService { 296 rs := &ProjectsLocationsCatalogsCompletionDataService{s: s} 297 return rs 298 } 299 300 type ProjectsLocationsCatalogsCompletionDataService struct { 301 s *Service 302 } 303 304 func NewProjectsLocationsCatalogsControlsService(s *Service) *ProjectsLocationsCatalogsControlsService { 305 rs := &ProjectsLocationsCatalogsControlsService{s: s} 306 return rs 307 } 308 309 type ProjectsLocationsCatalogsControlsService struct { 310 s *Service 311 } 312 313 func NewProjectsLocationsCatalogsMerchantCenterAccountLinksService(s *Service) *ProjectsLocationsCatalogsMerchantCenterAccountLinksService { 314 rs := &ProjectsLocationsCatalogsMerchantCenterAccountLinksService{s: s} 315 return rs 316 } 317 318 type ProjectsLocationsCatalogsMerchantCenterAccountLinksService struct { 319 s *Service 320 } 321 322 func NewProjectsLocationsCatalogsModelsService(s *Service) *ProjectsLocationsCatalogsModelsService { 323 rs := &ProjectsLocationsCatalogsModelsService{s: s} 324 return rs 325 } 326 327 type ProjectsLocationsCatalogsModelsService struct { 328 s *Service 329 } 330 331 func NewProjectsLocationsCatalogsOperationsService(s *Service) *ProjectsLocationsCatalogsOperationsService { 332 rs := &ProjectsLocationsCatalogsOperationsService{s: s} 333 return rs 334 } 335 336 type ProjectsLocationsCatalogsOperationsService struct { 337 s *Service 338 } 339 340 func NewProjectsLocationsCatalogsPlacementsService(s *Service) *ProjectsLocationsCatalogsPlacementsService { 341 rs := &ProjectsLocationsCatalogsPlacementsService{s: s} 342 return rs 343 } 344 345 type ProjectsLocationsCatalogsPlacementsService struct { 346 s *Service 347 } 348 349 func NewProjectsLocationsCatalogsServingConfigsService(s *Service) *ProjectsLocationsCatalogsServingConfigsService { 350 rs := &ProjectsLocationsCatalogsServingConfigsService{s: s} 351 return rs 352 } 353 354 type ProjectsLocationsCatalogsServingConfigsService struct { 355 s *Service 356 } 357 358 func NewProjectsLocationsCatalogsUserEventsService(s *Service) *ProjectsLocationsCatalogsUserEventsService { 359 rs := &ProjectsLocationsCatalogsUserEventsService{s: s} 360 return rs 361 } 362 363 type ProjectsLocationsCatalogsUserEventsService struct { 364 s *Service 365 } 366 367 func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService { 368 rs := &ProjectsLocationsOperationsService{s: s} 369 return rs 370 } 371 372 type ProjectsLocationsOperationsService struct { 373 s *Service 374 } 375 376 func NewProjectsOperationsService(s *Service) *ProjectsOperationsService { 377 rs := &ProjectsOperationsService{s: s} 378 return rs 379 } 380 381 type ProjectsOperationsService struct { 382 s *Service 383 } 384 385 func NewProjectsRetailProjectService(s *Service) *ProjectsRetailProjectService { 386 rs := &ProjectsRetailProjectService{s: s} 387 return rs 388 } 389 390 type ProjectsRetailProjectService struct { 391 s *Service 392 } 393 394 // GoogleApiHttpBody: Message that represents an arbitrary HTTP body. It should 395 // only be used for payload formats that can't be represented as JSON, such as 396 // raw binary or an HTML page. This message can be used both in streaming and 397 // non-streaming API methods in the request as well as the response. It can be 398 // used as a top-level request field, which is convenient if one wants to 399 // extract parameters from either the URL or HTTP template into the request 400 // fields and also want access to the raw HTTP body. Example: message 401 // GetResourceRequest { // A unique request id. string request_id = 1; // The 402 // raw HTTP body is bound to this field. google.api.HttpBody http_body = 2; } 403 // service ResourceService { rpc GetResource(GetResourceRequest) returns 404 // (google.api.HttpBody); rpc UpdateResource(google.api.HttpBody) returns 405 // (google.protobuf.Empty); } Example with streaming methods: service 406 // CaldavService { rpc GetCalendar(stream google.api.HttpBody) returns (stream 407 // google.api.HttpBody); rpc UpdateCalendar(stream google.api.HttpBody) returns 408 // (stream google.api.HttpBody); } Use of this type only changes how the 409 // request and response bodies are handled, all other features will continue to 410 // work unchanged. 411 type GoogleApiHttpBody struct { 412 // ContentType: The HTTP Content-Type header value specifying the content type 413 // of the body. 414 ContentType string `json:"contentType,omitempty"` 415 // Data: The HTTP request/response body as raw binary. 416 Data string `json:"data,omitempty"` 417 // Extensions: Application specific response metadata. Must be set in the first 418 // response for streaming APIs. 419 Extensions []googleapi.RawMessage `json:"extensions,omitempty"` 420 421 // ServerResponse contains the HTTP response code and headers from the server. 422 googleapi.ServerResponse `json:"-"` 423 // ForceSendFields is a list of field names (e.g. "ContentType") to 424 // unconditionally include in API requests. By default, fields with empty or 425 // default values are omitted from API requests. See 426 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 427 // details. 428 ForceSendFields []string `json:"-"` 429 // NullFields is a list of field names (e.g. "ContentType") to include in API 430 // requests with the JSON null value. By default, fields with empty values are 431 // omitted from API requests. See 432 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 433 NullFields []string `json:"-"` 434 } 435 436 func (s *GoogleApiHttpBody) MarshalJSON() ([]byte, error) { 437 type NoMethod GoogleApiHttpBody 438 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 439 } 440 441 // GoogleCloudRetailLoggingErrorContext: A description of the context in which 442 // an error occurred. 443 type GoogleCloudRetailLoggingErrorContext struct { 444 // HttpRequest: The HTTP request which was processed when the error was 445 // triggered. 446 HttpRequest *GoogleCloudRetailLoggingHttpRequestContext `json:"httpRequest,omitempty"` 447 // ReportLocation: The location in the source code where the decision was made 448 // to report the error, usually the place where it was logged. 449 ReportLocation *GoogleCloudRetailLoggingSourceLocation `json:"reportLocation,omitempty"` 450 // ForceSendFields is a list of field names (e.g. "HttpRequest") to 451 // unconditionally include in API requests. By default, fields with empty or 452 // default values are omitted from API requests. See 453 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 454 // details. 455 ForceSendFields []string `json:"-"` 456 // NullFields is a list of field names (e.g. "HttpRequest") to include in API 457 // requests with the JSON null value. By default, fields with empty values are 458 // omitted from API requests. See 459 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 460 NullFields []string `json:"-"` 461 } 462 463 func (s *GoogleCloudRetailLoggingErrorContext) MarshalJSON() ([]byte, error) { 464 type NoMethod GoogleCloudRetailLoggingErrorContext 465 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 466 } 467 468 // GoogleCloudRetailLoggingErrorLog: An error log which is reported to the 469 // Error Reporting system. This proto a superset of 470 // google.devtools.clouderrorreporting.v1beta1.ReportedErrorEvent. 471 type GoogleCloudRetailLoggingErrorLog struct { 472 // Context: A description of the context in which the error occurred. 473 Context *GoogleCloudRetailLoggingErrorContext `json:"context,omitempty"` 474 // ImportPayload: The error payload that is populated on LRO import APIs. 475 ImportPayload *GoogleCloudRetailLoggingImportErrorContext `json:"importPayload,omitempty"` 476 // Message: A message describing the error. 477 Message string `json:"message,omitempty"` 478 // RequestPayload: The API request payload, represented as a protocol buffer. 479 // Most API request types are supported. For example: 480 // "type.googleapis.com/google.cloud.retail.v2.ProductService.CreateProductReque 481 // st" 482 // "type.googleapis.com/google.cloud.retail.v2.UserEventService.WriteUserEventRe 483 // quest" 484 RequestPayload googleapi.RawMessage `json:"requestPayload,omitempty"` 485 // ResponsePayload: The API response payload, represented as a protocol buffer. 486 // This is used to log some "soft errors", where the response is valid but we 487 // consider there are some quality issues like unjoined events. The following 488 // API responses are supported and no PII is included: 489 // "google.cloud.retail.v2.PredictionService.Predict" 490 // "google.cloud.retail.v2.UserEventService.WriteUserEvent" 491 // "google.cloud.retail.v2.UserEventService.CollectUserEvent" 492 ResponsePayload googleapi.RawMessage `json:"responsePayload,omitempty"` 493 // ServiceContext: The service context in which this error has occurred. 494 ServiceContext *GoogleCloudRetailLoggingServiceContext `json:"serviceContext,omitempty"` 495 // Status: The RPC status associated with the error log. 496 Status *GoogleRpcStatus `json:"status,omitempty"` 497 // ForceSendFields is a list of field names (e.g. "Context") to unconditionally 498 // include in API requests. By default, fields with empty or default values are 499 // omitted from API requests. See 500 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 501 // details. 502 ForceSendFields []string `json:"-"` 503 // NullFields is a list of field names (e.g. "Context") to include in API 504 // requests with the JSON null value. By default, fields with empty values are 505 // omitted from API requests. See 506 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 507 NullFields []string `json:"-"` 508 } 509 510 func (s *GoogleCloudRetailLoggingErrorLog) MarshalJSON() ([]byte, error) { 511 type NoMethod GoogleCloudRetailLoggingErrorLog 512 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 513 } 514 515 // GoogleCloudRetailLoggingHttpRequestContext: HTTP request data that is 516 // related to a reported error. 517 type GoogleCloudRetailLoggingHttpRequestContext struct { 518 // ResponseStatusCode: The HTTP response status code for the request. 519 ResponseStatusCode int64 `json:"responseStatusCode,omitempty"` 520 // ForceSendFields is a list of field names (e.g. "ResponseStatusCode") to 521 // unconditionally include in API requests. By default, fields with empty or 522 // default values are omitted from API requests. See 523 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 524 // details. 525 ForceSendFields []string `json:"-"` 526 // NullFields is a list of field names (e.g. "ResponseStatusCode") to include 527 // in API requests with the JSON null value. By default, fields with empty 528 // values are omitted from API requests. See 529 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 530 NullFields []string `json:"-"` 531 } 532 533 func (s *GoogleCloudRetailLoggingHttpRequestContext) MarshalJSON() ([]byte, error) { 534 type NoMethod GoogleCloudRetailLoggingHttpRequestContext 535 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 536 } 537 538 // GoogleCloudRetailLoggingImportErrorContext: The error payload that is 539 // populated on LRO import APIs, including 540 // "google.cloud.retail.v2.ProductService.ImportProducts" and 541 // "google.cloud.retail.v2.EventService.ImportUserEvents". 542 type GoogleCloudRetailLoggingImportErrorContext struct { 543 // CatalogItem: The detailed content which caused the error on importing a 544 // catalog item. 545 CatalogItem string `json:"catalogItem,omitempty"` 546 // GcsPath: Cloud Storage file path of the import source. Can be set for batch 547 // operation error. 548 GcsPath string `json:"gcsPath,omitempty"` 549 // LineNumber: Line number of the content in file. Should be empty for 550 // permission or batch operation error. 551 LineNumber string `json:"lineNumber,omitempty"` 552 // OperationName: The operation resource name of the LRO. 553 OperationName string `json:"operationName,omitempty"` 554 // Product: The detailed content which caused the error on importing a product. 555 Product string `json:"product,omitempty"` 556 // UserEvent: The detailed content which caused the error on importing a user 557 // event. 558 UserEvent string `json:"userEvent,omitempty"` 559 // ForceSendFields is a list of field names (e.g. "CatalogItem") to 560 // unconditionally include in API requests. By default, fields with empty or 561 // default values are omitted from API requests. See 562 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 563 // details. 564 ForceSendFields []string `json:"-"` 565 // NullFields is a list of field names (e.g. "CatalogItem") to include in API 566 // requests with the JSON null value. By default, fields with empty values are 567 // omitted from API requests. See 568 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 569 NullFields []string `json:"-"` 570 } 571 572 func (s *GoogleCloudRetailLoggingImportErrorContext) MarshalJSON() ([]byte, error) { 573 type NoMethod GoogleCloudRetailLoggingImportErrorContext 574 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 575 } 576 577 // GoogleCloudRetailLoggingServiceContext: Describes a running service that 578 // sends errors. 579 type GoogleCloudRetailLoggingServiceContext struct { 580 // Service: An identifier of the service. For example, "retail.googleapis.com". 581 Service string `json:"service,omitempty"` 582 // ForceSendFields is a list of field names (e.g. "Service") to unconditionally 583 // include in API requests. By default, fields with empty or default values are 584 // omitted from API requests. See 585 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 586 // details. 587 ForceSendFields []string `json:"-"` 588 // NullFields is a list of field names (e.g. "Service") to include in API 589 // requests with the JSON null value. By default, fields with empty values are 590 // omitted from API requests. See 591 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 592 NullFields []string `json:"-"` 593 } 594 595 func (s *GoogleCloudRetailLoggingServiceContext) MarshalJSON() ([]byte, error) { 596 type NoMethod GoogleCloudRetailLoggingServiceContext 597 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 598 } 599 600 // GoogleCloudRetailLoggingSourceLocation: Indicates a location in the source 601 // code of the service for which errors are reported. 602 type GoogleCloudRetailLoggingSourceLocation struct { 603 // FunctionName: Human-readable name of a function or method. For example, 604 // "google.cloud.retail.v2.UserEventService.ImportUserEvents". 605 FunctionName string `json:"functionName,omitempty"` 606 // ForceSendFields is a list of field names (e.g. "FunctionName") to 607 // unconditionally include in API requests. By default, fields with empty or 608 // default values are omitted from API requests. See 609 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 610 // details. 611 ForceSendFields []string `json:"-"` 612 // NullFields is a list of field names (e.g. "FunctionName") to include in API 613 // requests with the JSON null value. By default, fields with empty values are 614 // omitted from API requests. See 615 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 616 NullFields []string `json:"-"` 617 } 618 619 func (s *GoogleCloudRetailLoggingSourceLocation) MarshalJSON() ([]byte, error) { 620 type NoMethod GoogleCloudRetailLoggingSourceLocation 621 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 622 } 623 624 // GoogleCloudRetailV2AddFulfillmentPlacesMetadata: Metadata related to the 625 // progress of the AddFulfillmentPlaces operation. Currently empty because 626 // there is no meaningful metadata populated from the 627 // ProductService.AddFulfillmentPlaces method. 628 type GoogleCloudRetailV2AddFulfillmentPlacesMetadata struct { 629 } 630 631 // GoogleCloudRetailV2AddFulfillmentPlacesResponse: Response of the 632 // AddFulfillmentPlacesRequest. Currently empty because there is no meaningful 633 // response populated from the ProductService.AddFulfillmentPlaces method. 634 type GoogleCloudRetailV2AddFulfillmentPlacesResponse struct { 635 } 636 637 // GoogleCloudRetailV2AddLocalInventoriesMetadata: Metadata related to the 638 // progress of the AddLocalInventories operation. Currently empty because there 639 // is no meaningful metadata populated from the 640 // ProductService.AddLocalInventories method. 641 type GoogleCloudRetailV2AddLocalInventoriesMetadata struct { 642 } 643 644 // GoogleCloudRetailV2AddLocalInventoriesResponse: Response of the 645 // ProductService.AddLocalInventories API. Currently empty because there is no 646 // meaningful response populated from the ProductService.AddLocalInventories 647 // method. 648 type GoogleCloudRetailV2AddLocalInventoriesResponse struct { 649 } 650 651 // GoogleCloudRetailV2BigQueryOutputResult: A BigQuery output result. 652 type GoogleCloudRetailV2BigQueryOutputResult struct { 653 // DatasetId: The ID of a BigQuery Dataset. 654 DatasetId string `json:"datasetId,omitempty"` 655 // TableId: The ID of a BigQuery Table. 656 TableId string `json:"tableId,omitempty"` 657 // ForceSendFields is a list of field names (e.g. "DatasetId") to 658 // unconditionally include in API requests. By default, fields with empty or 659 // default values are omitted from API requests. See 660 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 661 // details. 662 ForceSendFields []string `json:"-"` 663 // NullFields is a list of field names (e.g. "DatasetId") to include in API 664 // requests with the JSON null value. By default, fields with empty values are 665 // omitted from API requests. See 666 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 667 NullFields []string `json:"-"` 668 } 669 670 func (s *GoogleCloudRetailV2BigQueryOutputResult) MarshalJSON() ([]byte, error) { 671 type NoMethod GoogleCloudRetailV2BigQueryOutputResult 672 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 673 } 674 675 // GoogleCloudRetailV2CreateModelMetadata: Metadata associated with a create 676 // operation. 677 type GoogleCloudRetailV2CreateModelMetadata struct { 678 // Model: The resource name of the model that this create applies to. Format: 679 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/mode 680 // ls/{model_id}` 681 Model string `json:"model,omitempty"` 682 // ForceSendFields is a list of field names (e.g. "Model") to unconditionally 683 // include in API requests. By default, fields with empty or default values are 684 // omitted from API requests. See 685 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 686 // details. 687 ForceSendFields []string `json:"-"` 688 // NullFields is a list of field names (e.g. "Model") to include in API 689 // requests with the JSON null value. By default, fields with empty values are 690 // omitted from API requests. See 691 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 692 NullFields []string `json:"-"` 693 } 694 695 func (s *GoogleCloudRetailV2CreateModelMetadata) MarshalJSON() ([]byte, error) { 696 type NoMethod GoogleCloudRetailV2CreateModelMetadata 697 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 698 } 699 700 // GoogleCloudRetailV2ExportAnalyticsMetricsResponse: Response of the 701 // ExportAnalyticsMetricsRequest. If the long running operation was successful, 702 // then this message is returned by the google.longrunning.Operations.response 703 // field if the operation was successful. 704 type GoogleCloudRetailV2ExportAnalyticsMetricsResponse struct { 705 // ErrorSamples: A sample of errors encountered while processing the request. 706 ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` 707 // ErrorsConfig: This field is never set. 708 ErrorsConfig *GoogleCloudRetailV2ExportErrorsConfig `json:"errorsConfig,omitempty"` 709 // OutputResult: Output result indicating where the data were exported to. 710 OutputResult *GoogleCloudRetailV2OutputResult `json:"outputResult,omitempty"` 711 // ForceSendFields is a list of field names (e.g. "ErrorSamples") to 712 // unconditionally include in API requests. By default, fields with empty or 713 // default values are omitted from API requests. See 714 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 715 // details. 716 ForceSendFields []string `json:"-"` 717 // NullFields is a list of field names (e.g. "ErrorSamples") to include in API 718 // requests with the JSON null value. By default, fields with empty values are 719 // omitted from API requests. See 720 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 721 NullFields []string `json:"-"` 722 } 723 724 func (s *GoogleCloudRetailV2ExportAnalyticsMetricsResponse) MarshalJSON() ([]byte, error) { 725 type NoMethod GoogleCloudRetailV2ExportAnalyticsMetricsResponse 726 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 727 } 728 729 // GoogleCloudRetailV2ExportErrorsConfig: Configuration of destination for 730 // Export related errors. 731 type GoogleCloudRetailV2ExportErrorsConfig struct { 732 // GcsPrefix: Google Cloud Storage path for import errors. This must be an 733 // empty, existing Cloud Storage bucket. Export errors will be written to a 734 // file in this bucket, one per line, as a JSON-encoded `google.rpc.Status` 735 // message. 736 GcsPrefix string `json:"gcsPrefix,omitempty"` 737 // ForceSendFields is a list of field names (e.g. "GcsPrefix") to 738 // unconditionally include in API requests. By default, fields with empty or 739 // default values are omitted from API requests. See 740 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 741 // details. 742 ForceSendFields []string `json:"-"` 743 // NullFields is a list of field names (e.g. "GcsPrefix") to include in API 744 // requests with the JSON null value. By default, fields with empty values are 745 // omitted from API requests. See 746 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 747 NullFields []string `json:"-"` 748 } 749 750 func (s *GoogleCloudRetailV2ExportErrorsConfig) MarshalJSON() ([]byte, error) { 751 type NoMethod GoogleCloudRetailV2ExportErrorsConfig 752 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 753 } 754 755 // GoogleCloudRetailV2ExportMetadata: Metadata related to the progress of the 756 // Export operation. This is returned by the 757 // google.longrunning.Operation.metadata field. 758 type GoogleCloudRetailV2ExportMetadata struct { 759 // CreateTime: Operation create time. 760 CreateTime string `json:"createTime,omitempty"` 761 // UpdateTime: Operation last update time. If the operation is done, this is 762 // also the finish time. 763 UpdateTime string `json:"updateTime,omitempty"` 764 // ForceSendFields is a list of field names (e.g. "CreateTime") to 765 // unconditionally include in API requests. By default, fields with empty or 766 // default values are omitted from API requests. See 767 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 768 // details. 769 ForceSendFields []string `json:"-"` 770 // NullFields is a list of field names (e.g. "CreateTime") to include in API 771 // requests with the JSON null value. By default, fields with empty values are 772 // omitted from API requests. See 773 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 774 NullFields []string `json:"-"` 775 } 776 777 func (s *GoogleCloudRetailV2ExportMetadata) MarshalJSON() ([]byte, error) { 778 type NoMethod GoogleCloudRetailV2ExportMetadata 779 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 780 } 781 782 // GoogleCloudRetailV2GcsOutputResult: A Gcs output result. 783 type GoogleCloudRetailV2GcsOutputResult struct { 784 // OutputUri: The uri of Gcs output 785 OutputUri string `json:"outputUri,omitempty"` 786 // ForceSendFields is a list of field names (e.g. "OutputUri") to 787 // unconditionally include in API requests. By default, fields with empty or 788 // default values are omitted from API requests. See 789 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 790 // details. 791 ForceSendFields []string `json:"-"` 792 // NullFields is a list of field names (e.g. "OutputUri") to include in API 793 // requests with the JSON null value. By default, fields with empty values are 794 // omitted from API requests. See 795 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 796 NullFields []string `json:"-"` 797 } 798 799 func (s *GoogleCloudRetailV2GcsOutputResult) MarshalJSON() ([]byte, error) { 800 type NoMethod GoogleCloudRetailV2GcsOutputResult 801 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 802 } 803 804 // GoogleCloudRetailV2ImportCompletionDataResponse: Response of the 805 // ImportCompletionDataRequest. If the long running operation is done, this 806 // message is returned by the google.longrunning.Operations.response field if 807 // the operation is successful. 808 type GoogleCloudRetailV2ImportCompletionDataResponse struct { 809 // ErrorSamples: A sample of errors encountered while processing the request. 810 ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` 811 // ForceSendFields is a list of field names (e.g. "ErrorSamples") to 812 // unconditionally include in API requests. By default, fields with empty or 813 // default values are omitted from API requests. See 814 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 815 // details. 816 ForceSendFields []string `json:"-"` 817 // NullFields is a list of field names (e.g. "ErrorSamples") to include in API 818 // requests with the JSON null value. By default, fields with empty values are 819 // omitted from API requests. See 820 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 821 NullFields []string `json:"-"` 822 } 823 824 func (s *GoogleCloudRetailV2ImportCompletionDataResponse) MarshalJSON() ([]byte, error) { 825 type NoMethod GoogleCloudRetailV2ImportCompletionDataResponse 826 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 827 } 828 829 // GoogleCloudRetailV2ImportErrorsConfig: Configuration of destination for 830 // Import related errors. 831 type GoogleCloudRetailV2ImportErrorsConfig struct { 832 // GcsPrefix: Google Cloud Storage prefix for import errors. This must be an 833 // empty, existing Cloud Storage directory. Import errors are written to 834 // sharded files in this directory, one per line, as a JSON-encoded 835 // `google.rpc.Status` message. 836 GcsPrefix string `json:"gcsPrefix,omitempty"` 837 // ForceSendFields is a list of field names (e.g. "GcsPrefix") to 838 // unconditionally include in API requests. By default, fields with empty or 839 // default values are omitted from API requests. See 840 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 841 // details. 842 ForceSendFields []string `json:"-"` 843 // NullFields is a list of field names (e.g. "GcsPrefix") to include in API 844 // requests with the JSON null value. By default, fields with empty values are 845 // omitted from API requests. See 846 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 847 NullFields []string `json:"-"` 848 } 849 850 func (s *GoogleCloudRetailV2ImportErrorsConfig) MarshalJSON() ([]byte, error) { 851 type NoMethod GoogleCloudRetailV2ImportErrorsConfig 852 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 853 } 854 855 // GoogleCloudRetailV2ImportMetadata: Metadata related to the progress of the 856 // Import operation. This is returned by the 857 // google.longrunning.Operation.metadata field. 858 type GoogleCloudRetailV2ImportMetadata struct { 859 // CreateTime: Operation create time. 860 CreateTime string `json:"createTime,omitempty"` 861 // FailureCount: Count of entries that encountered errors while processing. 862 FailureCount int64 `json:"failureCount,omitempty,string"` 863 // NotificationPubsubTopic: Pub/Sub topic for receiving notification. If this 864 // field is set, when the import is finished, a notification is sent to 865 // specified Pub/Sub topic. The message data is JSON string of a Operation. 866 // Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. 867 NotificationPubsubTopic string `json:"notificationPubsubTopic,omitempty"` 868 // RequestId: Deprecated. This field is never set. 869 RequestId string `json:"requestId,omitempty"` 870 // SuccessCount: Count of entries that were processed successfully. 871 SuccessCount int64 `json:"successCount,omitempty,string"` 872 // UpdateTime: Operation last update time. If the operation is done, this is 873 // also the finish time. 874 UpdateTime string `json:"updateTime,omitempty"` 875 // ForceSendFields is a list of field names (e.g. "CreateTime") to 876 // unconditionally include in API requests. By default, fields with empty or 877 // default values are omitted from API requests. See 878 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 879 // details. 880 ForceSendFields []string `json:"-"` 881 // NullFields is a list of field names (e.g. "CreateTime") to include in API 882 // requests with the JSON null value. By default, fields with empty values are 883 // omitted from API requests. See 884 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 885 NullFields []string `json:"-"` 886 } 887 888 func (s *GoogleCloudRetailV2ImportMetadata) MarshalJSON() ([]byte, error) { 889 type NoMethod GoogleCloudRetailV2ImportMetadata 890 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 891 } 892 893 // GoogleCloudRetailV2ImportProductsResponse: Response of the 894 // ImportProductsRequest. If the long running operation is done, then this 895 // message is returned by the google.longrunning.Operations.response field if 896 // the operation was successful. 897 type GoogleCloudRetailV2ImportProductsResponse struct { 898 // ErrorSamples: A sample of errors encountered while processing the request. 899 ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` 900 // ErrorsConfig: Echoes the destination for the complete errors in the request 901 // if set. 902 ErrorsConfig *GoogleCloudRetailV2ImportErrorsConfig `json:"errorsConfig,omitempty"` 903 // ForceSendFields is a list of field names (e.g. "ErrorSamples") to 904 // unconditionally include in API requests. By default, fields with empty or 905 // default values are omitted from API requests. See 906 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 907 // details. 908 ForceSendFields []string `json:"-"` 909 // NullFields is a list of field names (e.g. "ErrorSamples") to include in API 910 // requests with the JSON null value. By default, fields with empty values are 911 // omitted from API requests. See 912 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 913 NullFields []string `json:"-"` 914 } 915 916 func (s *GoogleCloudRetailV2ImportProductsResponse) MarshalJSON() ([]byte, error) { 917 type NoMethod GoogleCloudRetailV2ImportProductsResponse 918 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 919 } 920 921 // GoogleCloudRetailV2ImportUserEventsResponse: Response of the 922 // ImportUserEventsRequest. If the long running operation was successful, then 923 // this message is returned by the google.longrunning.Operations.response field 924 // if the operation was successful. 925 type GoogleCloudRetailV2ImportUserEventsResponse struct { 926 // ErrorSamples: A sample of errors encountered while processing the request. 927 ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` 928 // ErrorsConfig: Echoes the destination for the complete errors if this field 929 // was set in the request. 930 ErrorsConfig *GoogleCloudRetailV2ImportErrorsConfig `json:"errorsConfig,omitempty"` 931 // ImportSummary: Aggregated statistics of user event import status. 932 ImportSummary *GoogleCloudRetailV2UserEventImportSummary `json:"importSummary,omitempty"` 933 // ForceSendFields is a list of field names (e.g. "ErrorSamples") to 934 // unconditionally include in API requests. By default, fields with empty or 935 // default values are omitted from API requests. See 936 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 937 // details. 938 ForceSendFields []string `json:"-"` 939 // NullFields is a list of field names (e.g. "ErrorSamples") to include in API 940 // requests with the JSON null value. By default, fields with empty values are 941 // omitted from API requests. See 942 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 943 NullFields []string `json:"-"` 944 } 945 946 func (s *GoogleCloudRetailV2ImportUserEventsResponse) MarshalJSON() ([]byte, error) { 947 type NoMethod GoogleCloudRetailV2ImportUserEventsResponse 948 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 949 } 950 951 // GoogleCloudRetailV2Model: Metadata that describes the training and serving 952 // parameters of a Model. A Model can be associated with a ServingConfig and 953 // then queried through the Predict API. 954 type GoogleCloudRetailV2Model struct { 955 // CreateTime: Output only. Timestamp the Recommendation Model was created at. 956 CreateTime string `json:"createTime,omitempty"` 957 // DataState: Output only. The state of data requirements for this model: 958 // `DATA_OK` and `DATA_ERROR`. Recommendation model cannot be trained if the 959 // data is in `DATA_ERROR` state. Recommendation model can have `DATA_ERROR` 960 // state even if serving state is `ACTIVE`: models were trained successfully 961 // before, but cannot be refreshed because model no longer has sufficient data 962 // for training. 963 // 964 // Possible values: 965 // "DATA_STATE_UNSPECIFIED" - Unspecified default value, should never be 966 // explicitly set. 967 // "DATA_OK" - The model has sufficient training data. 968 // "DATA_ERROR" - The model does not have sufficient training data. Error 969 // messages can be queried via Stackdriver. 970 DataState string `json:"dataState,omitempty"` 971 // DisplayName: Required. The display name of the model. Should be human 972 // readable, used to display Recommendation Models in the Retail Cloud Console 973 // Dashboard. UTF-8 encoded string with limit of 1024 characters. 974 DisplayName string `json:"displayName,omitempty"` 975 // FilteringOption: Optional. If `RECOMMENDATIONS_FILTERING_ENABLED`, 976 // recommendation filtering by attributes is enabled for the model. 977 // 978 // Possible values: 979 // "RECOMMENDATIONS_FILTERING_OPTION_UNSPECIFIED" - Value used when unset. In 980 // this case, server behavior defaults to RECOMMENDATIONS_FILTERING_DISABLED. 981 // "RECOMMENDATIONS_FILTERING_DISABLED" - Recommendation filtering is 982 // disabled. 983 // "RECOMMENDATIONS_FILTERING_ENABLED" - Recommendation filtering is enabled. 984 FilteringOption string `json:"filteringOption,omitempty"` 985 // LastTuneTime: Output only. The timestamp when the latest successful tune 986 // finished. 987 LastTuneTime string `json:"lastTuneTime,omitempty"` 988 // ModelFeaturesConfig: Optional. Additional model features config. 989 ModelFeaturesConfig *GoogleCloudRetailV2ModelModelFeaturesConfig `json:"modelFeaturesConfig,omitempty"` 990 // Name: Required. The fully qualified resource name of the model. Format: 991 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/mode 992 // ls/{model_id}` catalog_id has char limit of 50. recommendation_model_id has 993 // char limit of 40. 994 Name string `json:"name,omitempty"` 995 // OptimizationObjective: Optional. The optimization objective e.g. `cvr`. 996 // Currently supported values: `ctr`, `cvr`, `revenue-per-order`. If not 997 // specified, we choose default based on model type. Default depends on type of 998 // recommendation: `recommended-for-you` => `ctr` `others-you-may-like` => 999 // `ctr` `frequently-bought-together` => `revenue_per_order` This field 1000 // together with optimization_objective describe model metadata to use to 1001 // control model training and serving. See 1002 // https://cloud.google.com/retail/docs/models for more details on what the 1003 // model metadata control and which combination of parameters are valid. For 1004 // invalid combinations of parameters (e.g. type = `frequently-bought-together` 1005 // and optimization_objective = `ctr`), you receive an error 400 if you try to 1006 // create/update a recommendation with this set of knobs. 1007 OptimizationObjective string `json:"optimizationObjective,omitempty"` 1008 // PeriodicTuningState: Optional. The state of periodic tuning. The period we 1009 // use is 3 months - to do a one-off tune earlier use the `TuneModel` method. 1010 // Default value is `PERIODIC_TUNING_ENABLED`. 1011 // 1012 // Possible values: 1013 // "PERIODIC_TUNING_STATE_UNSPECIFIED" - Unspecified default value, should 1014 // never be explicitly set. 1015 // "PERIODIC_TUNING_DISABLED" - The model has periodic tuning disabled. 1016 // Tuning can be reenabled by calling the `EnableModelPeriodicTuning` method or 1017 // by calling the `TuneModel` method. 1018 // "ALL_TUNING_DISABLED" - The model cannot be tuned with periodic tuning OR 1019 // the `TuneModel` method. Hide the options in customer UI and reject any 1020 // requests through the backend self serve API. 1021 // "PERIODIC_TUNING_ENABLED" - The model has periodic tuning enabled. Tuning 1022 // can be disabled by calling the `DisableModelPeriodicTuning` method. 1023 PeriodicTuningState string `json:"periodicTuningState,omitempty"` 1024 // ServingConfigLists: Output only. The list of valid serving configs 1025 // associated with the PageOptimizationConfig. 1026 ServingConfigLists []*GoogleCloudRetailV2ModelServingConfigList `json:"servingConfigLists,omitempty"` 1027 // ServingState: Output only. The serving state of the model: `ACTIVE`, 1028 // `NOT_ACTIVE`. 1029 // 1030 // Possible values: 1031 // "SERVING_STATE_UNSPECIFIED" - Unspecified serving state. 1032 // "INACTIVE" - The model is not serving. 1033 // "ACTIVE" - The model is serving and can be queried. 1034 // "TUNED" - The model is trained on tuned hyperparameters and can be 1035 // queried. 1036 ServingState string `json:"servingState,omitempty"` 1037 // TrainingState: Optional. The training state that the model is in (e.g. 1038 // `TRAINING` or `PAUSED`). Since part of the cost of running the service is 1039 // frequency of training - this can be used to determine when to train model in 1040 // order to control cost. If not specified: the default value for `CreateModel` 1041 // method is `TRAINING`. The default value for `UpdateModel` method is to keep 1042 // the state the same as before. 1043 // 1044 // Possible values: 1045 // "TRAINING_STATE_UNSPECIFIED" - Unspecified training state. 1046 // "PAUSED" - The model training is paused. 1047 // "TRAINING" - The model is training. 1048 TrainingState string `json:"trainingState,omitempty"` 1049 // TuningOperation: Output only. The tune operation associated with the model. 1050 // Can be used to determine if there is an ongoing tune for this 1051 // recommendation. Empty field implies no tune is goig on. 1052 TuningOperation string `json:"tuningOperation,omitempty"` 1053 // Type: Required. The type of model e.g. `home-page`. Currently supported 1054 // values: `recommended-for-you`, `others-you-may-like`, 1055 // `frequently-bought-together`, `page-optimization`, `similar-items`, 1056 // `buy-it-again`, `on-sale-items`, and `recently-viewed`(readonly value). This 1057 // field together with optimization_objective describe model metadata to use to 1058 // control model training and serving. See 1059 // https://cloud.google.com/retail/docs/models for more details on what the 1060 // model metadata control and which combination of parameters are valid. For 1061 // invalid combinations of parameters (e.g. type = `frequently-bought-together` 1062 // and optimization_objective = `ctr`), you receive an error 400 if you try to 1063 // create/update a recommendation with this set of knobs. 1064 Type string `json:"type,omitempty"` 1065 // UpdateTime: Output only. Timestamp the Recommendation Model was last 1066 // updated. E.g. if a Recommendation Model was paused - this would be the time 1067 // the pause was initiated. 1068 UpdateTime string `json:"updateTime,omitempty"` 1069 // ForceSendFields is a list of field names (e.g. "CreateTime") to 1070 // unconditionally include in API requests. By default, fields with empty or 1071 // default values are omitted from API requests. See 1072 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1073 // details. 1074 ForceSendFields []string `json:"-"` 1075 // NullFields is a list of field names (e.g. "CreateTime") to include in API 1076 // requests with the JSON null value. By default, fields with empty values are 1077 // omitted from API requests. See 1078 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1079 NullFields []string `json:"-"` 1080 } 1081 1082 func (s *GoogleCloudRetailV2Model) MarshalJSON() ([]byte, error) { 1083 type NoMethod GoogleCloudRetailV2Model 1084 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1085 } 1086 1087 // GoogleCloudRetailV2ModelFrequentlyBoughtTogetherFeaturesConfig: Additional 1088 // configs for the frequently-bought-together model type. 1089 type GoogleCloudRetailV2ModelFrequentlyBoughtTogetherFeaturesConfig struct { 1090 // ContextProductsType: Optional. Specifies the context of the model when it is 1091 // used in predict requests. Can only be set for the 1092 // `frequently-bought-together` type. If it isn't specified, it defaults to 1093 // MULTIPLE_CONTEXT_PRODUCTS. 1094 // 1095 // Possible values: 1096 // "CONTEXT_PRODUCTS_TYPE_UNSPECIFIED" - Unspecified default value, should 1097 // never be explicitly set. Defaults to MULTIPLE_CONTEXT_PRODUCTS. 1098 // "SINGLE_CONTEXT_PRODUCT" - Use only a single product as context for the 1099 // recommendation. Typically used on pages like add-to-cart or product details. 1100 // "MULTIPLE_CONTEXT_PRODUCTS" - Use one or multiple products as context for 1101 // the recommendation. Typically used on shopping cart pages. 1102 ContextProductsType string `json:"contextProductsType,omitempty"` 1103 // ForceSendFields is a list of field names (e.g. "ContextProductsType") to 1104 // unconditionally include in API requests. By default, fields with empty or 1105 // default values are omitted from API requests. See 1106 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1107 // details. 1108 ForceSendFields []string `json:"-"` 1109 // NullFields is a list of field names (e.g. "ContextProductsType") to include 1110 // in API requests with the JSON null value. By default, fields with empty 1111 // values are omitted from API requests. See 1112 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1113 NullFields []string `json:"-"` 1114 } 1115 1116 func (s *GoogleCloudRetailV2ModelFrequentlyBoughtTogetherFeaturesConfig) MarshalJSON() ([]byte, error) { 1117 type NoMethod GoogleCloudRetailV2ModelFrequentlyBoughtTogetherFeaturesConfig 1118 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1119 } 1120 1121 // GoogleCloudRetailV2ModelModelFeaturesConfig: Additional model features 1122 // config. 1123 type GoogleCloudRetailV2ModelModelFeaturesConfig struct { 1124 // FrequentlyBoughtTogetherConfig: Additional configs for 1125 // frequently-bought-together models. 1126 FrequentlyBoughtTogetherConfig *GoogleCloudRetailV2ModelFrequentlyBoughtTogetherFeaturesConfig `json:"frequentlyBoughtTogetherConfig,omitempty"` 1127 // ForceSendFields is a list of field names (e.g. 1128 // "FrequentlyBoughtTogetherConfig") to unconditionally include in API 1129 // requests. By default, fields with empty or default values are omitted from 1130 // API requests. See 1131 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1132 // details. 1133 ForceSendFields []string `json:"-"` 1134 // NullFields is a list of field names (e.g. "FrequentlyBoughtTogetherConfig") 1135 // to include in API requests with the JSON null value. By default, fields with 1136 // empty values are omitted from API requests. See 1137 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1138 NullFields []string `json:"-"` 1139 } 1140 1141 func (s *GoogleCloudRetailV2ModelModelFeaturesConfig) MarshalJSON() ([]byte, error) { 1142 type NoMethod GoogleCloudRetailV2ModelModelFeaturesConfig 1143 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1144 } 1145 1146 // GoogleCloudRetailV2ModelServingConfigList: Represents an ordered combination 1147 // of valid serving configs, which can be used for `PAGE_OPTIMIZATION` 1148 // recommendations. 1149 type GoogleCloudRetailV2ModelServingConfigList struct { 1150 // ServingConfigIds: Optional. A set of valid serving configs that may be used 1151 // for `PAGE_OPTIMIZATION`. 1152 ServingConfigIds []string `json:"servingConfigIds,omitempty"` 1153 // ForceSendFields is a list of field names (e.g. "ServingConfigIds") to 1154 // unconditionally include in API requests. By default, fields with empty or 1155 // default values are omitted from API requests. See 1156 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1157 // details. 1158 ForceSendFields []string `json:"-"` 1159 // NullFields is a list of field names (e.g. "ServingConfigIds") to include in 1160 // API requests with the JSON null value. By default, fields with empty values 1161 // are omitted from API requests. See 1162 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1163 NullFields []string `json:"-"` 1164 } 1165 1166 func (s *GoogleCloudRetailV2ModelServingConfigList) MarshalJSON() ([]byte, error) { 1167 type NoMethod GoogleCloudRetailV2ModelServingConfigList 1168 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1169 } 1170 1171 // GoogleCloudRetailV2OutputResult: Output result that stores the information 1172 // about where the exported data is stored. 1173 type GoogleCloudRetailV2OutputResult struct { 1174 // BigqueryResult: The BigQuery location where the result is stored. 1175 BigqueryResult []*GoogleCloudRetailV2BigQueryOutputResult `json:"bigqueryResult,omitempty"` 1176 // GcsResult: The Google Cloud Storage location where the result is stored. 1177 GcsResult []*GoogleCloudRetailV2GcsOutputResult `json:"gcsResult,omitempty"` 1178 // ForceSendFields is a list of field names (e.g. "BigqueryResult") to 1179 // unconditionally include in API requests. By default, fields with empty or 1180 // default values are omitted from API requests. See 1181 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1182 // details. 1183 ForceSendFields []string `json:"-"` 1184 // NullFields is a list of field names (e.g. "BigqueryResult") to include in 1185 // API requests with the JSON null value. By default, fields with empty values 1186 // are omitted from API requests. See 1187 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1188 NullFields []string `json:"-"` 1189 } 1190 1191 func (s *GoogleCloudRetailV2OutputResult) MarshalJSON() ([]byte, error) { 1192 type NoMethod GoogleCloudRetailV2OutputResult 1193 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1194 } 1195 1196 // GoogleCloudRetailV2PurgeMetadata: Metadata related to the progress of the 1197 // Purge operation. This will be returned by the 1198 // google.longrunning.Operation.metadata field. 1199 type GoogleCloudRetailV2PurgeMetadata struct { 1200 } 1201 1202 // GoogleCloudRetailV2PurgeProductsMetadata: Metadata related to the progress 1203 // of the PurgeProducts operation. This will be returned by the 1204 // google.longrunning.Operation.metadata field. 1205 type GoogleCloudRetailV2PurgeProductsMetadata struct { 1206 // CreateTime: Operation create time. 1207 CreateTime string `json:"createTime,omitempty"` 1208 // FailureCount: Count of entries that encountered errors while processing. 1209 FailureCount int64 `json:"failureCount,omitempty,string"` 1210 // SuccessCount: Count of entries that were deleted successfully. 1211 SuccessCount int64 `json:"successCount,omitempty,string"` 1212 // UpdateTime: Operation last update time. If the operation is done, this is 1213 // also the finish time. 1214 UpdateTime string `json:"updateTime,omitempty"` 1215 // ForceSendFields is a list of field names (e.g. "CreateTime") to 1216 // unconditionally include in API requests. By default, fields with empty or 1217 // default values are omitted from API requests. See 1218 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1219 // details. 1220 ForceSendFields []string `json:"-"` 1221 // NullFields is a list of field names (e.g. "CreateTime") to include in API 1222 // requests with the JSON null value. By default, fields with empty values are 1223 // omitted from API requests. See 1224 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1225 NullFields []string `json:"-"` 1226 } 1227 1228 func (s *GoogleCloudRetailV2PurgeProductsMetadata) MarshalJSON() ([]byte, error) { 1229 type NoMethod GoogleCloudRetailV2PurgeProductsMetadata 1230 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1231 } 1232 1233 // GoogleCloudRetailV2PurgeProductsResponse: Response of the 1234 // PurgeProductsRequest. If the long running operation is successfully done, 1235 // then this message is returned by the google.longrunning.Operations.response 1236 // field. 1237 type GoogleCloudRetailV2PurgeProductsResponse struct { 1238 // PurgeCount: The total count of products purged as a result of the operation. 1239 PurgeCount int64 `json:"purgeCount,omitempty,string"` 1240 // PurgeSample: A sample of the product names that will be deleted. Only 1241 // populated if `force` is set to false. A max of 100 names will be returned 1242 // and the names are chosen at random. 1243 PurgeSample []string `json:"purgeSample,omitempty"` 1244 // ForceSendFields is a list of field names (e.g. "PurgeCount") to 1245 // unconditionally include in API requests. By default, fields with empty or 1246 // default values are omitted from API requests. See 1247 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1248 // details. 1249 ForceSendFields []string `json:"-"` 1250 // NullFields is a list of field names (e.g. "PurgeCount") to include in API 1251 // requests with the JSON null value. By default, fields with empty values are 1252 // omitted from API requests. See 1253 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1254 NullFields []string `json:"-"` 1255 } 1256 1257 func (s *GoogleCloudRetailV2PurgeProductsResponse) MarshalJSON() ([]byte, error) { 1258 type NoMethod GoogleCloudRetailV2PurgeProductsResponse 1259 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1260 } 1261 1262 // GoogleCloudRetailV2PurgeUserEventsResponse: Response of the 1263 // PurgeUserEventsRequest. If the long running operation is successfully done, 1264 // then this message is returned by the google.longrunning.Operations.response 1265 // field. 1266 type GoogleCloudRetailV2PurgeUserEventsResponse struct { 1267 // PurgedEventsCount: The total count of events purged as a result of the 1268 // operation. 1269 PurgedEventsCount int64 `json:"purgedEventsCount,omitempty,string"` 1270 // ForceSendFields is a list of field names (e.g. "PurgedEventsCount") to 1271 // unconditionally include in API requests. By default, fields with empty or 1272 // default values are omitted from API requests. See 1273 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1274 // details. 1275 ForceSendFields []string `json:"-"` 1276 // NullFields is a list of field names (e.g. "PurgedEventsCount") to include in 1277 // API requests with the JSON null value. By default, fields with empty values 1278 // are omitted from API requests. See 1279 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1280 NullFields []string `json:"-"` 1281 } 1282 1283 func (s *GoogleCloudRetailV2PurgeUserEventsResponse) MarshalJSON() ([]byte, error) { 1284 type NoMethod GoogleCloudRetailV2PurgeUserEventsResponse 1285 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1286 } 1287 1288 // GoogleCloudRetailV2RejoinUserEventsMetadata: Metadata for `RejoinUserEvents` 1289 // method. 1290 type GoogleCloudRetailV2RejoinUserEventsMetadata struct { 1291 } 1292 1293 // GoogleCloudRetailV2RejoinUserEventsResponse: Response message for 1294 // `RejoinUserEvents` method. 1295 type GoogleCloudRetailV2RejoinUserEventsResponse struct { 1296 // RejoinedUserEventsCount: Number of user events that were joined with latest 1297 // product catalog. 1298 RejoinedUserEventsCount int64 `json:"rejoinedUserEventsCount,omitempty,string"` 1299 // ForceSendFields is a list of field names (e.g. "RejoinedUserEventsCount") to 1300 // unconditionally include in API requests. By default, fields with empty or 1301 // default values are omitted from API requests. See 1302 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1303 // details. 1304 ForceSendFields []string `json:"-"` 1305 // NullFields is a list of field names (e.g. "RejoinedUserEventsCount") to 1306 // include in API requests with the JSON null value. By default, fields with 1307 // empty values are omitted from API requests. See 1308 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1309 NullFields []string `json:"-"` 1310 } 1311 1312 func (s *GoogleCloudRetailV2RejoinUserEventsResponse) MarshalJSON() ([]byte, error) { 1313 type NoMethod GoogleCloudRetailV2RejoinUserEventsResponse 1314 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1315 } 1316 1317 // GoogleCloudRetailV2RemoveFulfillmentPlacesMetadata: Metadata related to the 1318 // progress of the RemoveFulfillmentPlaces operation. Currently empty because 1319 // there is no meaningful metadata populated from the 1320 // ProductService.RemoveFulfillmentPlaces method. 1321 type GoogleCloudRetailV2RemoveFulfillmentPlacesMetadata struct { 1322 } 1323 1324 // GoogleCloudRetailV2RemoveFulfillmentPlacesResponse: Response of the 1325 // RemoveFulfillmentPlacesRequest. Currently empty because there is no 1326 // meaningful response populated from the 1327 // ProductService.RemoveFulfillmentPlaces method. 1328 type GoogleCloudRetailV2RemoveFulfillmentPlacesResponse struct { 1329 } 1330 1331 // GoogleCloudRetailV2RemoveLocalInventoriesMetadata: Metadata related to the 1332 // progress of the RemoveLocalInventories operation. Currently empty because 1333 // there is no meaningful metadata populated from the 1334 // ProductService.RemoveLocalInventories method. 1335 type GoogleCloudRetailV2RemoveLocalInventoriesMetadata struct { 1336 } 1337 1338 // GoogleCloudRetailV2RemoveLocalInventoriesResponse: Response of the 1339 // ProductService.RemoveLocalInventories API. Currently empty because there is 1340 // no meaningful response populated from the 1341 // ProductService.RemoveLocalInventories method. 1342 type GoogleCloudRetailV2RemoveLocalInventoriesResponse struct { 1343 } 1344 1345 // GoogleCloudRetailV2SetInventoryMetadata: Metadata related to the progress of 1346 // the SetInventory operation. Currently empty because there is no meaningful 1347 // metadata populated from the ProductService.SetInventory method. 1348 type GoogleCloudRetailV2SetInventoryMetadata struct { 1349 } 1350 1351 // GoogleCloudRetailV2SetInventoryResponse: Response of the 1352 // SetInventoryRequest. Currently empty because there is no meaningful response 1353 // populated from the ProductService.SetInventory method. 1354 type GoogleCloudRetailV2SetInventoryResponse struct { 1355 } 1356 1357 // GoogleCloudRetailV2TuneModelMetadata: Metadata associated with a tune 1358 // operation. 1359 type GoogleCloudRetailV2TuneModelMetadata struct { 1360 // Model: The resource name of the model that this tune applies to. Format: 1361 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/mode 1362 // ls/{model_id}` 1363 Model string `json:"model,omitempty"` 1364 // ForceSendFields is a list of field names (e.g. "Model") to unconditionally 1365 // include in API requests. By default, fields with empty or default values are 1366 // omitted from API requests. See 1367 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1368 // details. 1369 ForceSendFields []string `json:"-"` 1370 // NullFields is a list of field names (e.g. "Model") to include in API 1371 // requests with the JSON null value. By default, fields with empty values are 1372 // omitted from API requests. See 1373 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1374 NullFields []string `json:"-"` 1375 } 1376 1377 func (s *GoogleCloudRetailV2TuneModelMetadata) MarshalJSON() ([]byte, error) { 1378 type NoMethod GoogleCloudRetailV2TuneModelMetadata 1379 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1380 } 1381 1382 // GoogleCloudRetailV2TuneModelResponse: Response associated with a tune 1383 // operation. 1384 type GoogleCloudRetailV2TuneModelResponse struct { 1385 } 1386 1387 // GoogleCloudRetailV2UserEventImportSummary: A summary of import result. The 1388 // UserEventImportSummary summarizes the import status for user events. 1389 type GoogleCloudRetailV2UserEventImportSummary struct { 1390 // JoinedEventsCount: Count of user events imported with complete existing 1391 // catalog information. 1392 JoinedEventsCount int64 `json:"joinedEventsCount,omitempty,string"` 1393 // UnjoinedEventsCount: Count of user events imported, but with catalog 1394 // information not found in the imported catalog. 1395 UnjoinedEventsCount int64 `json:"unjoinedEventsCount,omitempty,string"` 1396 // ForceSendFields is a list of field names (e.g. "JoinedEventsCount") to 1397 // unconditionally include in API requests. By default, fields with empty or 1398 // default values are omitted from API requests. See 1399 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1400 // details. 1401 ForceSendFields []string `json:"-"` 1402 // NullFields is a list of field names (e.g. "JoinedEventsCount") to include in 1403 // API requests with the JSON null value. By default, fields with empty values 1404 // are omitted from API requests. See 1405 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1406 NullFields []string `json:"-"` 1407 } 1408 1409 func (s *GoogleCloudRetailV2UserEventImportSummary) MarshalJSON() ([]byte, error) { 1410 type NoMethod GoogleCloudRetailV2UserEventImportSummary 1411 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1412 } 1413 1414 // GoogleCloudRetailV2alphaAcceptTermsRequest: Request for AcceptTerms method. 1415 type GoogleCloudRetailV2alphaAcceptTermsRequest struct { 1416 } 1417 1418 // GoogleCloudRetailV2alphaAddCatalogAttributeRequest: Request for 1419 // CatalogService.AddCatalogAttribute method. 1420 type GoogleCloudRetailV2alphaAddCatalogAttributeRequest struct { 1421 // CatalogAttribute: Required. The CatalogAttribute to add. 1422 CatalogAttribute *GoogleCloudRetailV2alphaCatalogAttribute `json:"catalogAttribute,omitempty"` 1423 // ForceSendFields is a list of field names (e.g. "CatalogAttribute") to 1424 // unconditionally include in API requests. By default, fields with empty or 1425 // default values are omitted from API requests. See 1426 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1427 // details. 1428 ForceSendFields []string `json:"-"` 1429 // NullFields is a list of field names (e.g. "CatalogAttribute") to include in 1430 // API requests with the JSON null value. By default, fields with empty values 1431 // are omitted from API requests. See 1432 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1433 NullFields []string `json:"-"` 1434 } 1435 1436 func (s *GoogleCloudRetailV2alphaAddCatalogAttributeRequest) MarshalJSON() ([]byte, error) { 1437 type NoMethod GoogleCloudRetailV2alphaAddCatalogAttributeRequest 1438 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1439 } 1440 1441 // GoogleCloudRetailV2alphaAddControlRequest: Request for AddControl method. 1442 type GoogleCloudRetailV2alphaAddControlRequest struct { 1443 // ControlId: Required. The id of the control to apply. Assumed to be in the 1444 // same catalog as the serving config - if id is not found a NOT_FOUND error is 1445 // returned. 1446 ControlId string `json:"controlId,omitempty"` 1447 // ForceSendFields is a list of field names (e.g. "ControlId") to 1448 // unconditionally include in API requests. By default, fields with empty or 1449 // default values are omitted from API requests. See 1450 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1451 // details. 1452 ForceSendFields []string `json:"-"` 1453 // NullFields is a list of field names (e.g. "ControlId") to include in API 1454 // requests with the JSON null value. By default, fields with empty values are 1455 // omitted from API requests. See 1456 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1457 NullFields []string `json:"-"` 1458 } 1459 1460 func (s *GoogleCloudRetailV2alphaAddControlRequest) MarshalJSON() ([]byte, error) { 1461 type NoMethod GoogleCloudRetailV2alphaAddControlRequest 1462 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1463 } 1464 1465 // GoogleCloudRetailV2alphaAddFulfillmentPlacesMetadata: Metadata related to 1466 // the progress of the AddFulfillmentPlaces operation. Currently empty because 1467 // there is no meaningful metadata populated from the 1468 // ProductService.AddFulfillmentPlaces method. 1469 type GoogleCloudRetailV2alphaAddFulfillmentPlacesMetadata struct { 1470 } 1471 1472 // GoogleCloudRetailV2alphaAddFulfillmentPlacesRequest: Request message for 1473 // ProductService.AddFulfillmentPlaces method. 1474 type GoogleCloudRetailV2alphaAddFulfillmentPlacesRequest struct { 1475 // AddTime: The time when the fulfillment updates are issued, used to prevent 1476 // out-of-order updates on fulfillment information. If not provided, the 1477 // internal system time will be used. 1478 AddTime string `json:"addTime,omitempty"` 1479 // AllowMissing: If set to true, and the Product is not found, the fulfillment 1480 // information will still be processed and retained for at most 1 day and 1481 // processed once the Product is created. If set to false, a NOT_FOUND error is 1482 // returned if the Product is not found. 1483 AllowMissing bool `json:"allowMissing,omitempty"` 1484 // PlaceIds: Required. The IDs for this type, such as the store IDs for 1485 // "pickup-in-store" or the region IDs for "same-day-delivery" to be added for 1486 // this type. Duplicate IDs will be automatically ignored. At least 1 value is 1487 // required, and a maximum of 2000 values are allowed. Each value must be a 1488 // string with a length limit of 10 characters, matching the pattern 1489 // `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an 1490 // INVALID_ARGUMENT error is returned. If the total number of place IDs exceeds 1491 // 2000 for this type after adding, then the update will be rejected. 1492 PlaceIds []string `json:"placeIds,omitempty"` 1493 // Type: Required. The fulfillment type, including commonly used types (such as 1494 // pickup in store and same day delivery), and custom types. Supported values: 1495 // * "pickup-in-store" * "ship-to-store" * "same-day-delivery" * 1496 // "next-day-delivery" * "custom-type-1" * "custom-type-2" * "custom-type-3" * 1497 // "custom-type-4" * "custom-type-5" If this field is set to an invalid value 1498 // other than these, an INVALID_ARGUMENT error is returned. This field directly 1499 // corresponds to Product.fulfillment_info.type. 1500 Type string `json:"type,omitempty"` 1501 // ForceSendFields is a list of field names (e.g. "AddTime") to unconditionally 1502 // include in API requests. By default, fields with empty or default values are 1503 // omitted from API requests. See 1504 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1505 // details. 1506 ForceSendFields []string `json:"-"` 1507 // NullFields is a list of field names (e.g. "AddTime") to include in API 1508 // requests with the JSON null value. By default, fields with empty values are 1509 // omitted from API requests. See 1510 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1511 NullFields []string `json:"-"` 1512 } 1513 1514 func (s *GoogleCloudRetailV2alphaAddFulfillmentPlacesRequest) MarshalJSON() ([]byte, error) { 1515 type NoMethod GoogleCloudRetailV2alphaAddFulfillmentPlacesRequest 1516 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1517 } 1518 1519 // GoogleCloudRetailV2alphaAddFulfillmentPlacesResponse: Response of the 1520 // AddFulfillmentPlacesRequest. Currently empty because there is no meaningful 1521 // response populated from the ProductService.AddFulfillmentPlaces method. 1522 type GoogleCloudRetailV2alphaAddFulfillmentPlacesResponse struct { 1523 } 1524 1525 // GoogleCloudRetailV2alphaAddLocalInventoriesMetadata: Metadata related to the 1526 // progress of the AddLocalInventories operation. Currently empty because there 1527 // is no meaningful metadata populated from the 1528 // ProductService.AddLocalInventories method. 1529 type GoogleCloudRetailV2alphaAddLocalInventoriesMetadata struct { 1530 } 1531 1532 // GoogleCloudRetailV2alphaAddLocalInventoriesRequest: Request message for 1533 // ProductService.AddLocalInventories method. 1534 type GoogleCloudRetailV2alphaAddLocalInventoriesRequest struct { 1535 // AddMask: Indicates which inventory fields in the provided list of 1536 // LocalInventory to update. The field is updated to the provided value. If a 1537 // field is set while the place does not have a previous local inventory, the 1538 // local inventory at that store is created. If a field is set while the value 1539 // of that field is not provided, the original field value, if it exists, is 1540 // deleted. If the mask is not set or set with empty paths, all inventory 1541 // fields will be updated. If an unsupported or unknown field is provided, an 1542 // INVALID_ARGUMENT error is returned and the entire update will be ignored. 1543 AddMask string `json:"addMask,omitempty"` 1544 // AddTime: The time when the inventory updates are issued. Used to prevent 1545 // out-of-order updates on local inventory fields. If not provided, the 1546 // internal system time will be used. 1547 AddTime string `json:"addTime,omitempty"` 1548 // AllowMissing: If set to true, and the Product is not found, the local 1549 // inventory will still be processed and retained for at most 1 day and 1550 // processed once the Product is created. If set to false, a NOT_FOUND error is 1551 // returned if the Product is not found. 1552 AllowMissing bool `json:"allowMissing,omitempty"` 1553 // LocalInventories: Required. A list of inventory information at difference 1554 // places. Each place is identified by its place ID. At most 3000 inventories 1555 // are allowed per request. 1556 LocalInventories []*GoogleCloudRetailV2alphaLocalInventory `json:"localInventories,omitempty"` 1557 // ForceSendFields is a list of field names (e.g. "AddMask") to unconditionally 1558 // include in API requests. By default, fields with empty or default values are 1559 // omitted from API requests. See 1560 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1561 // details. 1562 ForceSendFields []string `json:"-"` 1563 // NullFields is a list of field names (e.g. "AddMask") to include in API 1564 // requests with the JSON null value. By default, fields with empty values are 1565 // omitted from API requests. See 1566 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1567 NullFields []string `json:"-"` 1568 } 1569 1570 func (s *GoogleCloudRetailV2alphaAddLocalInventoriesRequest) MarshalJSON() ([]byte, error) { 1571 type NoMethod GoogleCloudRetailV2alphaAddLocalInventoriesRequest 1572 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1573 } 1574 1575 // GoogleCloudRetailV2alphaAddLocalInventoriesResponse: Response of the 1576 // ProductService.AddLocalInventories API. Currently empty because there is no 1577 // meaningful response populated from the ProductService.AddLocalInventories 1578 // method. 1579 type GoogleCloudRetailV2alphaAddLocalInventoriesResponse struct { 1580 } 1581 1582 // GoogleCloudRetailV2alphaAlertConfig: Project level alert config. 1583 type GoogleCloudRetailV2alphaAlertConfig struct { 1584 // AlertPolicies: Alert policies for a customer. They must be unique by 1585 // [AlertPolicy.alert_group] 1586 AlertPolicies []*GoogleCloudRetailV2alphaAlertConfigAlertPolicy `json:"alertPolicies,omitempty"` 1587 // Name: Required. Immutable. The name of the AlertConfig singleton resource. 1588 // Format: projects/*/alertConfig 1589 Name string `json:"name,omitempty"` 1590 1591 // ServerResponse contains the HTTP response code and headers from the server. 1592 googleapi.ServerResponse `json:"-"` 1593 // ForceSendFields is a list of field names (e.g. "AlertPolicies") to 1594 // unconditionally include in API requests. By default, fields with empty or 1595 // default values are omitted from API requests. See 1596 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1597 // details. 1598 ForceSendFields []string `json:"-"` 1599 // NullFields is a list of field names (e.g. "AlertPolicies") to include in API 1600 // requests with the JSON null value. By default, fields with empty values are 1601 // omitted from API requests. See 1602 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1603 NullFields []string `json:"-"` 1604 } 1605 1606 func (s *GoogleCloudRetailV2alphaAlertConfig) MarshalJSON() ([]byte, error) { 1607 type NoMethod GoogleCloudRetailV2alphaAlertConfig 1608 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1609 } 1610 1611 // GoogleCloudRetailV2alphaAlertConfigAlertPolicy: Alert policy for a customer. 1612 type GoogleCloudRetailV2alphaAlertConfigAlertPolicy struct { 1613 // AlertGroup: The feature that provides alerting capability. Supported value 1614 // is only `search-data-quality` for now. 1615 AlertGroup string `json:"alertGroup,omitempty"` 1616 // EnrollStatus: The enrollment status of a customer. 1617 // 1618 // Possible values: 1619 // "ENROLL_STATUS_UNSPECIFIED" - Default value. Used for customers who have 1620 // not responded to the alert policy. 1621 // "ENROLLED" - Customer is enrolled in this policy. 1622 // "DECLINED" - Customer declined this policy. 1623 EnrollStatus string `json:"enrollStatus,omitempty"` 1624 // Recipients: Recipients for the alert policy. One alert policy should not 1625 // exceed 20 recipients. 1626 Recipients []*GoogleCloudRetailV2alphaAlertConfigAlertPolicyRecipient `json:"recipients,omitempty"` 1627 // ForceSendFields is a list of field names (e.g. "AlertGroup") to 1628 // unconditionally include in API requests. By default, fields with empty or 1629 // default values are omitted from API requests. See 1630 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1631 // details. 1632 ForceSendFields []string `json:"-"` 1633 // NullFields is a list of field names (e.g. "AlertGroup") to include in API 1634 // requests with the JSON null value. By default, fields with empty values are 1635 // omitted from API requests. See 1636 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1637 NullFields []string `json:"-"` 1638 } 1639 1640 func (s *GoogleCloudRetailV2alphaAlertConfigAlertPolicy) MarshalJSON() ([]byte, error) { 1641 type NoMethod GoogleCloudRetailV2alphaAlertConfigAlertPolicy 1642 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1643 } 1644 1645 // GoogleCloudRetailV2alphaAlertConfigAlertPolicyRecipient: Recipient contact 1646 // information. 1647 type GoogleCloudRetailV2alphaAlertConfigAlertPolicyRecipient struct { 1648 // EmailAddress: Email address of the recipient. 1649 EmailAddress string `json:"emailAddress,omitempty"` 1650 // ForceSendFields is a list of field names (e.g. "EmailAddress") to 1651 // unconditionally include in API requests. By default, fields with empty or 1652 // default values are omitted from API requests. See 1653 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1654 // details. 1655 ForceSendFields []string `json:"-"` 1656 // NullFields is a list of field names (e.g. "EmailAddress") to include in API 1657 // requests with the JSON null value. By default, fields with empty values are 1658 // omitted from API requests. See 1659 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1660 NullFields []string `json:"-"` 1661 } 1662 1663 func (s *GoogleCloudRetailV2alphaAlertConfigAlertPolicyRecipient) MarshalJSON() ([]byte, error) { 1664 type NoMethod GoogleCloudRetailV2alphaAlertConfigAlertPolicyRecipient 1665 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1666 } 1667 1668 // GoogleCloudRetailV2alphaAttributesConfig: Catalog level attribute config. 1669 type GoogleCloudRetailV2alphaAttributesConfig struct { 1670 // AttributeConfigLevel: Output only. The AttributeConfigLevel used for this 1671 // catalog. 1672 // 1673 // Possible values: 1674 // "ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED" - Value used when unset. In this 1675 // case, server behavior defaults to CATALOG_LEVEL_ATTRIBUTE_CONFIG. 1676 // "PRODUCT_LEVEL_ATTRIBUTE_CONFIG" - At this level, we honor the attribute 1677 // configurations set in Product.attributes. 1678 // "CATALOG_LEVEL_ATTRIBUTE_CONFIG" - At this level, we honor the attribute 1679 // configurations set in CatalogConfig.attribute_configs. 1680 AttributeConfigLevel string `json:"attributeConfigLevel,omitempty"` 1681 // CatalogAttributes: Enable attribute(s) config at catalog level. For example, 1682 // indexable, dynamic_facetable, or searchable for each attribute. The key is 1683 // catalog attribute's name. For example: `color`, `brands`, 1684 // `attributes.custom_attribute`, such as `attributes.xyz`. The maximum number 1685 // of catalog attributes allowed in a request is 1000. 1686 CatalogAttributes map[string]GoogleCloudRetailV2alphaCatalogAttribute `json:"catalogAttributes,omitempty"` 1687 // Name: Required. Immutable. The fully qualified resource name of the 1688 // attribute config. Format: 1689 // `projects/*/locations/*/catalogs/*/attributesConfig` 1690 Name string `json:"name,omitempty"` 1691 1692 // ServerResponse contains the HTTP response code and headers from the server. 1693 googleapi.ServerResponse `json:"-"` 1694 // ForceSendFields is a list of field names (e.g. "AttributeConfigLevel") to 1695 // unconditionally include in API requests. By default, fields with empty or 1696 // default values are omitted from API requests. See 1697 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1698 // details. 1699 ForceSendFields []string `json:"-"` 1700 // NullFields is a list of field names (e.g. "AttributeConfigLevel") to include 1701 // in API requests with the JSON null value. By default, fields with empty 1702 // values are omitted from API requests. See 1703 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1704 NullFields []string `json:"-"` 1705 } 1706 1707 func (s *GoogleCloudRetailV2alphaAttributesConfig) MarshalJSON() ([]byte, error) { 1708 type NoMethod GoogleCloudRetailV2alphaAttributesConfig 1709 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1710 } 1711 1712 // GoogleCloudRetailV2alphaAudience: An intended audience of the Product for 1713 // whom it's sold. 1714 type GoogleCloudRetailV2alphaAudience struct { 1715 // AgeGroups: The age groups of the audience. Strongly encouraged to use the 1716 // standard values: "newborn" (up to 3 months old), "infant" (3–12 months 1717 // old), "toddler" (1–5 years old), "kids" (5–13 years old), "adult" 1718 // (typically teens or older). At most 5 values are allowed. Each value must be 1719 // a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an 1720 // INVALID_ARGUMENT error is returned. Google Merchant Center property 1721 // age_group (https://support.google.com/merchants/answer/6324463). Schema.org 1722 // property Product.audience.suggestedMinAge 1723 // (https://schema.org/suggestedMinAge) and Product.audience.suggestedMaxAge 1724 // (https://schema.org/suggestedMaxAge). 1725 AgeGroups []string `json:"ageGroups,omitempty"` 1726 // Genders: The genders of the audience. Strongly encouraged to use the 1727 // standard values: "male", "female", "unisex". At most 5 values are allowed. 1728 // Each value must be a UTF-8 encoded string with a length limit of 128 1729 // characters. Otherwise, an INVALID_ARGUMENT error is returned. Google 1730 // Merchant Center property gender 1731 // (https://support.google.com/merchants/answer/6324479). Schema.org property 1732 // Product.audience.suggestedGender (https://schema.org/suggestedGender). 1733 Genders []string `json:"genders,omitempty"` 1734 // ForceSendFields is a list of field names (e.g. "AgeGroups") to 1735 // unconditionally include in API requests. By default, fields with empty or 1736 // default values are omitted from API requests. See 1737 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1738 // details. 1739 ForceSendFields []string `json:"-"` 1740 // NullFields is a list of field names (e.g. "AgeGroups") to include in API 1741 // requests with the JSON null value. By default, fields with empty values are 1742 // omitted from API requests. See 1743 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1744 NullFields []string `json:"-"` 1745 } 1746 1747 func (s *GoogleCloudRetailV2alphaAudience) MarshalJSON() ([]byte, error) { 1748 type NoMethod GoogleCloudRetailV2alphaAudience 1749 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1750 } 1751 1752 // GoogleCloudRetailV2alphaBatchRemoveCatalogAttributesRequest: Request for 1753 // CatalogService.BatchRemoveCatalogAttributes method. 1754 type GoogleCloudRetailV2alphaBatchRemoveCatalogAttributesRequest struct { 1755 // AttributeKeys: Required. The attribute name keys of the CatalogAttributes to 1756 // delete. A maximum of 1000 catalog attributes can be deleted in a batch. 1757 AttributeKeys []string `json:"attributeKeys,omitempty"` 1758 // ForceSendFields is a list of field names (e.g. "AttributeKeys") to 1759 // unconditionally include in API requests. By default, fields with empty or 1760 // default values are omitted from API requests. See 1761 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1762 // details. 1763 ForceSendFields []string `json:"-"` 1764 // NullFields is a list of field names (e.g. "AttributeKeys") to include in API 1765 // requests with the JSON null value. By default, fields with empty values are 1766 // omitted from API requests. See 1767 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1768 NullFields []string `json:"-"` 1769 } 1770 1771 func (s *GoogleCloudRetailV2alphaBatchRemoveCatalogAttributesRequest) MarshalJSON() ([]byte, error) { 1772 type NoMethod GoogleCloudRetailV2alphaBatchRemoveCatalogAttributesRequest 1773 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1774 } 1775 1776 // GoogleCloudRetailV2alphaBatchRemoveCatalogAttributesResponse: Response of 1777 // the CatalogService.BatchRemoveCatalogAttributes. 1778 type GoogleCloudRetailV2alphaBatchRemoveCatalogAttributesResponse struct { 1779 // DeletedCatalogAttributes: Catalog attributes that were deleted. Only 1780 // pre-loaded catalog attributes that are neither in use by products nor 1781 // predefined can be deleted. 1782 DeletedCatalogAttributes []string `json:"deletedCatalogAttributes,omitempty"` 1783 // ResetCatalogAttributes: Catalog attributes that were reset. Catalog 1784 // attributes that are either in use by products or are predefined attributes 1785 // cannot be deleted; however, their configuration properties will reset to 1786 // default values upon removal request. 1787 ResetCatalogAttributes []string `json:"resetCatalogAttributes,omitempty"` 1788 1789 // ServerResponse contains the HTTP response code and headers from the server. 1790 googleapi.ServerResponse `json:"-"` 1791 // ForceSendFields is a list of field names (e.g. "DeletedCatalogAttributes") 1792 // to unconditionally include in API requests. By default, fields with empty or 1793 // default values are omitted from API requests. See 1794 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1795 // details. 1796 ForceSendFields []string `json:"-"` 1797 // NullFields is a list of field names (e.g. "DeletedCatalogAttributes") to 1798 // include in API requests with the JSON null value. By default, fields with 1799 // empty values are omitted from API requests. See 1800 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1801 NullFields []string `json:"-"` 1802 } 1803 1804 func (s *GoogleCloudRetailV2alphaBatchRemoveCatalogAttributesResponse) MarshalJSON() ([]byte, error) { 1805 type NoMethod GoogleCloudRetailV2alphaBatchRemoveCatalogAttributesResponse 1806 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1807 } 1808 1809 // GoogleCloudRetailV2alphaBigQueryOutputResult: A BigQuery output result. 1810 type GoogleCloudRetailV2alphaBigQueryOutputResult struct { 1811 // DatasetId: The ID of a BigQuery Dataset. 1812 DatasetId string `json:"datasetId,omitempty"` 1813 // TableId: The ID of a BigQuery Table. 1814 TableId string `json:"tableId,omitempty"` 1815 // ForceSendFields is a list of field names (e.g. "DatasetId") to 1816 // unconditionally include in API requests. By default, fields with empty or 1817 // default values are omitted from API requests. See 1818 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1819 // details. 1820 ForceSendFields []string `json:"-"` 1821 // NullFields is a list of field names (e.g. "DatasetId") to include in API 1822 // requests with the JSON null value. By default, fields with empty values are 1823 // omitted from API requests. See 1824 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1825 NullFields []string `json:"-"` 1826 } 1827 1828 func (s *GoogleCloudRetailV2alphaBigQueryOutputResult) MarshalJSON() ([]byte, error) { 1829 type NoMethod GoogleCloudRetailV2alphaBigQueryOutputResult 1830 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1831 } 1832 1833 // GoogleCloudRetailV2alphaBigQuerySource: BigQuery source import data from. 1834 type GoogleCloudRetailV2alphaBigQuerySource struct { 1835 // DataSchema: The schema to use when parsing the data from the source. 1836 // Supported values for product imports: * `product` (default): One JSON 1837 // Product per line. Each product must have a valid Product.id. * 1838 // `product_merchant_center`: See Importing catalog data from Merchant Center 1839 // (https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc). 1840 // Supported values for user events imports: * `user_event` (default): One JSON 1841 // UserEvent per line. * `user_event_ga360`: The schema is available here: 1842 // https://support.google.com/analytics/answer/3437719. * `user_event_ga4`: The 1843 // schema is available here: 1844 // https://support.google.com/analytics/answer/7029846. Supported values for 1845 // autocomplete imports: * `suggestions` (default): One JSON completion 1846 // suggestion per line. * `denylist`: One JSON deny suggestion per line. * 1847 // `allowlist`: One JSON allow suggestion per line. 1848 DataSchema string `json:"dataSchema,omitempty"` 1849 // DatasetId: Required. The BigQuery data set to copy the data from with a 1850 // length limit of 1,024 characters. 1851 DatasetId string `json:"datasetId,omitempty"` 1852 // GcsStagingDir: Intermediate Cloud Storage directory used for the import with 1853 // a length limit of 2,000 characters. Can be specified if one wants to have 1854 // the BigQuery export to a specific Cloud Storage directory. 1855 GcsStagingDir string `json:"gcsStagingDir,omitempty"` 1856 // PartitionDate: BigQuery time partitioned table's _PARTITIONDATE in 1857 // YYYY-MM-DD format. Only supported in ImportProductsRequest. 1858 PartitionDate *GoogleTypeDate `json:"partitionDate,omitempty"` 1859 // ProjectId: The project ID (can be project # or ID) that the BigQuery source 1860 // is in with a length limit of 128 characters. If not specified, inherits the 1861 // project ID from the parent request. 1862 ProjectId string `json:"projectId,omitempty"` 1863 // TableId: Required. The BigQuery table to copy the data from with a length 1864 // limit of 1,024 characters. 1865 TableId string `json:"tableId,omitempty"` 1866 // ForceSendFields is a list of field names (e.g. "DataSchema") to 1867 // unconditionally include in API requests. By default, fields with empty or 1868 // default values are omitted from API requests. See 1869 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1870 // details. 1871 ForceSendFields []string `json:"-"` 1872 // NullFields is a list of field names (e.g. "DataSchema") to include in API 1873 // requests with the JSON null value. By default, fields with empty values are 1874 // omitted from API requests. See 1875 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1876 NullFields []string `json:"-"` 1877 } 1878 1879 func (s *GoogleCloudRetailV2alphaBigQuerySource) MarshalJSON() ([]byte, error) { 1880 type NoMethod GoogleCloudRetailV2alphaBigQuerySource 1881 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1882 } 1883 1884 // GoogleCloudRetailV2alphaBranch: A data branch that stores Products. 1885 type GoogleCloudRetailV2alphaBranch struct { 1886 // DisplayName: Output only. Human readable name of the branch to display in 1887 // the UI. 1888 DisplayName string `json:"displayName,omitempty"` 1889 // IsDefault: Output only. Indicates whether this branch is set as the default 1890 // branch of its parent catalog. 1891 IsDefault bool `json:"isDefault,omitempty"` 1892 // LastProductImportTime: Output only. Timestamp of last import through 1893 // ProductService.ImportProducts. Empty value means no import has been made to 1894 // this branch. 1895 LastProductImportTime string `json:"lastProductImportTime,omitempty"` 1896 // Name: Immutable. Full resource name of the branch, such as 1897 // `projects/*/locations/global/catalogs/default_catalog/branches/branch_id`. 1898 Name string `json:"name,omitempty"` 1899 // ProductCountStats: Output only. Statistics for number of products in the 1900 // branch, provided for different scopes. This field is not populated in 1901 // BranchView.BASIC view. 1902 ProductCountStats []*GoogleCloudRetailV2alphaBranchProductCountStatistic `json:"productCountStats,omitempty"` 1903 // ProductCounts: Output only. The number of products in different groups that 1904 // this branch has. The key is a group representing a set of products, and the 1905 // value is the number of products in that group. Note: keys in this map may 1906 // change over time. Possible keys: * "primary-in-stock", products have 1907 // Product.Type.PRIMARY type and Product.Availability.IN_STOCK availability. * 1908 // "primary-out-of-stock", products have Product.Type.PRIMARY type and 1909 // Product.Availability.OUT_OF_STOCK availability. * "primary-preorder", 1910 // products have Product.Type.PRIMARY type and Product.Availability.PREORDER 1911 // availability. * "primary-backorder", products have Product.Type.PRIMARY type 1912 // and Product.Availability.BACKORDER availability. * "variant-in-stock", 1913 // products have Product.Type.VARIANT type and Product.Availability.IN_STOCK 1914 // availability. * "variant-out-of-stock", products have Product.Type.VARIANT 1915 // type and Product.Availability.OUT_OF_STOCK availability. * 1916 // "variant-preorder", products have Product.Type.VARIANT type and 1917 // Product.Availability.PREORDER availability. * "variant-backorder", products 1918 // have Product.Type.VARIANT type and Product.Availability.BACKORDER 1919 // availability. * "price-discounted", products have [Product.price_info.price] 1920 // < [Product.price_info.original_price]. This field is not populated in 1921 // BranchView.BASIC view. 1922 ProductCounts map[string]string `json:"productCounts,omitempty"` 1923 // QualityMetrics: Output only. The quality metrics measured among products of 1924 // this branch. See QualityMetric.requirement_key for supported metrics. 1925 // Metrics could be missing if failed to retrieve. This field is not populated 1926 // in BranchView.BASIC view. 1927 QualityMetrics []*GoogleCloudRetailV2alphaBranchQualityMetric `json:"qualityMetrics,omitempty"` 1928 1929 // ServerResponse contains the HTTP response code and headers from the server. 1930 googleapi.ServerResponse `json:"-"` 1931 // ForceSendFields is a list of field names (e.g. "DisplayName") to 1932 // unconditionally include in API requests. By default, fields with empty or 1933 // default values are omitted from API requests. See 1934 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1935 // details. 1936 ForceSendFields []string `json:"-"` 1937 // NullFields is a list of field names (e.g. "DisplayName") to include in API 1938 // requests with the JSON null value. By default, fields with empty values are 1939 // omitted from API requests. See 1940 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1941 NullFields []string `json:"-"` 1942 } 1943 1944 func (s *GoogleCloudRetailV2alphaBranch) MarshalJSON() ([]byte, error) { 1945 type NoMethod GoogleCloudRetailV2alphaBranch 1946 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1947 } 1948 1949 // GoogleCloudRetailV2alphaBranchProductCountStatistic: A statistic about the 1950 // number of products in a branch. 1951 type GoogleCloudRetailV2alphaBranchProductCountStatistic struct { 1952 // Counts: The number of products in scope broken down into different groups. 1953 // The key is a group representing a set of products, and the value is the 1954 // number of products in that group. Note: keys in this map may change over 1955 // time. Possible keys: * "primary-in-stock", products have 1956 // Product.Type.PRIMARY type and Product.Availability.IN_STOCK availability. * 1957 // "primary-out-of-stock", products have Product.Type.PRIMARY type and 1958 // Product.Availability.OUT_OF_STOCK availability. * "primary-preorder", 1959 // products have Product.Type.PRIMARY type and Product.Availability.PREORDER 1960 // availability. * "primary-backorder", products have Product.Type.PRIMARY type 1961 // and Product.Availability.BACKORDER availability. * "variant-in-stock", 1962 // products have Product.Type.VARIANT type and Product.Availability.IN_STOCK 1963 // availability. * "variant-out-of-stock", products have Product.Type.VARIANT 1964 // type and Product.Availability.OUT_OF_STOCK availability. * 1965 // "variant-preorder", products have Product.Type.VARIANT type and 1966 // Product.Availability.PREORDER availability. * "variant-backorder", products 1967 // have Product.Type.VARIANT type and Product.Availability.BACKORDER 1968 // availability. * "price-discounted", products have [Product.price_info.price] 1969 // < [Product.price_info.original_price]. 1970 Counts map[string]string `json:"counts,omitempty"` 1971 // Scope: [ProductCountScope] of the [counts]. 1972 // 1973 // Possible values: 1974 // "PRODUCT_COUNT_SCOPE_UNSPECIFIED" - Default value for enum. This value is 1975 // not used in the API response. 1976 // "ALL_PRODUCTS" - Scope for all existing products in the branch. Useful for 1977 // understanding how many products there are in a branch. 1978 // "LAST_24_HOUR_UPDATE" - Scope for products created or updated in the last 1979 // 24 hours. 1980 Scope string `json:"scope,omitempty"` 1981 // ForceSendFields is a list of field names (e.g. "Counts") to unconditionally 1982 // include in API requests. By default, fields with empty or default values are 1983 // omitted from API requests. See 1984 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1985 // details. 1986 ForceSendFields []string `json:"-"` 1987 // NullFields is a list of field names (e.g. "Counts") to include in API 1988 // requests with the JSON null value. By default, fields with empty values are 1989 // omitted from API requests. See 1990 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1991 NullFields []string `json:"-"` 1992 } 1993 1994 func (s *GoogleCloudRetailV2alphaBranchProductCountStatistic) MarshalJSON() ([]byte, error) { 1995 type NoMethod GoogleCloudRetailV2alphaBranchProductCountStatistic 1996 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1997 } 1998 1999 // GoogleCloudRetailV2alphaBranchQualityMetric: Metric measured on a group of 2000 // Products against a certain quality requirement. Contains the number of 2001 // products that pass the check and the number of products that don't. 2002 type GoogleCloudRetailV2alphaBranchQualityMetric struct { 2003 // QualifiedProductCount: Number of products passing the quality requirement 2004 // check. We only check searchable products. 2005 QualifiedProductCount int64 `json:"qualifiedProductCount,omitempty"` 2006 // RequirementKey: The key that represents a quality requirement rule. 2007 // Supported keys: * "has-valid-uri": product has a valid and accessible uri. * 2008 // "available-expire-time-conformance": Product.available_time is early than 2009 // "now", and Product.expire_time is greater than "now". * 2010 // "has-searchable-attributes": product has at least one attribute set to 2011 // searchable. * "has-description": product has non-empty description. * 2012 // "has-at-least-bigram-title": Product title has at least two words. A 2013 // comprehensive title helps to improve search quality. * "variant-has-image": 2014 // the variant products has at least one image. You may ignore this metric if 2015 // all your products are at primary level. * "variant-has-price-info": the 2016 // variant products has price_info set. You may ignore this metric if all your 2017 // products are at primary level. * "has-publish-time": product has non-empty 2018 // publish_time. 2019 RequirementKey string `json:"requirementKey,omitempty"` 2020 // SuggestedQualityPercentThreshold: Value from 0 to 100 representing the 2021 // suggested percentage of products that meet the quality requirements to get 2022 // good search and recommendation performance. 100 * (qualified_product_count) 2023 // / (qualified_product_count + unqualified_product_count) should be greater or 2024 // equal to this suggestion. 2025 SuggestedQualityPercentThreshold float64 `json:"suggestedQualityPercentThreshold,omitempty"` 2026 // UnqualifiedProductCount: Number of products failing the quality requirement 2027 // check. We only check searchable products. 2028 UnqualifiedProductCount int64 `json:"unqualifiedProductCount,omitempty"` 2029 // UnqualifiedSampleProducts: A list of a maximum of 100 sample products that 2030 // do not qualify for this requirement. This field is only populated in the 2031 // response to BranchService.GetBranch API, and is always empty for 2032 // BranchService.ListBranches. Only the following fields are set in the 2033 // Product. * Product.name * Product.id * Product.title 2034 UnqualifiedSampleProducts []*GoogleCloudRetailV2alphaProduct `json:"unqualifiedSampleProducts,omitempty"` 2035 // ForceSendFields is a list of field names (e.g. "QualifiedProductCount") to 2036 // unconditionally include in API requests. By default, fields with empty or 2037 // default values are omitted from API requests. See 2038 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2039 // details. 2040 ForceSendFields []string `json:"-"` 2041 // NullFields is a list of field names (e.g. "QualifiedProductCount") to 2042 // include in API requests with the JSON null value. By default, fields with 2043 // empty values are omitted from API requests. See 2044 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2045 NullFields []string `json:"-"` 2046 } 2047 2048 func (s *GoogleCloudRetailV2alphaBranchQualityMetric) MarshalJSON() ([]byte, error) { 2049 type NoMethod GoogleCloudRetailV2alphaBranchQualityMetric 2050 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2051 } 2052 2053 func (s *GoogleCloudRetailV2alphaBranchQualityMetric) UnmarshalJSON(data []byte) error { 2054 type NoMethod GoogleCloudRetailV2alphaBranchQualityMetric 2055 var s1 struct { 2056 SuggestedQualityPercentThreshold gensupport.JSONFloat64 `json:"suggestedQualityPercentThreshold"` 2057 *NoMethod 2058 } 2059 s1.NoMethod = (*NoMethod)(s) 2060 if err := json.Unmarshal(data, &s1); err != nil { 2061 return err 2062 } 2063 s.SuggestedQualityPercentThreshold = float64(s1.SuggestedQualityPercentThreshold) 2064 return nil 2065 } 2066 2067 // GoogleCloudRetailV2alphaCatalog: The catalog configuration. 2068 type GoogleCloudRetailV2alphaCatalog struct { 2069 // DisplayName: Required. Immutable. The catalog display name. This field must 2070 // be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, 2071 // an INVALID_ARGUMENT error is returned. 2072 DisplayName string `json:"displayName,omitempty"` 2073 // MerchantCenterLinkingConfig: The Merchant Center linking configuration. 2074 // After a link is added, the data stream from Merchant Center to Cloud Retail 2075 // will be enabled automatically. The requester must have access to the 2076 // Merchant Center account in order to make changes to this field. 2077 MerchantCenterLinkingConfig *GoogleCloudRetailV2alphaMerchantCenterLinkingConfig `json:"merchantCenterLinkingConfig,omitempty"` 2078 // Name: Required. Immutable. The fully qualified resource name of the catalog. 2079 Name string `json:"name,omitempty"` 2080 // ProductLevelConfig: Required. The product level configuration. 2081 ProductLevelConfig *GoogleCloudRetailV2alphaProductLevelConfig `json:"productLevelConfig,omitempty"` 2082 2083 // ServerResponse contains the HTTP response code and headers from the server. 2084 googleapi.ServerResponse `json:"-"` 2085 // ForceSendFields is a list of field names (e.g. "DisplayName") to 2086 // unconditionally include in API requests. By default, fields with empty or 2087 // default values are omitted from API requests. See 2088 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2089 // details. 2090 ForceSendFields []string `json:"-"` 2091 // NullFields is a list of field names (e.g. "DisplayName") to include in API 2092 // requests with the JSON null value. By default, fields with empty values are 2093 // omitted from API requests. See 2094 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2095 NullFields []string `json:"-"` 2096 } 2097 2098 func (s *GoogleCloudRetailV2alphaCatalog) MarshalJSON() ([]byte, error) { 2099 type NoMethod GoogleCloudRetailV2alphaCatalog 2100 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2101 } 2102 2103 // GoogleCloudRetailV2alphaCatalogAttribute: Catalog level attribute config for 2104 // an attribute. For example, if customers want to enable/disable facet for a 2105 // specific attribute. 2106 type GoogleCloudRetailV2alphaCatalogAttribute struct { 2107 // DynamicFacetableOption: If DYNAMIC_FACETABLE_ENABLED, attribute values are 2108 // available for dynamic facet. Could only be DYNAMIC_FACETABLE_DISABLED if 2109 // CatalogAttribute.indexable_option is INDEXABLE_DISABLED. Otherwise, an 2110 // INVALID_ARGUMENT error is returned. Must be specified, otherwise throws 2111 // INVALID_FORMAT error. 2112 // 2113 // Possible values: 2114 // "DYNAMIC_FACETABLE_OPTION_UNSPECIFIED" - Value used when unset. 2115 // "DYNAMIC_FACETABLE_ENABLED" - Dynamic facetable option enabled for an 2116 // attribute. 2117 // "DYNAMIC_FACETABLE_DISABLED" - Dynamic facetable option disabled for an 2118 // attribute. 2119 DynamicFacetableOption string `json:"dynamicFacetableOption,omitempty"` 2120 // ExactSearchableOption: If EXACT_SEARCHABLE_ENABLED, attribute values will be 2121 // exact searchable. This property only applies to textual custom attributes 2122 // and requires indexable set to enabled to enable exact-searchable. If unset, 2123 // the server behavior defaults to EXACT_SEARCHABLE_DISABLED. 2124 // 2125 // Possible values: 2126 // "EXACT_SEARCHABLE_OPTION_UNSPECIFIED" - Value used when unset. 2127 // "EXACT_SEARCHABLE_ENABLED" - Exact searchable option enabled for an 2128 // attribute. 2129 // "EXACT_SEARCHABLE_DISABLED" - Exact searchable option disabled for an 2130 // attribute. 2131 ExactSearchableOption string `json:"exactSearchableOption,omitempty"` 2132 // FacetConfig: Contains facet options. 2133 FacetConfig *GoogleCloudRetailV2alphaCatalogAttributeFacetConfig `json:"facetConfig,omitempty"` 2134 // InUse: Output only. Indicates whether this attribute has been used by any 2135 // products. `True` if at least one Product is using this attribute in 2136 // Product.attributes. Otherwise, this field is `False`. CatalogAttribute can 2137 // be pre-loaded by using CatalogService.AddCatalogAttribute, 2138 // CatalogService.ImportCatalogAttributes, or 2139 // CatalogService.UpdateAttributesConfig APIs. This field is `False` for 2140 // pre-loaded CatalogAttributes. Only pre-loaded catalog attributes that are 2141 // neither in use by products nor predefined can be deleted. Catalog attributes 2142 // that are either in use by products or are predefined attributes cannot be 2143 // deleted; however, their configuration properties will reset to default 2144 // values upon removal request. After catalog changes, it takes about 10 2145 // minutes for this field to update. 2146 InUse bool `json:"inUse,omitempty"` 2147 // IndexableOption: When AttributesConfig.attribute_config_level is 2148 // CATALOG_LEVEL_ATTRIBUTE_CONFIG, if INDEXABLE_ENABLED attribute values are 2149 // indexed so that it can be filtered, faceted, or boosted in 2150 // SearchService.Search. Must be specified when 2151 // AttributesConfig.attribute_config_level is CATALOG_LEVEL_ATTRIBUTE_CONFIG, 2152 // otherwise throws INVALID_FORMAT error. 2153 // 2154 // Possible values: 2155 // "INDEXABLE_OPTION_UNSPECIFIED" - Value used when unset. 2156 // "INDEXABLE_ENABLED" - Indexable option enabled for an attribute. 2157 // "INDEXABLE_DISABLED" - Indexable option disabled for an attribute. 2158 IndexableOption string `json:"indexableOption,omitempty"` 2159 // Key: Required. Attribute name. For example: `color`, `brands`, 2160 // `attributes.custom_attribute`, such as `attributes.xyz`. To be indexable, 2161 // the attribute name can contain only alpha-numeric characters and 2162 // underscores. For example, an attribute named `attributes.abc_xyz` can be 2163 // indexed, but an attribute named `attributes.abc-xyz` cannot be indexed. If 2164 // the attribute key starts with `attributes.`, then the attribute is a custom 2165 // attribute. Attributes such as `brands`, `patterns`, and `title` are built-in 2166 // and called system attributes. 2167 Key string `json:"key,omitempty"` 2168 // RecommendationsFilteringOption: When AttributesConfig.attribute_config_level 2169 // is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if RECOMMENDATIONS_FILTERING_ENABLED, 2170 // attribute values are filterable for recommendations. This option works for 2171 // categorical features only, does not work for numerical features, inventory 2172 // filtering. 2173 // 2174 // Possible values: 2175 // "RECOMMENDATIONS_FILTERING_OPTION_UNSPECIFIED" - Value used when unset. In 2176 // this case, server behavior defaults to RECOMMENDATIONS_FILTERING_DISABLED. 2177 // "RECOMMENDATIONS_FILTERING_DISABLED" - Recommendation filtering is 2178 // disabled. 2179 // "RECOMMENDATIONS_FILTERING_ENABLED" - Recommendation filtering is enabled. 2180 RecommendationsFilteringOption string `json:"recommendationsFilteringOption,omitempty"` 2181 // RetrievableOption: If RETRIEVABLE_ENABLED, attribute values are retrievable 2182 // in the search results. If unset, the server behavior defaults to 2183 // RETRIEVABLE_DISABLED. 2184 // 2185 // Possible values: 2186 // "RETRIEVABLE_OPTION_UNSPECIFIED" - Value used when unset. 2187 // "RETRIEVABLE_ENABLED" - Retrievable option enabled for an attribute. 2188 // "RETRIEVABLE_DISABLED" - Retrievable option disabled for an attribute. 2189 RetrievableOption string `json:"retrievableOption,omitempty"` 2190 // SearchableOption: When AttributesConfig.attribute_config_level is 2191 // CATALOG_LEVEL_ATTRIBUTE_CONFIG, if SEARCHABLE_ENABLED, attribute values are 2192 // searchable by text queries in SearchService.Search. If SEARCHABLE_ENABLED 2193 // but attribute type is numerical, attribute values will not be searchable by 2194 // text queries in SearchService.Search, as there are no text values associated 2195 // to numerical attributes. Must be specified, when 2196 // AttributesConfig.attribute_config_level is CATALOG_LEVEL_ATTRIBUTE_CONFIG, 2197 // otherwise throws INVALID_FORMAT error. 2198 // 2199 // Possible values: 2200 // "SEARCHABLE_OPTION_UNSPECIFIED" - Value used when unset. 2201 // "SEARCHABLE_ENABLED" - Searchable option enabled for an attribute. 2202 // "SEARCHABLE_DISABLED" - Searchable option disabled for an attribute. 2203 SearchableOption string `json:"searchableOption,omitempty"` 2204 // Type: Output only. The type of this attribute. This is derived from the 2205 // attribute in Product.attributes. 2206 // 2207 // Possible values: 2208 // "UNKNOWN" - The type of the attribute is unknown. Used when type cannot be 2209 // derived from attribute that is not in_use. 2210 // "TEXTUAL" - Textual attribute. 2211 // "NUMERICAL" - Numerical attribute. 2212 Type string `json:"type,omitempty"` 2213 // ForceSendFields is a list of field names (e.g. "DynamicFacetableOption") to 2214 // unconditionally include in API requests. By default, fields with empty or 2215 // default values are omitted from API requests. See 2216 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2217 // details. 2218 ForceSendFields []string `json:"-"` 2219 // NullFields is a list of field names (e.g. "DynamicFacetableOption") to 2220 // include in API requests with the JSON null value. By default, fields with 2221 // empty values are omitted from API requests. See 2222 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2223 NullFields []string `json:"-"` 2224 } 2225 2226 func (s *GoogleCloudRetailV2alphaCatalogAttribute) MarshalJSON() ([]byte, error) { 2227 type NoMethod GoogleCloudRetailV2alphaCatalogAttribute 2228 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2229 } 2230 2231 // GoogleCloudRetailV2alphaCatalogAttributeFacetConfig: Possible options for 2232 // the facet that corresponds to the current attribute config. 2233 type GoogleCloudRetailV2alphaCatalogAttributeFacetConfig struct { 2234 // FacetIntervals: If you don't set the facet 2235 // SearchRequest.FacetSpec.FacetKey.intervals in the request to a numerical 2236 // attribute, then we use the computed intervals with rounded bounds obtained 2237 // from all its product numerical attribute values. The computed intervals 2238 // might not be ideal for some attributes. Therefore, we give you the option to 2239 // overwrite them with the facet_intervals field. The maximum of facet 2240 // intervals per CatalogAttribute is 40. Each interval must have a lower bound 2241 // or an upper bound. If both bounds are provided, then the lower bound must be 2242 // smaller or equal than the upper bound. 2243 FacetIntervals []*GoogleCloudRetailV2alphaInterval `json:"facetIntervals,omitempty"` 2244 // IgnoredFacetValues: Each instance represents a list of attribute values to 2245 // ignore as facet values for a specific time range. The maximum number of 2246 // instances per CatalogAttribute is 25. 2247 IgnoredFacetValues []*GoogleCloudRetailV2alphaCatalogAttributeFacetConfigIgnoredFacetValues `json:"ignoredFacetValues,omitempty"` 2248 // MergedFacet: Use this field only if you want to merge a facet key into 2249 // another facet key. 2250 MergedFacet *GoogleCloudRetailV2alphaCatalogAttributeFacetConfigMergedFacet `json:"mergedFacet,omitempty"` 2251 // MergedFacetValues: Each instance replaces a list of facet values by a merged 2252 // facet value. If a facet value is not in any list, then it will stay the 2253 // same. To avoid conflicts, only paths of length 1 are accepted. In other 2254 // words, if "dark_blue" merged into "BLUE", then the latter can't merge into 2255 // "blues" because this would create a path of length 2. The maximum number of 2256 // instances of MergedFacetValue per CatalogAttribute is 100. This feature is 2257 // available only for textual custom attributes. 2258 MergedFacetValues []*GoogleCloudRetailV2alphaCatalogAttributeFacetConfigMergedFacetValue `json:"mergedFacetValues,omitempty"` 2259 // RerankConfig: Set this field only if you want to rerank based on facet 2260 // values engaged by the user for the current key. This option is only possible 2261 // for custom facetable textual keys. 2262 RerankConfig *GoogleCloudRetailV2alphaCatalogAttributeFacetConfigRerankConfig `json:"rerankConfig,omitempty"` 2263 // ForceSendFields is a list of field names (e.g. "FacetIntervals") to 2264 // unconditionally include in API requests. By default, fields with empty or 2265 // default values are omitted from API requests. See 2266 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2267 // details. 2268 ForceSendFields []string `json:"-"` 2269 // NullFields is a list of field names (e.g. "FacetIntervals") to include in 2270 // API requests with the JSON null value. By default, fields with empty values 2271 // are omitted from API requests. See 2272 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2273 NullFields []string `json:"-"` 2274 } 2275 2276 func (s *GoogleCloudRetailV2alphaCatalogAttributeFacetConfig) MarshalJSON() ([]byte, error) { 2277 type NoMethod GoogleCloudRetailV2alphaCatalogAttributeFacetConfig 2278 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2279 } 2280 2281 // GoogleCloudRetailV2alphaCatalogAttributeFacetConfigIgnoredFacetValues: Facet 2282 // values to ignore on facets during the specified time range for the given 2283 // SearchResponse.Facet.key attribute. 2284 type GoogleCloudRetailV2alphaCatalogAttributeFacetConfigIgnoredFacetValues struct { 2285 // EndTime: If start time is empty and end time is not empty, then ignore these 2286 // facet values before end time. 2287 EndTime string `json:"endTime,omitempty"` 2288 // StartTime: Time range for the current list of facet values to ignore. If 2289 // multiple time ranges are specified for an facet value for the current 2290 // attribute, consider all of them. If both are empty, ignore always. If start 2291 // time and end time are set, then start time must be before end time. If start 2292 // time is not empty and end time is empty, then will ignore these facet values 2293 // after the start time. 2294 StartTime string `json:"startTime,omitempty"` 2295 // Values: List of facet values to ignore for the following time range. The 2296 // facet values are the same as the attribute values. There is a limit of 10 2297 // values per instance of IgnoredFacetValues. Each value can have at most 128 2298 // characters. 2299 Values []string `json:"values,omitempty"` 2300 // ForceSendFields is a list of field names (e.g. "EndTime") to unconditionally 2301 // include in API requests. By default, fields with empty or default values are 2302 // omitted from API requests. See 2303 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2304 // details. 2305 ForceSendFields []string `json:"-"` 2306 // NullFields is a list of field names (e.g. "EndTime") to include in API 2307 // requests with the JSON null value. By default, fields with empty values are 2308 // omitted from API requests. See 2309 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2310 NullFields []string `json:"-"` 2311 } 2312 2313 func (s *GoogleCloudRetailV2alphaCatalogAttributeFacetConfigIgnoredFacetValues) MarshalJSON() ([]byte, error) { 2314 type NoMethod GoogleCloudRetailV2alphaCatalogAttributeFacetConfigIgnoredFacetValues 2315 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2316 } 2317 2318 // GoogleCloudRetailV2alphaCatalogAttributeFacetConfigMergedFacet: The current 2319 // facet key (i.e. attribute config) maps into the merged_facet_key. A facet 2320 // key can have at most one child. The current facet key and the merged facet 2321 // key need both to be textual custom attributes or both numerical custom 2322 // attributes (same type). 2323 type GoogleCloudRetailV2alphaCatalogAttributeFacetConfigMergedFacet struct { 2324 // MergedFacetKey: The merged facet key should be a valid facet key that is 2325 // different than the facet key of the current catalog attribute. We refer this 2326 // is merged facet key as the child of the current catalog attribute. This 2327 // merged facet key can't be a parent of another facet key (i.e. no directed 2328 // path of length 2). This merged facet key needs to be either a textual custom 2329 // attribute or a numerical custom attribute. 2330 MergedFacetKey string `json:"mergedFacetKey,omitempty"` 2331 // MergedFacetValues: Each instance is a list of facet values that map into the 2332 // same (possibly different) merged facet value. For the current attribute 2333 // config, each facet value should map to at most one merged facet value. 2334 MergedFacetValues []*GoogleCloudRetailV2alphaCatalogAttributeFacetConfigMergedFacetValue `json:"mergedFacetValues,omitempty"` 2335 // ForceSendFields is a list of field names (e.g. "MergedFacetKey") to 2336 // unconditionally include in API requests. By default, fields with empty or 2337 // default values are omitted from API requests. See 2338 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2339 // details. 2340 ForceSendFields []string `json:"-"` 2341 // NullFields is a list of field names (e.g. "MergedFacetKey") to include in 2342 // API requests with the JSON null value. By default, fields with empty values 2343 // are omitted from API requests. See 2344 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2345 NullFields []string `json:"-"` 2346 } 2347 2348 func (s *GoogleCloudRetailV2alphaCatalogAttributeFacetConfigMergedFacet) MarshalJSON() ([]byte, error) { 2349 type NoMethod GoogleCloudRetailV2alphaCatalogAttributeFacetConfigMergedFacet 2350 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2351 } 2352 2353 // GoogleCloudRetailV2alphaCatalogAttributeFacetConfigMergedFacetValue: 2354 // Replaces a set of textual facet values by the same (possibly different) 2355 // merged facet value. Each facet value should appear at most once as a value 2356 // per CatalogAttribute. This feature is available only for textual custom 2357 // attributes. 2358 type GoogleCloudRetailV2alphaCatalogAttributeFacetConfigMergedFacetValue struct { 2359 // MergedValue: All the previous values are replaced by this merged facet 2360 // value. This merged_value must be non-empty and can have up to 128 2361 // characters. 2362 MergedValue string `json:"mergedValue,omitempty"` 2363 // Values: All the facet values that are replaces by the same merged_value that 2364 // follows. The maximum number of values per MergedFacetValue is 25. Each value 2365 // can have up to 128 characters. 2366 Values []string `json:"values,omitempty"` 2367 // ForceSendFields is a list of field names (e.g. "MergedValue") to 2368 // unconditionally include in API requests. By default, fields with empty or 2369 // default values are omitted from API requests. See 2370 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2371 // details. 2372 ForceSendFields []string `json:"-"` 2373 // NullFields is a list of field names (e.g. "MergedValue") to include in API 2374 // requests with the JSON null value. By default, fields with empty values are 2375 // omitted from API requests. See 2376 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2377 NullFields []string `json:"-"` 2378 } 2379 2380 func (s *GoogleCloudRetailV2alphaCatalogAttributeFacetConfigMergedFacetValue) MarshalJSON() ([]byte, error) { 2381 type NoMethod GoogleCloudRetailV2alphaCatalogAttributeFacetConfigMergedFacetValue 2382 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2383 } 2384 2385 // GoogleCloudRetailV2alphaCatalogAttributeFacetConfigRerankConfig: Options to 2386 // rerank based on facet values engaged by the user for the current key. That 2387 // key needs to be a custom textual key and facetable. To use this control, you 2388 // also need to pass all the facet keys engaged by the user in the request 2389 // using the field [SearchRequest.FacetSpec]. In particular, if you don't pass 2390 // the facet keys engaged that you want to rerank on, this control won't be 2391 // effective. Moreover, to obtain better results, the facet values that you 2392 // want to rerank on should be close to English (ideally made of words, 2393 // underscores, and spaces). 2394 type GoogleCloudRetailV2alphaCatalogAttributeFacetConfigRerankConfig struct { 2395 // FacetValues: If empty, rerank on all facet values for the current key. 2396 // Otherwise, will rerank on the facet values from this list only. 2397 FacetValues []string `json:"facetValues,omitempty"` 2398 // RerankFacet: If set to true, then we also rerank the dynamic facets based on 2399 // the facet values engaged by the user for the current attribute key during 2400 // serving. 2401 RerankFacet bool `json:"rerankFacet,omitempty"` 2402 // ForceSendFields is a list of field names (e.g. "FacetValues") to 2403 // unconditionally include in API requests. By default, fields with empty or 2404 // default values are omitted from API requests. See 2405 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2406 // details. 2407 ForceSendFields []string `json:"-"` 2408 // NullFields is a list of field names (e.g. "FacetValues") to include in API 2409 // requests with the JSON null value. By default, fields with empty values are 2410 // omitted from API requests. See 2411 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2412 NullFields []string `json:"-"` 2413 } 2414 2415 func (s *GoogleCloudRetailV2alphaCatalogAttributeFacetConfigRerankConfig) MarshalJSON() ([]byte, error) { 2416 type NoMethod GoogleCloudRetailV2alphaCatalogAttributeFacetConfigRerankConfig 2417 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2418 } 2419 2420 // GoogleCloudRetailV2alphaColorInfo: The color information of a Product. 2421 type GoogleCloudRetailV2alphaColorInfo struct { 2422 // ColorFamilies: The standard color families. Strongly recommended to use the 2423 // following standard color groups: "Red", "Pink", "Orange", "Yellow", 2424 // "Purple", "Green", "Cyan", "Blue", "Brown", "White", "Gray", "Black" and 2425 // "Mixed". Normally it is expected to have only 1 color family. May consider 2426 // using single "Mixed" instead of multiple values. A maximum of 5 values are 2427 // allowed. Each value must be a UTF-8 encoded string with a length limit of 2428 // 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. Google 2429 // Merchant Center property color 2430 // (https://support.google.com/merchants/answer/6324487). Schema.org property 2431 // Product.color (https://schema.org/color). 2432 ColorFamilies []string `json:"colorFamilies,omitempty"` 2433 // Colors: The color display names, which may be different from standard color 2434 // family names, such as the color aliases used in the website frontend. 2435 // Normally it is expected to have only 1 color. May consider using single 2436 // "Mixed" instead of multiple values. A maximum of 75 colors are allowed. Each 2437 // value must be a UTF-8 encoded string with a length limit of 128 characters. 2438 // Otherwise, an INVALID_ARGUMENT error is returned. Google Merchant Center 2439 // property color (https://support.google.com/merchants/answer/6324487). 2440 // Schema.org property Product.color (https://schema.org/color). 2441 Colors []string `json:"colors,omitempty"` 2442 // ForceSendFields is a list of field names (e.g. "ColorFamilies") to 2443 // unconditionally include in API requests. By default, fields with empty or 2444 // default values are omitted from API requests. See 2445 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2446 // details. 2447 ForceSendFields []string `json:"-"` 2448 // NullFields is a list of field names (e.g. "ColorFamilies") to include in API 2449 // requests with the JSON null value. By default, fields with empty values are 2450 // omitted from API requests. See 2451 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2452 NullFields []string `json:"-"` 2453 } 2454 2455 func (s *GoogleCloudRetailV2alphaColorInfo) MarshalJSON() ([]byte, error) { 2456 type NoMethod GoogleCloudRetailV2alphaColorInfo 2457 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2458 } 2459 2460 // GoogleCloudRetailV2alphaCompleteQueryResponse: Response of the autocomplete 2461 // query. 2462 type GoogleCloudRetailV2alphaCompleteQueryResponse struct { 2463 // AttributeResults: A map of matched attribute suggestions. This field is only 2464 // available for "cloud-retail" dataset. Current supported keys: * `brands` * 2465 // `categories` 2466 AttributeResults map[string]GoogleCloudRetailV2alphaCompleteQueryResponseAttributeResult `json:"attributeResults,omitempty"` 2467 // AttributionToken: A unique complete token. This should be included in the 2468 // UserEvent.completion_detail for search events resulting from this 2469 // completion, which enables accurate attribution of complete model 2470 // performance. 2471 AttributionToken string `json:"attributionToken,omitempty"` 2472 // CompletionResults: Results of the matching suggestions. The result list is 2473 // ordered and the first result is top suggestion. 2474 CompletionResults []*GoogleCloudRetailV2alphaCompleteQueryResponseCompletionResult `json:"completionResults,omitempty"` 2475 // RecentSearchResults: Deprecated. Matched recent searches of this user. The 2476 // maximum number of recent searches is 10. This field is a restricted feature. 2477 // If you want to enable it, contact Retail Search support. This feature is 2478 // only available when CompleteQueryRequest.visitor_id field is set and 2479 // UserEvent is imported. The recent searches satisfy the follow rules: * They 2480 // are ordered from latest to oldest. * They are matched with 2481 // CompleteQueryRequest.query case insensitively. * They are transformed to 2482 // lower case. * They are UTF-8 safe. Recent searches are deduplicated. More 2483 // recent searches will be reserved when duplication happens. 2484 RecentSearchResults []*GoogleCloudRetailV2alphaCompleteQueryResponseRecentSearchResult `json:"recentSearchResults,omitempty"` 2485 2486 // ServerResponse contains the HTTP response code and headers from the server. 2487 googleapi.ServerResponse `json:"-"` 2488 // ForceSendFields is a list of field names (e.g. "AttributeResults") to 2489 // unconditionally include in API requests. By default, fields with empty or 2490 // default values are omitted from API requests. See 2491 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2492 // details. 2493 ForceSendFields []string `json:"-"` 2494 // NullFields is a list of field names (e.g. "AttributeResults") to include in 2495 // API requests with the JSON null value. By default, fields with empty values 2496 // are omitted from API requests. See 2497 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2498 NullFields []string `json:"-"` 2499 } 2500 2501 func (s *GoogleCloudRetailV2alphaCompleteQueryResponse) MarshalJSON() ([]byte, error) { 2502 type NoMethod GoogleCloudRetailV2alphaCompleteQueryResponse 2503 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2504 } 2505 2506 // GoogleCloudRetailV2alphaCompleteQueryResponseAttributeResult: Resource that 2507 // represents attribute results. 2508 type GoogleCloudRetailV2alphaCompleteQueryResponseAttributeResult struct { 2509 // Suggestions: The list of suggestions for the attribute. 2510 Suggestions []string `json:"suggestions,omitempty"` 2511 // ForceSendFields is a list of field names (e.g. "Suggestions") to 2512 // unconditionally include in API requests. By default, fields with empty or 2513 // default values are omitted from API requests. See 2514 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2515 // details. 2516 ForceSendFields []string `json:"-"` 2517 // NullFields is a list of field names (e.g. "Suggestions") to include in API 2518 // requests with the JSON null value. By default, fields with empty values are 2519 // omitted from API requests. See 2520 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2521 NullFields []string `json:"-"` 2522 } 2523 2524 func (s *GoogleCloudRetailV2alphaCompleteQueryResponseAttributeResult) MarshalJSON() ([]byte, error) { 2525 type NoMethod GoogleCloudRetailV2alphaCompleteQueryResponseAttributeResult 2526 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2527 } 2528 2529 // GoogleCloudRetailV2alphaCompleteQueryResponseCompletionResult: Resource that 2530 // represents completion results. 2531 type GoogleCloudRetailV2alphaCompleteQueryResponseCompletionResult struct { 2532 // Attributes: Custom attributes for the suggestion term. * For "user-data", 2533 // the attributes are additional custom attributes ingested through BigQuery. * 2534 // For "cloud-retail", the attributes are product attributes generated by Cloud 2535 // Retail. It requires UserEvent.product_details is imported properly. 2536 Attributes map[string]GoogleCloudRetailV2alphaCustomAttribute `json:"attributes,omitempty"` 2537 // Facets: Facet information for the suggestion term. Gives the number of items 2538 // resulting from a search with this suggestion term for each facet. This is an 2539 // experimental feature for limited customers. If you want to receive this 2540 // facet information, reach out to the Retail support team. 2541 Facets []*GoogleCloudRetailV2alphaSearchResponseFacet `json:"facets,omitempty"` 2542 // Suggestion: The suggestion for the query. 2543 Suggestion string `json:"suggestion,omitempty"` 2544 // TotalProductCount: Total number of products associated with a search with 2545 // this suggestion. This is an experimental feature for limited customers. If 2546 // you want to receive this product count information, reach out to the Retail 2547 // support team. 2548 TotalProductCount int64 `json:"totalProductCount,omitempty"` 2549 // ForceSendFields is a list of field names (e.g. "Attributes") to 2550 // unconditionally include in API requests. By default, fields with empty or 2551 // default values are omitted from API requests. See 2552 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2553 // details. 2554 ForceSendFields []string `json:"-"` 2555 // NullFields is a list of field names (e.g. "Attributes") to include in API 2556 // requests with the JSON null value. By default, fields with empty values are 2557 // omitted from API requests. See 2558 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2559 NullFields []string `json:"-"` 2560 } 2561 2562 func (s *GoogleCloudRetailV2alphaCompleteQueryResponseCompletionResult) MarshalJSON() ([]byte, error) { 2563 type NoMethod GoogleCloudRetailV2alphaCompleteQueryResponseCompletionResult 2564 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2565 } 2566 2567 // GoogleCloudRetailV2alphaCompleteQueryResponseRecentSearchResult: Recent 2568 // search of this user. 2569 type GoogleCloudRetailV2alphaCompleteQueryResponseRecentSearchResult struct { 2570 // RecentSearch: The recent search query. 2571 RecentSearch string `json:"recentSearch,omitempty"` 2572 // ForceSendFields is a list of field names (e.g. "RecentSearch") to 2573 // unconditionally include in API requests. By default, fields with empty or 2574 // default values are omitted from API requests. See 2575 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2576 // details. 2577 ForceSendFields []string `json:"-"` 2578 // NullFields is a list of field names (e.g. "RecentSearch") to include in API 2579 // requests with the JSON null value. By default, fields with empty values are 2580 // omitted from API requests. See 2581 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2582 NullFields []string `json:"-"` 2583 } 2584 2585 func (s *GoogleCloudRetailV2alphaCompleteQueryResponseRecentSearchResult) MarshalJSON() ([]byte, error) { 2586 type NoMethod GoogleCloudRetailV2alphaCompleteQueryResponseRecentSearchResult 2587 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2588 } 2589 2590 // GoogleCloudRetailV2alphaCompletionConfig: Catalog level autocomplete config 2591 // for customers to customize autocomplete feature's settings. 2592 type GoogleCloudRetailV2alphaCompletionConfig struct { 2593 // AllowlistInputConfig: Output only. The source data for the latest import of 2594 // the autocomplete allowlist phrases. 2595 AllowlistInputConfig *GoogleCloudRetailV2alphaCompletionDataInputConfig `json:"allowlistInputConfig,omitempty"` 2596 // AutoLearning: If set to true, the auto learning function is enabled. Auto 2597 // learning uses user data to generate suggestions using ML techniques. Default 2598 // value is false. Only after enabling auto learning can users use 2599 // `cloud-retail` data in CompleteQueryRequest. 2600 AutoLearning bool `json:"autoLearning,omitempty"` 2601 // DenylistInputConfig: Output only. The source data for the latest import of 2602 // the autocomplete denylist phrases. 2603 DenylistInputConfig *GoogleCloudRetailV2alphaCompletionDataInputConfig `json:"denylistInputConfig,omitempty"` 2604 // LastAllowlistImportOperation: Output only. Name of the LRO corresponding to 2605 // the latest allowlist import. Can use GetOperation API to retrieve the latest 2606 // state of the Long Running Operation. 2607 LastAllowlistImportOperation string `json:"lastAllowlistImportOperation,omitempty"` 2608 // LastDenylistImportOperation: Output only. Name of the LRO corresponding to 2609 // the latest denylist import. Can use GetOperation API to retrieve the latest 2610 // state of the Long Running Operation. 2611 LastDenylistImportOperation string `json:"lastDenylistImportOperation,omitempty"` 2612 // LastSuggestionsImportOperation: Output only. Name of the LRO corresponding 2613 // to the latest suggestion terms list import. Can use GetOperation API method 2614 // to retrieve the latest state of the Long Running Operation. 2615 LastSuggestionsImportOperation string `json:"lastSuggestionsImportOperation,omitempty"` 2616 // MatchingOrder: Specifies the matching order for autocomplete suggestions, 2617 // e.g., a query consisting of 'sh' with 'out-of-order' specified would suggest 2618 // "women's shoes", whereas a query of 'red s' with 'exact-prefix' specified 2619 // would suggest "red shoes". Currently supported values: * 'out-of-order' * 2620 // 'exact-prefix' Default value: 'exact-prefix'. 2621 MatchingOrder string `json:"matchingOrder,omitempty"` 2622 // MaxSuggestions: The maximum number of autocomplete suggestions returned per 2623 // term. Default value is 20. If left unset or set to 0, then will fallback to 2624 // default value. Value range is 1 to 20. 2625 MaxSuggestions int64 `json:"maxSuggestions,omitempty"` 2626 // MinPrefixLength: The minimum number of characters needed to be typed in 2627 // order to get suggestions. Default value is 2. If left unset or set to 0, 2628 // then will fallback to default value. Value range is 1 to 20. 2629 MinPrefixLength int64 `json:"minPrefixLength,omitempty"` 2630 // Name: Required. Immutable. Fully qualified name 2631 // `projects/*/locations/*/catalogs/*/completionConfig` 2632 Name string `json:"name,omitempty"` 2633 // SuggestionsInputConfig: Output only. The source data for the latest import 2634 // of the autocomplete suggestion phrases. 2635 SuggestionsInputConfig *GoogleCloudRetailV2alphaCompletionDataInputConfig `json:"suggestionsInputConfig,omitempty"` 2636 2637 // ServerResponse contains the HTTP response code and headers from the server. 2638 googleapi.ServerResponse `json:"-"` 2639 // ForceSendFields is a list of field names (e.g. "AllowlistInputConfig") to 2640 // unconditionally include in API requests. By default, fields with empty or 2641 // default values are omitted from API requests. See 2642 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2643 // details. 2644 ForceSendFields []string `json:"-"` 2645 // NullFields is a list of field names (e.g. "AllowlistInputConfig") to include 2646 // in API requests with the JSON null value. By default, fields with empty 2647 // values are omitted from API requests. See 2648 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2649 NullFields []string `json:"-"` 2650 } 2651 2652 func (s *GoogleCloudRetailV2alphaCompletionConfig) MarshalJSON() ([]byte, error) { 2653 type NoMethod GoogleCloudRetailV2alphaCompletionConfig 2654 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2655 } 2656 2657 // GoogleCloudRetailV2alphaCompletionDataInputConfig: The input config source 2658 // for completion data. 2659 type GoogleCloudRetailV2alphaCompletionDataInputConfig struct { 2660 // BigQuerySource: Required. BigQuery input source. Add the IAM permission 2661 // "BigQuery Data Viewer" for 2662 // cloud-retail-customer-data-access@system.gserviceaccount.com before using 2663 // this feature otherwise an error is thrown. 2664 BigQuerySource *GoogleCloudRetailV2alphaBigQuerySource `json:"bigQuerySource,omitempty"` 2665 // ForceSendFields is a list of field names (e.g. "BigQuerySource") to 2666 // unconditionally include in API requests. By default, fields with empty or 2667 // default values are omitted from API requests. See 2668 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2669 // details. 2670 ForceSendFields []string `json:"-"` 2671 // NullFields is a list of field names (e.g. "BigQuerySource") to include in 2672 // API requests with the JSON null value. By default, fields with empty values 2673 // are omitted from API requests. See 2674 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2675 NullFields []string `json:"-"` 2676 } 2677 2678 func (s *GoogleCloudRetailV2alphaCompletionDataInputConfig) MarshalJSON() ([]byte, error) { 2679 type NoMethod GoogleCloudRetailV2alphaCompletionDataInputConfig 2680 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2681 } 2682 2683 // GoogleCloudRetailV2alphaCompletionDetail: Detailed completion information 2684 // including completion attribution token and clicked completion info. 2685 type GoogleCloudRetailV2alphaCompletionDetail struct { 2686 // CompletionAttributionToken: Completion attribution token in 2687 // CompleteQueryResponse.attribution_token. 2688 CompletionAttributionToken string `json:"completionAttributionToken,omitempty"` 2689 // SelectedPosition: End user selected 2690 // CompleteQueryResponse.CompletionResult.suggestion position, starting from 0. 2691 SelectedPosition int64 `json:"selectedPosition,omitempty"` 2692 // SelectedSuggestion: End user selected 2693 // CompleteQueryResponse.CompletionResult.suggestion. 2694 SelectedSuggestion string `json:"selectedSuggestion,omitempty"` 2695 // ForceSendFields is a list of field names (e.g. "CompletionAttributionToken") 2696 // to unconditionally include in API requests. By default, fields with empty or 2697 // default values are omitted from API requests. See 2698 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2699 // details. 2700 ForceSendFields []string `json:"-"` 2701 // NullFields is a list of field names (e.g. "CompletionAttributionToken") to 2702 // include in API requests with the JSON null value. By default, fields with 2703 // empty values are omitted from API requests. See 2704 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2705 NullFields []string `json:"-"` 2706 } 2707 2708 func (s *GoogleCloudRetailV2alphaCompletionDetail) MarshalJSON() ([]byte, error) { 2709 type NoMethod GoogleCloudRetailV2alphaCompletionDetail 2710 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2711 } 2712 2713 // GoogleCloudRetailV2alphaCondition: Metadata that is used to define a 2714 // condition that triggers an action. A valid condition must specify at least 2715 // one of 'query_terms' or 'products_filter'. If multiple fields are specified, 2716 // the condition is met if all the fields are satisfied e.g. if a set of query 2717 // terms and product_filter are set, then only items matching the 2718 // product_filter for requests with a query matching the query terms wil get 2719 // boosted. 2720 type GoogleCloudRetailV2alphaCondition struct { 2721 // ActiveTimeRange: Range of time(s) specifying when Condition is active. 2722 // Condition true if any time range matches. 2723 ActiveTimeRange []*GoogleCloudRetailV2alphaConditionTimeRange `json:"activeTimeRange,omitempty"` 2724 // PageCategories: Used to support browse uses cases. A list (up to 10 entries) 2725 // of categories or departments. The format should be the same as 2726 // UserEvent.page_categories; 2727 PageCategories []string `json:"pageCategories,omitempty"` 2728 // QueryTerms: A list (up to 10 entries) of terms to match the query on. If not 2729 // specified, match all queries. If many query terms are specified, the 2730 // condition is matched if any of the terms is a match (i.e. using the OR 2731 // operator). 2732 QueryTerms []*GoogleCloudRetailV2alphaConditionQueryTerm `json:"queryTerms,omitempty"` 2733 // ForceSendFields is a list of field names (e.g. "ActiveTimeRange") to 2734 // unconditionally include in API requests. By default, fields with empty or 2735 // default values are omitted from API requests. See 2736 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2737 // details. 2738 ForceSendFields []string `json:"-"` 2739 // NullFields is a list of field names (e.g. "ActiveTimeRange") to include in 2740 // API requests with the JSON null value. By default, fields with empty values 2741 // are omitted from API requests. See 2742 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2743 NullFields []string `json:"-"` 2744 } 2745 2746 func (s *GoogleCloudRetailV2alphaCondition) MarshalJSON() ([]byte, error) { 2747 type NoMethod GoogleCloudRetailV2alphaCondition 2748 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2749 } 2750 2751 // GoogleCloudRetailV2alphaConditionQueryTerm: Query terms that we want to 2752 // match on. 2753 type GoogleCloudRetailV2alphaConditionQueryTerm struct { 2754 // FullMatch: Whether this is supposed to be a full or partial match. 2755 FullMatch bool `json:"fullMatch,omitempty"` 2756 // Value: The value of the term to match on. Value cannot be empty. Value can 2757 // have at most 3 terms if specified as a partial match. Each space separated 2758 // string is considered as one term. For example, "a b c" is 3 terms and 2759 // allowed, but " a b c d" is 4 terms and not allowed for a partial match. 2760 Value string `json:"value,omitempty"` 2761 // ForceSendFields is a list of field names (e.g. "FullMatch") to 2762 // unconditionally include in API requests. By default, fields with empty or 2763 // default values are omitted from API requests. See 2764 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2765 // details. 2766 ForceSendFields []string `json:"-"` 2767 // NullFields is a list of field names (e.g. "FullMatch") to include in API 2768 // requests with the JSON null value. By default, fields with empty values are 2769 // omitted from API requests. See 2770 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2771 NullFields []string `json:"-"` 2772 } 2773 2774 func (s *GoogleCloudRetailV2alphaConditionQueryTerm) MarshalJSON() ([]byte, error) { 2775 type NoMethod GoogleCloudRetailV2alphaConditionQueryTerm 2776 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2777 } 2778 2779 // GoogleCloudRetailV2alphaConditionTimeRange: Used for time-dependent 2780 // conditions. Example: Want to have rule applied for week long sale. 2781 type GoogleCloudRetailV2alphaConditionTimeRange struct { 2782 // EndTime: End of time range. Range is inclusive. 2783 EndTime string `json:"endTime,omitempty"` 2784 // StartTime: Start of time range. Range is inclusive. 2785 StartTime string `json:"startTime,omitempty"` 2786 // ForceSendFields is a list of field names (e.g. "EndTime") to unconditionally 2787 // include in API requests. By default, fields with empty or default values are 2788 // omitted from API requests. See 2789 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2790 // details. 2791 ForceSendFields []string `json:"-"` 2792 // NullFields is a list of field names (e.g. "EndTime") to include in API 2793 // requests with the JSON null value. By default, fields with empty values are 2794 // omitted from API requests. See 2795 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2796 NullFields []string `json:"-"` 2797 } 2798 2799 func (s *GoogleCloudRetailV2alphaConditionTimeRange) MarshalJSON() ([]byte, error) { 2800 type NoMethod GoogleCloudRetailV2alphaConditionTimeRange 2801 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2802 } 2803 2804 // GoogleCloudRetailV2alphaControl: Configures dynamic metadata that can be 2805 // linked to a ServingConfig and affect search or recommendation results at 2806 // serving time. 2807 type GoogleCloudRetailV2alphaControl struct { 2808 // AssociatedServingConfigIds: Output only. List of serving config ids that are 2809 // associated with this control in the same Catalog. Note the association is 2810 // managed via the ServingConfig, this is an output only denormalized view. 2811 AssociatedServingConfigIds []string `json:"associatedServingConfigIds,omitempty"` 2812 // DisplayName: Required. The human readable control display name. Used in 2813 // Retail UI. This field must be a UTF-8 encoded string with a length limit of 2814 // 128 characters. Otherwise, an INVALID_ARGUMENT error is thrown. 2815 DisplayName string `json:"displayName,omitempty"` 2816 // FacetSpec: A facet specification to perform faceted search. Note that this 2817 // field is deprecated and will throw NOT_IMPLEMENTED if used for creating a 2818 // control. 2819 FacetSpec *GoogleCloudRetailV2alphaSearchRequestFacetSpec `json:"facetSpec,omitempty"` 2820 // Name: Immutable. Fully qualified name 2821 // `projects/*/locations/global/catalogs/*/controls/*` 2822 Name string `json:"name,omitempty"` 2823 // Rule: A rule control - a condition-action pair. Enacts a set action when the 2824 // condition is triggered. For example: Boost "gShoe" when query full matches 2825 // "Running Shoes". 2826 Rule *GoogleCloudRetailV2alphaRule `json:"rule,omitempty"` 2827 // SearchSolutionUseCase: Specifies the use case for the control. Affects what 2828 // condition fields can be set. Only settable by search controls. Will default 2829 // to SEARCH_SOLUTION_USE_CASE_SEARCH if not specified. Currently only allow 2830 // one search_solution_use_case per control. 2831 // 2832 // Possible values: 2833 // "SEARCH_SOLUTION_USE_CASE_UNSPECIFIED" - The value when it's unspecified. 2834 // In this case, server behavior defaults to SEARCH_SOLUTION_USE_CASE_SEARCH. 2835 // "SEARCH_SOLUTION_USE_CASE_SEARCH" - Search use case. Expects the traffic 2836 // has a non-empty query. 2837 // "SEARCH_SOLUTION_USE_CASE_BROWSE" - Browse use case. Expects the traffic 2838 // has an empty query. 2839 SearchSolutionUseCase []string `json:"searchSolutionUseCase,omitempty"` 2840 // SolutionTypes: Required. Immutable. The solution types that the control is 2841 // used for. Currently we support setting only one type of solution at creation 2842 // time. Only `SOLUTION_TYPE_SEARCH` value is supported at the moment. If no 2843 // solution type is provided at creation time, will default to 2844 // SOLUTION_TYPE_SEARCH. 2845 // 2846 // Possible values: 2847 // "SOLUTION_TYPE_UNSPECIFIED" - Default value. 2848 // "SOLUTION_TYPE_RECOMMENDATION" - Used for Recommendations AI. 2849 // "SOLUTION_TYPE_SEARCH" - Used for Retail Search. 2850 SolutionTypes []string `json:"solutionTypes,omitempty"` 2851 2852 // ServerResponse contains the HTTP response code and headers from the server. 2853 googleapi.ServerResponse `json:"-"` 2854 // ForceSendFields is a list of field names (e.g. "AssociatedServingConfigIds") 2855 // to unconditionally include in API requests. By default, fields with empty or 2856 // default values are omitted from API requests. See 2857 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2858 // details. 2859 ForceSendFields []string `json:"-"` 2860 // NullFields is a list of field names (e.g. "AssociatedServingConfigIds") to 2861 // include in API requests with the JSON null value. By default, fields with 2862 // empty values are omitted from API requests. See 2863 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2864 NullFields []string `json:"-"` 2865 } 2866 2867 func (s *GoogleCloudRetailV2alphaControl) MarshalJSON() ([]byte, error) { 2868 type NoMethod GoogleCloudRetailV2alphaControl 2869 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2870 } 2871 2872 // GoogleCloudRetailV2alphaCreateMerchantCenterAccountLinkMetadata: Common 2873 // metadata related to the progress of the operations. 2874 type GoogleCloudRetailV2alphaCreateMerchantCenterAccountLinkMetadata struct { 2875 // CreateTime: Operation create time. 2876 CreateTime string `json:"createTime,omitempty"` 2877 // UpdateTime: Operation last update time. If the operation is done, this is 2878 // also the finish time. 2879 UpdateTime string `json:"updateTime,omitempty"` 2880 // ForceSendFields is a list of field names (e.g. "CreateTime") to 2881 // unconditionally include in API requests. By default, fields with empty or 2882 // default values are omitted from API requests. See 2883 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2884 // details. 2885 ForceSendFields []string `json:"-"` 2886 // NullFields is a list of field names (e.g. "CreateTime") to include in API 2887 // requests with the JSON null value. By default, fields with empty values are 2888 // omitted from API requests. See 2889 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2890 NullFields []string `json:"-"` 2891 } 2892 2893 func (s *GoogleCloudRetailV2alphaCreateMerchantCenterAccountLinkMetadata) MarshalJSON() ([]byte, error) { 2894 type NoMethod GoogleCloudRetailV2alphaCreateMerchantCenterAccountLinkMetadata 2895 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2896 } 2897 2898 // GoogleCloudRetailV2alphaCreateModelMetadata: Metadata associated with a 2899 // create operation. 2900 type GoogleCloudRetailV2alphaCreateModelMetadata struct { 2901 // Model: The resource name of the model that this create applies to. Format: 2902 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/mode 2903 // ls/{model_id}` 2904 Model string `json:"model,omitempty"` 2905 // ForceSendFields is a list of field names (e.g. "Model") to unconditionally 2906 // include in API requests. By default, fields with empty or default values are 2907 // omitted from API requests. See 2908 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2909 // details. 2910 ForceSendFields []string `json:"-"` 2911 // NullFields is a list of field names (e.g. "Model") to include in API 2912 // requests with the JSON null value. By default, fields with empty values are 2913 // omitted from API requests. See 2914 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2915 NullFields []string `json:"-"` 2916 } 2917 2918 func (s *GoogleCloudRetailV2alphaCreateModelMetadata) MarshalJSON() ([]byte, error) { 2919 type NoMethod GoogleCloudRetailV2alphaCreateModelMetadata 2920 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2921 } 2922 2923 // GoogleCloudRetailV2alphaCustomAttribute: A custom attribute that is not 2924 // explicitly modeled in Product. 2925 type GoogleCloudRetailV2alphaCustomAttribute struct { 2926 // Indexable: This field is normally ignored unless 2927 // AttributesConfig.attribute_config_level of the Catalog is set to the 2928 // deprecated 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG' mode. For information about 2929 // product-level attribute configuration, see Configuration modes 2930 // (https://cloud.google.com/retail/docs/attribute-config#config-modes). If 2931 // true, custom attribute values are indexed, so that they can be filtered, 2932 // faceted or boosted in SearchService.Search. This field is ignored in a 2933 // UserEvent. See SearchRequest.filter, SearchRequest.facet_specs and 2934 // SearchRequest.boost_spec for more details. 2935 Indexable bool `json:"indexable,omitempty"` 2936 // Numbers: The numerical values of this custom attribute. For example, `[2.3, 2937 // 15.4]` when the key is "lengths_cm". Exactly one of text or numbers should 2938 // be set. Otherwise, an INVALID_ARGUMENT error is returned. 2939 Numbers []float64 `json:"numbers,omitempty"` 2940 // Searchable: This field is normally ignored unless 2941 // AttributesConfig.attribute_config_level of the Catalog is set to the 2942 // deprecated 'PRODUCT_LEVEL_ATTRIBUTE_CONFIG' mode. For information about 2943 // product-level attribute configuration, see Configuration modes 2944 // (https://cloud.google.com/retail/docs/attribute-config#config-modes). If 2945 // true, custom attribute values are searchable by text queries in 2946 // SearchService.Search. This field is ignored in a UserEvent. Only set if type 2947 // text is set. Otherwise, a INVALID_ARGUMENT error is returned. 2948 Searchable bool `json:"searchable,omitempty"` 2949 // Text: The textual values of this custom attribute. For example, `["yellow", 2950 // "green"]` when the key is "color". Empty string is not allowed. Otherwise, 2951 // an INVALID_ARGUMENT error is returned. Exactly one of text or numbers should 2952 // be set. Otherwise, an INVALID_ARGUMENT error is returned. 2953 Text []string `json:"text,omitempty"` 2954 // ForceSendFields is a list of field names (e.g. "Indexable") to 2955 // unconditionally include in API requests. By default, fields with empty or 2956 // default values are omitted from API requests. See 2957 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2958 // details. 2959 ForceSendFields []string `json:"-"` 2960 // NullFields is a list of field names (e.g. "Indexable") to include in API 2961 // requests with the JSON null value. By default, fields with empty values are 2962 // omitted from API requests. See 2963 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2964 NullFields []string `json:"-"` 2965 } 2966 2967 func (s *GoogleCloudRetailV2alphaCustomAttribute) MarshalJSON() ([]byte, error) { 2968 type NoMethod GoogleCloudRetailV2alphaCustomAttribute 2969 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2970 } 2971 2972 func (s *GoogleCloudRetailV2alphaCustomAttribute) UnmarshalJSON(data []byte) error { 2973 type NoMethod GoogleCloudRetailV2alphaCustomAttribute 2974 var s1 struct { 2975 Numbers []gensupport.JSONFloat64 `json:"numbers"` 2976 *NoMethod 2977 } 2978 s1.NoMethod = (*NoMethod)(s) 2979 if err := json.Unmarshal(data, &s1); err != nil { 2980 return err 2981 } 2982 s.Numbers = make([]float64, len(s1.Numbers)) 2983 for i := range s1.Numbers { 2984 s.Numbers[i] = float64(s1.Numbers[i]) 2985 } 2986 return nil 2987 } 2988 2989 // GoogleCloudRetailV2alphaEnrollSolutionMetadata: Metadata related to the 2990 // EnrollSolution method. This will be returned by the 2991 // google.longrunning.Operation.metadata field. 2992 type GoogleCloudRetailV2alphaEnrollSolutionMetadata struct { 2993 } 2994 2995 // GoogleCloudRetailV2alphaEnrollSolutionRequest: Request for EnrollSolution 2996 // method. 2997 type GoogleCloudRetailV2alphaEnrollSolutionRequest struct { 2998 // Solution: Required. Solution to enroll. 2999 // 3000 // Possible values: 3001 // "SOLUTION_TYPE_UNSPECIFIED" - Default value. 3002 // "SOLUTION_TYPE_RECOMMENDATION" - Used for Recommendations AI. 3003 // "SOLUTION_TYPE_SEARCH" - Used for Retail Search. 3004 Solution string `json:"solution,omitempty"` 3005 // ForceSendFields is a list of field names (e.g. "Solution") to 3006 // unconditionally include in API requests. By default, fields with empty or 3007 // default values are omitted from API requests. See 3008 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3009 // details. 3010 ForceSendFields []string `json:"-"` 3011 // NullFields is a list of field names (e.g. "Solution") to include in API 3012 // requests with the JSON null value. By default, fields with empty values are 3013 // omitted from API requests. See 3014 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3015 NullFields []string `json:"-"` 3016 } 3017 3018 func (s *GoogleCloudRetailV2alphaEnrollSolutionRequest) MarshalJSON() ([]byte, error) { 3019 type NoMethod GoogleCloudRetailV2alphaEnrollSolutionRequest 3020 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3021 } 3022 3023 // GoogleCloudRetailV2alphaEnrollSolutionResponse: Response for EnrollSolution 3024 // method. 3025 type GoogleCloudRetailV2alphaEnrollSolutionResponse struct { 3026 // EnrolledSolution: Retail API solution that the project has enrolled. 3027 // 3028 // Possible values: 3029 // "SOLUTION_TYPE_UNSPECIFIED" - Default value. 3030 // "SOLUTION_TYPE_RECOMMENDATION" - Used for Recommendations AI. 3031 // "SOLUTION_TYPE_SEARCH" - Used for Retail Search. 3032 EnrolledSolution string `json:"enrolledSolution,omitempty"` 3033 // ForceSendFields is a list of field names (e.g. "EnrolledSolution") to 3034 // unconditionally include in API requests. By default, fields with empty or 3035 // default values are omitted from API requests. See 3036 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3037 // details. 3038 ForceSendFields []string `json:"-"` 3039 // NullFields is a list of field names (e.g. "EnrolledSolution") to include in 3040 // API requests with the JSON null value. By default, fields with empty values 3041 // are omitted from API requests. See 3042 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3043 NullFields []string `json:"-"` 3044 } 3045 3046 func (s *GoogleCloudRetailV2alphaEnrollSolutionResponse) MarshalJSON() ([]byte, error) { 3047 type NoMethod GoogleCloudRetailV2alphaEnrollSolutionResponse 3048 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3049 } 3050 3051 // GoogleCloudRetailV2alphaExperimentInfo: Metadata for active A/B testing 3052 // Experiment. 3053 type GoogleCloudRetailV2alphaExperimentInfo struct { 3054 // Experiment: The fully qualified resource name of the experiment that 3055 // provides the serving config under test, should an active experiment exist. 3056 // For example: 3057 // `projects/*/locations/global/catalogs/default_catalog/experiments/experiment_ 3058 // id` 3059 Experiment string `json:"experiment,omitempty"` 3060 // ServingConfigExperiment: A/B test between existing Cloud Retail Search 3061 // ServingConfigs. 3062 ServingConfigExperiment *GoogleCloudRetailV2alphaExperimentInfoServingConfigExperiment `json:"servingConfigExperiment,omitempty"` 3063 // ForceSendFields is a list of field names (e.g. "Experiment") to 3064 // unconditionally include in API requests. By default, fields with empty or 3065 // default values are omitted from API requests. See 3066 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3067 // details. 3068 ForceSendFields []string `json:"-"` 3069 // NullFields is a list of field names (e.g. "Experiment") to include in API 3070 // requests with the JSON null value. By default, fields with empty values are 3071 // omitted from API requests. See 3072 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3073 NullFields []string `json:"-"` 3074 } 3075 3076 func (s *GoogleCloudRetailV2alphaExperimentInfo) MarshalJSON() ([]byte, error) { 3077 type NoMethod GoogleCloudRetailV2alphaExperimentInfo 3078 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3079 } 3080 3081 // GoogleCloudRetailV2alphaExperimentInfoServingConfigExperiment: Metadata for 3082 // active serving config A/B tests. 3083 type GoogleCloudRetailV2alphaExperimentInfoServingConfigExperiment struct { 3084 // ExperimentServingConfig: The fully qualified resource name of the serving 3085 // config Experiment.VariantArm.serving_config_id responsible for generating 3086 // the search response. For example: 3087 // `projects/*/locations/*/catalogs/*/servingConfigs/*`. 3088 ExperimentServingConfig string `json:"experimentServingConfig,omitempty"` 3089 // OriginalServingConfig: The fully qualified resource name of the original 3090 // SearchRequest.placement in the search request prior to reassignment by 3091 // experiment API. For example: 3092 // `projects/*/locations/*/catalogs/*/servingConfigs/*`. 3093 OriginalServingConfig string `json:"originalServingConfig,omitempty"` 3094 // ForceSendFields is a list of field names (e.g. "ExperimentServingConfig") to 3095 // unconditionally include in API requests. By default, fields with empty or 3096 // default values are omitted from API requests. See 3097 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3098 // details. 3099 ForceSendFields []string `json:"-"` 3100 // NullFields is a list of field names (e.g. "ExperimentServingConfig") to 3101 // include in API requests with the JSON null value. By default, fields with 3102 // empty values are omitted from API requests. See 3103 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3104 NullFields []string `json:"-"` 3105 } 3106 3107 func (s *GoogleCloudRetailV2alphaExperimentInfoServingConfigExperiment) MarshalJSON() ([]byte, error) { 3108 type NoMethod GoogleCloudRetailV2alphaExperimentInfoServingConfigExperiment 3109 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3110 } 3111 3112 // GoogleCloudRetailV2alphaExportAnalyticsMetricsRequest: Request message for 3113 // the `ExportAnalyticsMetrics` method. 3114 type GoogleCloudRetailV2alphaExportAnalyticsMetricsRequest struct { 3115 // Filter: A filtering expression to specify restrictions on returned metrics. 3116 // The expression is a sequence of terms. Each term applies a restriction to 3117 // the returned metrics. Use this expression to restrict results to a specific 3118 // time range. Currently we expect only one types of fields: * `timestamp`: 3119 // This can be specified twice, once with a less than operator and once with a 3120 // greater than operator. The `timestamp` restriction should result in one, 3121 // contiguous, valid, `timestamp` range. Some examples of valid filters 3122 // expressions: * Example 1: `timestamp > "2012-04-23T18:25:43.511Z" timestamp 3123 // < "2012-04-23T18:30:43.511Z" * Example 2: `timestamp > 3124 // "2012-04-23T18:25:43.511Z" 3125 Filter string `json:"filter,omitempty"` 3126 // OutputConfig: Required. The output location of the data. 3127 OutputConfig *GoogleCloudRetailV2alphaOutputConfig `json:"outputConfig,omitempty"` 3128 // ForceSendFields is a list of field names (e.g. "Filter") to unconditionally 3129 // include in API requests. By default, fields with empty or default values are 3130 // omitted from API requests. See 3131 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3132 // details. 3133 ForceSendFields []string `json:"-"` 3134 // NullFields is a list of field names (e.g. "Filter") to include in API 3135 // requests with the JSON null value. By default, fields with empty values are 3136 // omitted from API requests. See 3137 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3138 NullFields []string `json:"-"` 3139 } 3140 3141 func (s *GoogleCloudRetailV2alphaExportAnalyticsMetricsRequest) MarshalJSON() ([]byte, error) { 3142 type NoMethod GoogleCloudRetailV2alphaExportAnalyticsMetricsRequest 3143 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3144 } 3145 3146 // GoogleCloudRetailV2alphaExportAnalyticsMetricsResponse: Response of the 3147 // ExportAnalyticsMetricsRequest. If the long running operation was successful, 3148 // then this message is returned by the google.longrunning.Operations.response 3149 // field if the operation was successful. 3150 type GoogleCloudRetailV2alphaExportAnalyticsMetricsResponse struct { 3151 // ErrorSamples: A sample of errors encountered while processing the request. 3152 ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` 3153 // ErrorsConfig: This field is never set. 3154 ErrorsConfig *GoogleCloudRetailV2alphaExportErrorsConfig `json:"errorsConfig,omitempty"` 3155 // OutputResult: Output result indicating where the data were exported to. 3156 OutputResult *GoogleCloudRetailV2alphaOutputResult `json:"outputResult,omitempty"` 3157 // ForceSendFields is a list of field names (e.g. "ErrorSamples") to 3158 // unconditionally include in API requests. By default, fields with empty or 3159 // default values are omitted from API requests. See 3160 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3161 // details. 3162 ForceSendFields []string `json:"-"` 3163 // NullFields is a list of field names (e.g. "ErrorSamples") to include in API 3164 // requests with the JSON null value. By default, fields with empty values are 3165 // omitted from API requests. See 3166 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3167 NullFields []string `json:"-"` 3168 } 3169 3170 func (s *GoogleCloudRetailV2alphaExportAnalyticsMetricsResponse) MarshalJSON() ([]byte, error) { 3171 type NoMethod GoogleCloudRetailV2alphaExportAnalyticsMetricsResponse 3172 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3173 } 3174 3175 // GoogleCloudRetailV2alphaExportErrorsConfig: Configuration of destination for 3176 // Export related errors. 3177 type GoogleCloudRetailV2alphaExportErrorsConfig struct { 3178 // GcsPrefix: Google Cloud Storage path for import errors. This must be an 3179 // empty, existing Cloud Storage bucket. Export errors will be written to a 3180 // file in this bucket, one per line, as a JSON-encoded `google.rpc.Status` 3181 // message. 3182 GcsPrefix string `json:"gcsPrefix,omitempty"` 3183 // ForceSendFields is a list of field names (e.g. "GcsPrefix") to 3184 // unconditionally include in API requests. By default, fields with empty or 3185 // default values are omitted from API requests. See 3186 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3187 // details. 3188 ForceSendFields []string `json:"-"` 3189 // NullFields is a list of field names (e.g. "GcsPrefix") to include in API 3190 // requests with the JSON null value. By default, fields with empty values are 3191 // omitted from API requests. See 3192 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3193 NullFields []string `json:"-"` 3194 } 3195 3196 func (s *GoogleCloudRetailV2alphaExportErrorsConfig) MarshalJSON() ([]byte, error) { 3197 type NoMethod GoogleCloudRetailV2alphaExportErrorsConfig 3198 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3199 } 3200 3201 // GoogleCloudRetailV2alphaExportMetadata: Metadata related to the progress of 3202 // the Export operation. This is returned by the 3203 // google.longrunning.Operation.metadata field. 3204 type GoogleCloudRetailV2alphaExportMetadata struct { 3205 // CreateTime: Operation create time. 3206 CreateTime string `json:"createTime,omitempty"` 3207 // UpdateTime: Operation last update time. If the operation is done, this is 3208 // also the finish time. 3209 UpdateTime string `json:"updateTime,omitempty"` 3210 // ForceSendFields is a list of field names (e.g. "CreateTime") to 3211 // unconditionally include in API requests. By default, fields with empty or 3212 // default values are omitted from API requests. See 3213 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3214 // details. 3215 ForceSendFields []string `json:"-"` 3216 // NullFields is a list of field names (e.g. "CreateTime") to include in API 3217 // requests with the JSON null value. By default, fields with empty values are 3218 // omitted from API requests. See 3219 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3220 NullFields []string `json:"-"` 3221 } 3222 3223 func (s *GoogleCloudRetailV2alphaExportMetadata) MarshalJSON() ([]byte, error) { 3224 type NoMethod GoogleCloudRetailV2alphaExportMetadata 3225 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3226 } 3227 3228 // GoogleCloudRetailV2alphaExportProductsResponse: Response of the 3229 // ExportProductsRequest. If the long running operation is done, then this 3230 // message is returned by the google.longrunning.Operations.response field if 3231 // the operation was successful. 3232 type GoogleCloudRetailV2alphaExportProductsResponse struct { 3233 // ErrorSamples: A sample of errors encountered while processing the request. 3234 ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` 3235 // ErrorsConfig: This field is never set. 3236 ErrorsConfig *GoogleCloudRetailV2alphaExportErrorsConfig `json:"errorsConfig,omitempty"` 3237 // OutputResult: Output result indicating where the data were exported to. 3238 OutputResult *GoogleCloudRetailV2alphaOutputResult `json:"outputResult,omitempty"` 3239 // ForceSendFields is a list of field names (e.g. "ErrorSamples") to 3240 // unconditionally include in API requests. By default, fields with empty or 3241 // default values are omitted from API requests. See 3242 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3243 // details. 3244 ForceSendFields []string `json:"-"` 3245 // NullFields is a list of field names (e.g. "ErrorSamples") to include in API 3246 // requests with the JSON null value. By default, fields with empty values are 3247 // omitted from API requests. See 3248 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3249 NullFields []string `json:"-"` 3250 } 3251 3252 func (s *GoogleCloudRetailV2alphaExportProductsResponse) MarshalJSON() ([]byte, error) { 3253 type NoMethod GoogleCloudRetailV2alphaExportProductsResponse 3254 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3255 } 3256 3257 // GoogleCloudRetailV2alphaExportUserEventsResponse: Response of the 3258 // ExportUserEventsRequest. If the long running operation was successful, then 3259 // this message is returned by the google.longrunning.Operations.response field 3260 // if the operation was successful. 3261 type GoogleCloudRetailV2alphaExportUserEventsResponse struct { 3262 // ErrorSamples: A sample of errors encountered while processing the request. 3263 ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` 3264 // ErrorsConfig: This field is never set. 3265 ErrorsConfig *GoogleCloudRetailV2alphaExportErrorsConfig `json:"errorsConfig,omitempty"` 3266 // OutputResult: Output result indicating where the data were exported to. 3267 OutputResult *GoogleCloudRetailV2alphaOutputResult `json:"outputResult,omitempty"` 3268 // ForceSendFields is a list of field names (e.g. "ErrorSamples") to 3269 // unconditionally include in API requests. By default, fields with empty or 3270 // default values are omitted from API requests. See 3271 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3272 // details. 3273 ForceSendFields []string `json:"-"` 3274 // NullFields is a list of field names (e.g. "ErrorSamples") to include in API 3275 // requests with the JSON null value. By default, fields with empty values are 3276 // omitted from API requests. See 3277 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3278 NullFields []string `json:"-"` 3279 } 3280 3281 func (s *GoogleCloudRetailV2alphaExportUserEventsResponse) MarshalJSON() ([]byte, error) { 3282 type NoMethod GoogleCloudRetailV2alphaExportUserEventsResponse 3283 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3284 } 3285 3286 // GoogleCloudRetailV2alphaFulfillmentInfo: Fulfillment information, such as 3287 // the store IDs for in-store pickup or region IDs for different shipping 3288 // methods. 3289 type GoogleCloudRetailV2alphaFulfillmentInfo struct { 3290 // PlaceIds: The IDs for this type, such as the store IDs for 3291 // FulfillmentInfo.type.pickup-in-store or the region IDs for 3292 // FulfillmentInfo.type.same-day-delivery. A maximum of 3000 values are 3293 // allowed. Each value must be a string with a length limit of 30 characters, 3294 // matching the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". 3295 // Otherwise, an INVALID_ARGUMENT error is returned. 3296 PlaceIds []string `json:"placeIds,omitempty"` 3297 // Type: The fulfillment type, including commonly used types (such as pickup in 3298 // store and same day delivery), and custom types. Customers have to map custom 3299 // types to their display names before rendering UI. Supported values: * 3300 // "pickup-in-store" * "ship-to-store" * "same-day-delivery" * 3301 // "next-day-delivery" * "custom-type-1" * "custom-type-2" * "custom-type-3" * 3302 // "custom-type-4" * "custom-type-5" If this field is set to an invalid value 3303 // other than these, an INVALID_ARGUMENT error is returned. 3304 Type string `json:"type,omitempty"` 3305 // ForceSendFields is a list of field names (e.g. "PlaceIds") to 3306 // unconditionally include in API requests. By default, fields with empty or 3307 // default values are omitted from API requests. See 3308 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3309 // details. 3310 ForceSendFields []string `json:"-"` 3311 // NullFields is a list of field names (e.g. "PlaceIds") to include in API 3312 // requests with the JSON null value. By default, fields with empty values are 3313 // omitted from API requests. See 3314 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3315 NullFields []string `json:"-"` 3316 } 3317 3318 func (s *GoogleCloudRetailV2alphaFulfillmentInfo) MarshalJSON() ([]byte, error) { 3319 type NoMethod GoogleCloudRetailV2alphaFulfillmentInfo 3320 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3321 } 3322 3323 // GoogleCloudRetailV2alphaGcsOutputResult: A Gcs output result. 3324 type GoogleCloudRetailV2alphaGcsOutputResult struct { 3325 // OutputUri: The uri of Gcs output 3326 OutputUri string `json:"outputUri,omitempty"` 3327 // ForceSendFields is a list of field names (e.g. "OutputUri") to 3328 // unconditionally include in API requests. By default, fields with empty or 3329 // default values are omitted from API requests. See 3330 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3331 // details. 3332 ForceSendFields []string `json:"-"` 3333 // NullFields is a list of field names (e.g. "OutputUri") to include in API 3334 // requests with the JSON null value. By default, fields with empty values are 3335 // omitted from API requests. See 3336 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3337 NullFields []string `json:"-"` 3338 } 3339 3340 func (s *GoogleCloudRetailV2alphaGcsOutputResult) MarshalJSON() ([]byte, error) { 3341 type NoMethod GoogleCloudRetailV2alphaGcsOutputResult 3342 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3343 } 3344 3345 // GoogleCloudRetailV2alphaGcsSource: Google Cloud Storage location for input 3346 // content. 3347 type GoogleCloudRetailV2alphaGcsSource struct { 3348 // DataSchema: The schema to use when parsing the data from the source. 3349 // Supported values for product imports: * `product` (default): One JSON 3350 // Product per line. Each product must have a valid Product.id. * 3351 // `product_merchant_center`: See Importing catalog data from Merchant Center 3352 // (https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc). 3353 // Supported values for user events imports: * `user_event` (default): One JSON 3354 // UserEvent per line. * `user_event_ga360`: Using 3355 // https://support.google.com/analytics/answer/3437719. Supported values for 3356 // control imports: * `control` (default): One JSON Control per line. Supported 3357 // values for catalog attribute imports: * `catalog_attribute` (default): One 3358 // CSV CatalogAttribute per line. 3359 DataSchema string `json:"dataSchema,omitempty"` 3360 // InputUris: Required. Google Cloud Storage URIs to input files. URI can be up 3361 // to 2000 characters long. URIs can match the full object path (for example, 3362 // `gs://bucket/directory/object.json`) or a pattern matching one or more 3363 // files, such as `gs://bucket/directory/*.json`. A request can contain at most 3364 // 100 files, and each file can be up to 2 GB. See Importing product 3365 // information 3366 // (https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog) for 3367 // the expected file format and setup instructions. 3368 InputUris []string `json:"inputUris,omitempty"` 3369 // ForceSendFields is a list of field names (e.g. "DataSchema") to 3370 // unconditionally include in API requests. By default, fields with empty or 3371 // default values are omitted from API requests. See 3372 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3373 // details. 3374 ForceSendFields []string `json:"-"` 3375 // NullFields is a list of field names (e.g. "DataSchema") to include in API 3376 // requests with the JSON null value. By default, fields with empty values are 3377 // omitted from API requests. See 3378 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3379 NullFields []string `json:"-"` 3380 } 3381 3382 func (s *GoogleCloudRetailV2alphaGcsSource) MarshalJSON() ([]byte, error) { 3383 type NoMethod GoogleCloudRetailV2alphaGcsSource 3384 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3385 } 3386 3387 // GoogleCloudRetailV2alphaGetDefaultBranchResponse: Response message of 3388 // CatalogService.GetDefaultBranch. 3389 type GoogleCloudRetailV2alphaGetDefaultBranchResponse struct { 3390 // Branch: Full resource name of the branch id currently set as default branch. 3391 Branch string `json:"branch,omitempty"` 3392 // Note: This corresponds to SetDefaultBranchRequest.note field, when this 3393 // branch was set as default. 3394 Note string `json:"note,omitempty"` 3395 // SetTime: The time when this branch is set to default. 3396 SetTime string `json:"setTime,omitempty"` 3397 3398 // ServerResponse contains the HTTP response code and headers from the server. 3399 googleapi.ServerResponse `json:"-"` 3400 // ForceSendFields is a list of field names (e.g. "Branch") to unconditionally 3401 // include in API requests. By default, fields with empty or default values are 3402 // omitted from API requests. See 3403 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3404 // details. 3405 ForceSendFields []string `json:"-"` 3406 // NullFields is a list of field names (e.g. "Branch") to include in API 3407 // requests with the JSON null value. By default, fields with empty values are 3408 // omitted from API requests. See 3409 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3410 NullFields []string `json:"-"` 3411 } 3412 3413 func (s *GoogleCloudRetailV2alphaGetDefaultBranchResponse) MarshalJSON() ([]byte, error) { 3414 type NoMethod GoogleCloudRetailV2alphaGetDefaultBranchResponse 3415 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3416 } 3417 3418 // GoogleCloudRetailV2alphaImage: Product image. Recommendations AI and Retail 3419 // Search do not use product images to improve prediction and search results. 3420 // However, product images can be returned in results, and are shown in 3421 // prediction or search previews in the console. 3422 type GoogleCloudRetailV2alphaImage struct { 3423 // Height: Height of the image in number of pixels. This field must be 3424 // nonnegative. Otherwise, an INVALID_ARGUMENT error is returned. 3425 Height int64 `json:"height,omitempty"` 3426 // Uri: Required. URI of the image. This field must be a valid UTF-8 encoded 3427 // URI with a length limit of 5,000 characters. Otherwise, an INVALID_ARGUMENT 3428 // error is returned. Google Merchant Center property image_link 3429 // (https://support.google.com/merchants/answer/6324350). Schema.org property 3430 // Product.image (https://schema.org/image). 3431 Uri string `json:"uri,omitempty"` 3432 // Width: Width of the image in number of pixels. This field must be 3433 // nonnegative. Otherwise, an INVALID_ARGUMENT error is returned. 3434 Width int64 `json:"width,omitempty"` 3435 // ForceSendFields is a list of field names (e.g. "Height") to unconditionally 3436 // include in API requests. By default, fields with empty or default values are 3437 // omitted from API requests. See 3438 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3439 // details. 3440 ForceSendFields []string `json:"-"` 3441 // NullFields is a list of field names (e.g. "Height") to include in API 3442 // requests with the JSON null value. By default, fields with empty values are 3443 // omitted from API requests. See 3444 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3445 NullFields []string `json:"-"` 3446 } 3447 3448 func (s *GoogleCloudRetailV2alphaImage) MarshalJSON() ([]byte, error) { 3449 type NoMethod GoogleCloudRetailV2alphaImage 3450 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3451 } 3452 3453 // GoogleCloudRetailV2alphaImportCompletionDataRequest: Request message for 3454 // ImportCompletionData methods. 3455 type GoogleCloudRetailV2alphaImportCompletionDataRequest struct { 3456 // InputConfig: Required. The desired input location of the data. 3457 InputConfig *GoogleCloudRetailV2alphaCompletionDataInputConfig `json:"inputConfig,omitempty"` 3458 // NotificationPubsubTopic: Pub/Sub topic for receiving notification. If this 3459 // field is set, when the import is finished, a notification is sent to 3460 // specified Pub/Sub topic. The message data is JSON string of a Operation. 3461 // Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. 3462 NotificationPubsubTopic string `json:"notificationPubsubTopic,omitempty"` 3463 // ForceSendFields is a list of field names (e.g. "InputConfig") to 3464 // unconditionally include in API requests. By default, fields with empty or 3465 // default values are omitted from API requests. See 3466 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3467 // details. 3468 ForceSendFields []string `json:"-"` 3469 // NullFields is a list of field names (e.g. "InputConfig") to include in API 3470 // requests with the JSON null value. By default, fields with empty values are 3471 // omitted from API requests. See 3472 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3473 NullFields []string `json:"-"` 3474 } 3475 3476 func (s *GoogleCloudRetailV2alphaImportCompletionDataRequest) MarshalJSON() ([]byte, error) { 3477 type NoMethod GoogleCloudRetailV2alphaImportCompletionDataRequest 3478 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3479 } 3480 3481 // GoogleCloudRetailV2alphaImportCompletionDataResponse: Response of the 3482 // ImportCompletionDataRequest. If the long running operation is done, this 3483 // message is returned by the google.longrunning.Operations.response field if 3484 // the operation is successful. 3485 type GoogleCloudRetailV2alphaImportCompletionDataResponse struct { 3486 // ErrorSamples: A sample of errors encountered while processing the request. 3487 ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` 3488 // ForceSendFields is a list of field names (e.g. "ErrorSamples") to 3489 // unconditionally include in API requests. By default, fields with empty or 3490 // default values are omitted from API requests. See 3491 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3492 // details. 3493 ForceSendFields []string `json:"-"` 3494 // NullFields is a list of field names (e.g. "ErrorSamples") to include in API 3495 // requests with the JSON null value. By default, fields with empty values are 3496 // omitted from API requests. See 3497 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3498 NullFields []string `json:"-"` 3499 } 3500 3501 func (s *GoogleCloudRetailV2alphaImportCompletionDataResponse) MarshalJSON() ([]byte, error) { 3502 type NoMethod GoogleCloudRetailV2alphaImportCompletionDataResponse 3503 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3504 } 3505 3506 // GoogleCloudRetailV2alphaImportErrorsConfig: Configuration of destination for 3507 // Import related errors. 3508 type GoogleCloudRetailV2alphaImportErrorsConfig struct { 3509 // GcsPrefix: Google Cloud Storage prefix for import errors. This must be an 3510 // empty, existing Cloud Storage directory. Import errors are written to 3511 // sharded files in this directory, one per line, as a JSON-encoded 3512 // `google.rpc.Status` message. 3513 GcsPrefix string `json:"gcsPrefix,omitempty"` 3514 // ForceSendFields is a list of field names (e.g. "GcsPrefix") to 3515 // unconditionally include in API requests. By default, fields with empty or 3516 // default values are omitted from API requests. See 3517 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3518 // details. 3519 ForceSendFields []string `json:"-"` 3520 // NullFields is a list of field names (e.g. "GcsPrefix") to include in API 3521 // requests with the JSON null value. By default, fields with empty values are 3522 // omitted from API requests. See 3523 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3524 NullFields []string `json:"-"` 3525 } 3526 3527 func (s *GoogleCloudRetailV2alphaImportErrorsConfig) MarshalJSON() ([]byte, error) { 3528 type NoMethod GoogleCloudRetailV2alphaImportErrorsConfig 3529 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3530 } 3531 3532 // GoogleCloudRetailV2alphaImportMetadata: Metadata related to the progress of 3533 // the Import operation. This is returned by the 3534 // google.longrunning.Operation.metadata field. 3535 type GoogleCloudRetailV2alphaImportMetadata struct { 3536 // CreateTime: Operation create time. 3537 CreateTime string `json:"createTime,omitempty"` 3538 // FailureCount: Count of entries that encountered errors while processing. 3539 FailureCount int64 `json:"failureCount,omitempty,string"` 3540 // NotificationPubsubTopic: Pub/Sub topic for receiving notification. If this 3541 // field is set, when the import is finished, a notification is sent to 3542 // specified Pub/Sub topic. The message data is JSON string of a Operation. 3543 // Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. 3544 NotificationPubsubTopic string `json:"notificationPubsubTopic,omitempty"` 3545 // RequestId: Deprecated. This field is never set. 3546 RequestId string `json:"requestId,omitempty"` 3547 // SuccessCount: Count of entries that were processed successfully. 3548 SuccessCount int64 `json:"successCount,omitempty,string"` 3549 // TransformedUserEventsMetadata: Metadata related to transform user events. 3550 TransformedUserEventsMetadata *GoogleCloudRetailV2alphaTransformedUserEventsMetadata `json:"transformedUserEventsMetadata,omitempty"` 3551 // UpdateTime: Operation last update time. If the operation is done, this is 3552 // also the finish time. 3553 UpdateTime string `json:"updateTime,omitempty"` 3554 // ForceSendFields is a list of field names (e.g. "CreateTime") to 3555 // unconditionally include in API requests. By default, fields with empty or 3556 // default values are omitted from API requests. See 3557 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3558 // details. 3559 ForceSendFields []string `json:"-"` 3560 // NullFields is a list of field names (e.g. "CreateTime") to include in API 3561 // requests with the JSON null value. By default, fields with empty values are 3562 // omitted from API requests. See 3563 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3564 NullFields []string `json:"-"` 3565 } 3566 3567 func (s *GoogleCloudRetailV2alphaImportMetadata) MarshalJSON() ([]byte, error) { 3568 type NoMethod GoogleCloudRetailV2alphaImportMetadata 3569 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3570 } 3571 3572 // GoogleCloudRetailV2alphaImportProductsRequest: Request message for Import 3573 // methods. 3574 type GoogleCloudRetailV2alphaImportProductsRequest struct { 3575 // ErrorsConfig: The desired location of errors incurred during the Import. 3576 ErrorsConfig *GoogleCloudRetailV2alphaImportErrorsConfig `json:"errorsConfig,omitempty"` 3577 // InputConfig: Required. The desired input location of the data. 3578 InputConfig *GoogleCloudRetailV2alphaProductInputConfig `json:"inputConfig,omitempty"` 3579 // NotificationPubsubTopic: Full Pub/Sub topic name for receiving notification. 3580 // If this field is set, when the import is finished, a notification is sent to 3581 // specified Pub/Sub topic. The message data is JSON string of a Operation. 3582 // Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. It has 3583 // to be within the same project as ImportProductsRequest.parent. Make sure 3584 // that both `cloud-retail-customer-data-access@system.gserviceaccount.com` and 3585 // `service-@gcp-sa-retail.iam.gserviceaccount.com` have the 3586 // `pubsub.topics.publish` IAM permission on the topic. Only supported when 3587 // ImportProductsRequest.reconciliation_mode is set to `FULL`. 3588 NotificationPubsubTopic string `json:"notificationPubsubTopic,omitempty"` 3589 // ReconciliationMode: The mode of reconciliation between existing products and 3590 // the products to be imported. Defaults to ReconciliationMode.INCREMENTAL. 3591 // 3592 // Possible values: 3593 // "RECONCILIATION_MODE_UNSPECIFIED" - Defaults to INCREMENTAL. 3594 // "INCREMENTAL" - Inserts new products or updates existing products. 3595 // "FULL" - Calculates diff and replaces the entire product dataset. Existing 3596 // products may be deleted if they are not present in the source location. 3597 ReconciliationMode string `json:"reconciliationMode,omitempty"` 3598 // RequestId: Deprecated. This field has no effect. 3599 RequestId string `json:"requestId,omitempty"` 3600 // SkipDefaultBranchProtection: If true, this performs the FULL import even if 3601 // it would delete a large proportion of the products in the default branch, 3602 // which could potentially cause outages if you have live predict/search 3603 // traffic. Only supported when ImportProductsRequest.reconciliation_mode is 3604 // set to `FULL`. 3605 SkipDefaultBranchProtection bool `json:"skipDefaultBranchProtection,omitempty"` 3606 // UpdateMask: Indicates which fields in the provided imported `products` to 3607 // update. If not set, all fields are updated. If provided, only the existing 3608 // product fields are updated. Missing products will not be created. 3609 UpdateMask string `json:"updateMask,omitempty"` 3610 // ForceSendFields is a list of field names (e.g. "ErrorsConfig") to 3611 // unconditionally include in API requests. By default, fields with empty or 3612 // default values are omitted from API requests. See 3613 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3614 // details. 3615 ForceSendFields []string `json:"-"` 3616 // NullFields is a list of field names (e.g. "ErrorsConfig") to include in API 3617 // requests with the JSON null value. By default, fields with empty values are 3618 // omitted from API requests. See 3619 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3620 NullFields []string `json:"-"` 3621 } 3622 3623 func (s *GoogleCloudRetailV2alphaImportProductsRequest) MarshalJSON() ([]byte, error) { 3624 type NoMethod GoogleCloudRetailV2alphaImportProductsRequest 3625 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3626 } 3627 3628 // GoogleCloudRetailV2alphaImportProductsResponse: Response of the 3629 // ImportProductsRequest. If the long running operation is done, then this 3630 // message is returned by the google.longrunning.Operations.response field if 3631 // the operation was successful. 3632 type GoogleCloudRetailV2alphaImportProductsResponse struct { 3633 // ErrorSamples: A sample of errors encountered while processing the request. 3634 ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` 3635 // ErrorsConfig: Echoes the destination for the complete errors in the request 3636 // if set. 3637 ErrorsConfig *GoogleCloudRetailV2alphaImportErrorsConfig `json:"errorsConfig,omitempty"` 3638 // ForceSendFields is a list of field names (e.g. "ErrorSamples") to 3639 // unconditionally include in API requests. By default, fields with empty or 3640 // default values are omitted from API requests. See 3641 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3642 // details. 3643 ForceSendFields []string `json:"-"` 3644 // NullFields is a list of field names (e.g. "ErrorSamples") to include in API 3645 // requests with the JSON null value. By default, fields with empty values are 3646 // omitted from API requests. See 3647 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3648 NullFields []string `json:"-"` 3649 } 3650 3651 func (s *GoogleCloudRetailV2alphaImportProductsResponse) MarshalJSON() ([]byte, error) { 3652 type NoMethod GoogleCloudRetailV2alphaImportProductsResponse 3653 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3654 } 3655 3656 // GoogleCloudRetailV2alphaImportUserEventsRequest: Request message for the 3657 // ImportUserEvents request. 3658 type GoogleCloudRetailV2alphaImportUserEventsRequest struct { 3659 // ErrorsConfig: The desired location of errors incurred during the Import. 3660 // Cannot be set for inline user event imports. 3661 ErrorsConfig *GoogleCloudRetailV2alphaImportErrorsConfig `json:"errorsConfig,omitempty"` 3662 // InputConfig: Required. The desired input location of the data. 3663 InputConfig *GoogleCloudRetailV2alphaUserEventInputConfig `json:"inputConfig,omitempty"` 3664 // ForceSendFields is a list of field names (e.g. "ErrorsConfig") to 3665 // unconditionally include in API requests. By default, fields with empty or 3666 // default values are omitted from API requests. See 3667 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3668 // details. 3669 ForceSendFields []string `json:"-"` 3670 // NullFields is a list of field names (e.g. "ErrorsConfig") to include in API 3671 // requests with the JSON null value. By default, fields with empty values are 3672 // omitted from API requests. See 3673 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3674 NullFields []string `json:"-"` 3675 } 3676 3677 func (s *GoogleCloudRetailV2alphaImportUserEventsRequest) MarshalJSON() ([]byte, error) { 3678 type NoMethod GoogleCloudRetailV2alphaImportUserEventsRequest 3679 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3680 } 3681 3682 // GoogleCloudRetailV2alphaImportUserEventsResponse: Response of the 3683 // ImportUserEventsRequest. If the long running operation was successful, then 3684 // this message is returned by the google.longrunning.Operations.response field 3685 // if the operation was successful. 3686 type GoogleCloudRetailV2alphaImportUserEventsResponse struct { 3687 // ErrorSamples: A sample of errors encountered while processing the request. 3688 ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` 3689 // ErrorsConfig: Echoes the destination for the complete errors if this field 3690 // was set in the request. 3691 ErrorsConfig *GoogleCloudRetailV2alphaImportErrorsConfig `json:"errorsConfig,omitempty"` 3692 // ImportSummary: Aggregated statistics of user event import status. 3693 ImportSummary *GoogleCloudRetailV2alphaUserEventImportSummary `json:"importSummary,omitempty"` 3694 // ForceSendFields is a list of field names (e.g. "ErrorSamples") to 3695 // unconditionally include in API requests. By default, fields with empty or 3696 // default values are omitted from API requests. See 3697 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3698 // details. 3699 ForceSendFields []string `json:"-"` 3700 // NullFields is a list of field names (e.g. "ErrorSamples") to include in API 3701 // requests with the JSON null value. By default, fields with empty values are 3702 // omitted from API requests. See 3703 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3704 NullFields []string `json:"-"` 3705 } 3706 3707 func (s *GoogleCloudRetailV2alphaImportUserEventsResponse) MarshalJSON() ([]byte, error) { 3708 type NoMethod GoogleCloudRetailV2alphaImportUserEventsResponse 3709 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3710 } 3711 3712 // GoogleCloudRetailV2alphaInterval: A floating point interval. 3713 type GoogleCloudRetailV2alphaInterval struct { 3714 // ExclusiveMaximum: Exclusive upper bound. 3715 ExclusiveMaximum float64 `json:"exclusiveMaximum,omitempty"` 3716 // ExclusiveMinimum: Exclusive lower bound. 3717 ExclusiveMinimum float64 `json:"exclusiveMinimum,omitempty"` 3718 // Maximum: Inclusive upper bound. 3719 Maximum float64 `json:"maximum,omitempty"` 3720 // Minimum: Inclusive lower bound. 3721 Minimum float64 `json:"minimum,omitempty"` 3722 // ForceSendFields is a list of field names (e.g. "ExclusiveMaximum") to 3723 // unconditionally include in API requests. By default, fields with empty or 3724 // default values are omitted from API requests. See 3725 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3726 // details. 3727 ForceSendFields []string `json:"-"` 3728 // NullFields is a list of field names (e.g. "ExclusiveMaximum") to include in 3729 // API requests with the JSON null value. By default, fields with empty values 3730 // are omitted from API requests. See 3731 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3732 NullFields []string `json:"-"` 3733 } 3734 3735 func (s *GoogleCloudRetailV2alphaInterval) MarshalJSON() ([]byte, error) { 3736 type NoMethod GoogleCloudRetailV2alphaInterval 3737 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3738 } 3739 3740 func (s *GoogleCloudRetailV2alphaInterval) UnmarshalJSON(data []byte) error { 3741 type NoMethod GoogleCloudRetailV2alphaInterval 3742 var s1 struct { 3743 ExclusiveMaximum gensupport.JSONFloat64 `json:"exclusiveMaximum"` 3744 ExclusiveMinimum gensupport.JSONFloat64 `json:"exclusiveMinimum"` 3745 Maximum gensupport.JSONFloat64 `json:"maximum"` 3746 Minimum gensupport.JSONFloat64 `json:"minimum"` 3747 *NoMethod 3748 } 3749 s1.NoMethod = (*NoMethod)(s) 3750 if err := json.Unmarshal(data, &s1); err != nil { 3751 return err 3752 } 3753 s.ExclusiveMaximum = float64(s1.ExclusiveMaximum) 3754 s.ExclusiveMinimum = float64(s1.ExclusiveMinimum) 3755 s.Maximum = float64(s1.Maximum) 3756 s.Minimum = float64(s1.Minimum) 3757 return nil 3758 } 3759 3760 // GoogleCloudRetailV2alphaListBranchesResponse: Response for 3761 // BranchService.ListBranches method. 3762 type GoogleCloudRetailV2alphaListBranchesResponse struct { 3763 // Branches: The Branches. 3764 Branches []*GoogleCloudRetailV2alphaBranch `json:"branches,omitempty"` 3765 3766 // ServerResponse contains the HTTP response code and headers from the server. 3767 googleapi.ServerResponse `json:"-"` 3768 // ForceSendFields is a list of field names (e.g. "Branches") to 3769 // unconditionally include in API requests. By default, fields with empty or 3770 // default values are omitted from API requests. See 3771 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3772 // details. 3773 ForceSendFields []string `json:"-"` 3774 // NullFields is a list of field names (e.g. "Branches") to include in API 3775 // requests with the JSON null value. By default, fields with empty values are 3776 // omitted from API requests. See 3777 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3778 NullFields []string `json:"-"` 3779 } 3780 3781 func (s *GoogleCloudRetailV2alphaListBranchesResponse) MarshalJSON() ([]byte, error) { 3782 type NoMethod GoogleCloudRetailV2alphaListBranchesResponse 3783 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3784 } 3785 3786 // GoogleCloudRetailV2alphaListCatalogsResponse: Response for 3787 // CatalogService.ListCatalogs method. 3788 type GoogleCloudRetailV2alphaListCatalogsResponse struct { 3789 // Catalogs: All the customer's Catalogs. 3790 Catalogs []*GoogleCloudRetailV2alphaCatalog `json:"catalogs,omitempty"` 3791 // NextPageToken: A token that can be sent as ListCatalogsRequest.page_token to 3792 // retrieve the next page. If this field is omitted, there are no subsequent 3793 // pages. 3794 NextPageToken string `json:"nextPageToken,omitempty"` 3795 3796 // ServerResponse contains the HTTP response code and headers from the server. 3797 googleapi.ServerResponse `json:"-"` 3798 // ForceSendFields is a list of field names (e.g. "Catalogs") to 3799 // unconditionally include in API requests. By default, fields with empty or 3800 // default values are omitted from API requests. See 3801 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3802 // details. 3803 ForceSendFields []string `json:"-"` 3804 // NullFields is a list of field names (e.g. "Catalogs") to include in API 3805 // requests with the JSON null value. By default, fields with empty values are 3806 // omitted from API requests. See 3807 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3808 NullFields []string `json:"-"` 3809 } 3810 3811 func (s *GoogleCloudRetailV2alphaListCatalogsResponse) MarshalJSON() ([]byte, error) { 3812 type NoMethod GoogleCloudRetailV2alphaListCatalogsResponse 3813 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3814 } 3815 3816 // GoogleCloudRetailV2alphaListControlsResponse: Response for ListControls 3817 // method. 3818 type GoogleCloudRetailV2alphaListControlsResponse struct { 3819 // Controls: All the Controls for a given catalog. 3820 Controls []*GoogleCloudRetailV2alphaControl `json:"controls,omitempty"` 3821 // NextPageToken: Pagination token, if not returned indicates the last page. 3822 NextPageToken string `json:"nextPageToken,omitempty"` 3823 3824 // ServerResponse contains the HTTP response code and headers from the server. 3825 googleapi.ServerResponse `json:"-"` 3826 // ForceSendFields is a list of field names (e.g. "Controls") to 3827 // unconditionally include in API requests. By default, fields with empty or 3828 // default values are omitted from API requests. See 3829 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3830 // details. 3831 ForceSendFields []string `json:"-"` 3832 // NullFields is a list of field names (e.g. "Controls") to include in API 3833 // requests with the JSON null value. By default, fields with empty values are 3834 // omitted from API requests. See 3835 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3836 NullFields []string `json:"-"` 3837 } 3838 3839 func (s *GoogleCloudRetailV2alphaListControlsResponse) MarshalJSON() ([]byte, error) { 3840 type NoMethod GoogleCloudRetailV2alphaListControlsResponse 3841 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3842 } 3843 3844 // GoogleCloudRetailV2alphaListEnrolledSolutionsResponse: Response for 3845 // ListEnrolledSolutions method. 3846 type GoogleCloudRetailV2alphaListEnrolledSolutionsResponse struct { 3847 // EnrolledSolutions: Retail API solutions that the project has enrolled. 3848 // 3849 // Possible values: 3850 // "SOLUTION_TYPE_UNSPECIFIED" - Default value. 3851 // "SOLUTION_TYPE_RECOMMENDATION" - Used for Recommendations AI. 3852 // "SOLUTION_TYPE_SEARCH" - Used for Retail Search. 3853 EnrolledSolutions []string `json:"enrolledSolutions,omitempty"` 3854 3855 // ServerResponse contains the HTTP response code and headers from the server. 3856 googleapi.ServerResponse `json:"-"` 3857 // ForceSendFields is a list of field names (e.g. "EnrolledSolutions") to 3858 // unconditionally include in API requests. By default, fields with empty or 3859 // default values are omitted from API requests. See 3860 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3861 // details. 3862 ForceSendFields []string `json:"-"` 3863 // NullFields is a list of field names (e.g. "EnrolledSolutions") to include in 3864 // API requests with the JSON null value. By default, fields with empty values 3865 // are omitted from API requests. See 3866 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3867 NullFields []string `json:"-"` 3868 } 3869 3870 func (s *GoogleCloudRetailV2alphaListEnrolledSolutionsResponse) MarshalJSON() ([]byte, error) { 3871 type NoMethod GoogleCloudRetailV2alphaListEnrolledSolutionsResponse 3872 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3873 } 3874 3875 // GoogleCloudRetailV2alphaListMerchantCenterAccountLinksResponse: Response for 3876 // MerchantCenterAccountLinkService.ListMerchantCenterAccountLinks method. 3877 type GoogleCloudRetailV2alphaListMerchantCenterAccountLinksResponse struct { 3878 // MerchantCenterAccountLinks: The links. 3879 MerchantCenterAccountLinks []*GoogleCloudRetailV2alphaMerchantCenterAccountLink `json:"merchantCenterAccountLinks,omitempty"` 3880 3881 // ServerResponse contains the HTTP response code and headers from the server. 3882 googleapi.ServerResponse `json:"-"` 3883 // ForceSendFields is a list of field names (e.g. "MerchantCenterAccountLinks") 3884 // to unconditionally include in API requests. By default, fields with empty or 3885 // default values are omitted from API requests. See 3886 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3887 // details. 3888 ForceSendFields []string `json:"-"` 3889 // NullFields is a list of field names (e.g. "MerchantCenterAccountLinks") to 3890 // include in API requests with the JSON null value. By default, fields with 3891 // empty values are omitted from API requests. See 3892 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3893 NullFields []string `json:"-"` 3894 } 3895 3896 func (s *GoogleCloudRetailV2alphaListMerchantCenterAccountLinksResponse) MarshalJSON() ([]byte, error) { 3897 type NoMethod GoogleCloudRetailV2alphaListMerchantCenterAccountLinksResponse 3898 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3899 } 3900 3901 // GoogleCloudRetailV2alphaListModelsResponse: Response to a ListModelRequest. 3902 type GoogleCloudRetailV2alphaListModelsResponse struct { 3903 // Models: List of Models. 3904 Models []*GoogleCloudRetailV2alphaModel `json:"models,omitempty"` 3905 // NextPageToken: Pagination token, if not returned indicates the last page. 3906 NextPageToken string `json:"nextPageToken,omitempty"` 3907 3908 // ServerResponse contains the HTTP response code and headers from the server. 3909 googleapi.ServerResponse `json:"-"` 3910 // ForceSendFields is a list of field names (e.g. "Models") to unconditionally 3911 // include in API requests. By default, fields with empty or default values are 3912 // omitted from API requests. See 3913 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3914 // details. 3915 ForceSendFields []string `json:"-"` 3916 // NullFields is a list of field names (e.g. "Models") to include in API 3917 // requests with the JSON null value. By default, fields with empty values are 3918 // omitted from API requests. See 3919 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3920 NullFields []string `json:"-"` 3921 } 3922 3923 func (s *GoogleCloudRetailV2alphaListModelsResponse) MarshalJSON() ([]byte, error) { 3924 type NoMethod GoogleCloudRetailV2alphaListModelsResponse 3925 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3926 } 3927 3928 // GoogleCloudRetailV2alphaListProductsResponse: Response message for 3929 // ProductService.ListProducts method. 3930 type GoogleCloudRetailV2alphaListProductsResponse struct { 3931 // NextPageToken: A token that can be sent as ListProductsRequest.page_token to 3932 // retrieve the next page. If this field is omitted, there are no subsequent 3933 // pages. 3934 NextPageToken string `json:"nextPageToken,omitempty"` 3935 // Products: The Products. 3936 Products []*GoogleCloudRetailV2alphaProduct `json:"products,omitempty"` 3937 // TotalSize: The total count of matched Products irrespective of pagination. 3938 // The total number of Products returned by pagination may be less than the 3939 // total_size that matches. This field is ignored if 3940 // ListProductsRequest.require_total_size is not set or 3941 // ListProductsRequest.page_token is not empty. 3942 TotalSize int64 `json:"totalSize,omitempty"` 3943 3944 // ServerResponse contains the HTTP response code and headers from the server. 3945 googleapi.ServerResponse `json:"-"` 3946 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 3947 // unconditionally include in API requests. By default, fields with empty or 3948 // default values are omitted from API requests. See 3949 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3950 // details. 3951 ForceSendFields []string `json:"-"` 3952 // NullFields is a list of field names (e.g. "NextPageToken") to include in API 3953 // requests with the JSON null value. By default, fields with empty values are 3954 // omitted from API requests. See 3955 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3956 NullFields []string `json:"-"` 3957 } 3958 3959 func (s *GoogleCloudRetailV2alphaListProductsResponse) MarshalJSON() ([]byte, error) { 3960 type NoMethod GoogleCloudRetailV2alphaListProductsResponse 3961 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3962 } 3963 3964 // GoogleCloudRetailV2alphaListServingConfigsResponse: Response for 3965 // ListServingConfigs method. 3966 type GoogleCloudRetailV2alphaListServingConfigsResponse struct { 3967 // NextPageToken: Pagination token, if not returned indicates the last page. 3968 NextPageToken string `json:"nextPageToken,omitempty"` 3969 // ServingConfigs: All the ServingConfigs for a given catalog. 3970 ServingConfigs []*GoogleCloudRetailV2alphaServingConfig `json:"servingConfigs,omitempty"` 3971 3972 // ServerResponse contains the HTTP response code and headers from the server. 3973 googleapi.ServerResponse `json:"-"` 3974 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 3975 // unconditionally include in API requests. By default, fields with empty or 3976 // default values are omitted from API requests. See 3977 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3978 // details. 3979 ForceSendFields []string `json:"-"` 3980 // NullFields is a list of field names (e.g. "NextPageToken") to include in API 3981 // requests with the JSON null value. By default, fields with empty values are 3982 // omitted from API requests. See 3983 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3984 NullFields []string `json:"-"` 3985 } 3986 3987 func (s *GoogleCloudRetailV2alphaListServingConfigsResponse) MarshalJSON() ([]byte, error) { 3988 type NoMethod GoogleCloudRetailV2alphaListServingConfigsResponse 3989 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3990 } 3991 3992 // GoogleCloudRetailV2alphaLocalInventory: The inventory information at a place 3993 // (e.g. a store) identified by a place ID. 3994 type GoogleCloudRetailV2alphaLocalInventory struct { 3995 // Attributes: Additional local inventory attributes, for example, store name, 3996 // promotion tags, etc. This field needs to pass all below criteria, otherwise 3997 // an INVALID_ARGUMENT error is returned: * At most 30 attributes are allowed. 3998 // * The key must be a UTF-8 encoded string with a length limit of 32 3999 // characters. * The key must match the pattern: `a-zA-Z0-9*`. For example, 4000 // key0LikeThis or KEY_1_LIKE_THIS. * The attribute values must be of the same 4001 // type (text or number). * Only 1 value is allowed for each attribute. * For 4002 // text values, the length limit is 256 UTF-8 characters. * The attribute does 4003 // not support search. The `searchable` field should be unset or set to false. 4004 // * The max summed total bytes of custom attribute keys and values per product 4005 // is 5MiB. 4006 Attributes map[string]GoogleCloudRetailV2alphaCustomAttribute `json:"attributes,omitempty"` 4007 // FulfillmentTypes: Input only. Supported fulfillment types. Valid fulfillment 4008 // type values include commonly used types (such as pickup in store and same 4009 // day delivery), and custom types. Customers have to map custom types to their 4010 // display names before rendering UI. Supported values: * "pickup-in-store" * 4011 // "ship-to-store" * "same-day-delivery" * "next-day-delivery" * 4012 // "custom-type-1" * "custom-type-2" * "custom-type-3" * "custom-type-4" * 4013 // "custom-type-5" If this field is set to an invalid value other than these, 4014 // an INVALID_ARGUMENT error is returned. All the elements must be distinct. 4015 // Otherwise, an INVALID_ARGUMENT error is returned. 4016 FulfillmentTypes []string `json:"fulfillmentTypes,omitempty"` 4017 // PlaceId: The place ID for the current set of inventory information. 4018 PlaceId string `json:"placeId,omitempty"` 4019 // PriceInfo: Product price and cost information. Google Merchant Center 4020 // property price (https://support.google.com/merchants/answer/6324371). 4021 PriceInfo *GoogleCloudRetailV2alphaPriceInfo `json:"priceInfo,omitempty"` 4022 // ForceSendFields is a list of field names (e.g. "Attributes") to 4023 // unconditionally include in API requests. By default, fields with empty or 4024 // default values are omitted from API requests. See 4025 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4026 // details. 4027 ForceSendFields []string `json:"-"` 4028 // NullFields is a list of field names (e.g. "Attributes") to include in API 4029 // requests with the JSON null value. By default, fields with empty values are 4030 // omitted from API requests. See 4031 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4032 NullFields []string `json:"-"` 4033 } 4034 4035 func (s *GoogleCloudRetailV2alphaLocalInventory) MarshalJSON() ([]byte, error) { 4036 type NoMethod GoogleCloudRetailV2alphaLocalInventory 4037 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4038 } 4039 4040 // GoogleCloudRetailV2alphaLoggingConfig: Project level logging config to 4041 // control what level of log will be generated and written to Cloud Logging. 4042 type GoogleCloudRetailV2alphaLoggingConfig struct { 4043 // DefaultLogGenerationRule: The log generation rule that applies by default to 4044 // all services supporting log generation. It can be overridden by 4045 // ServiceLogGenerationRule for service level control. 4046 DefaultLogGenerationRule *GoogleCloudRetailV2alphaLoggingConfigLogGenerationRule `json:"defaultLogGenerationRule,omitempty"` 4047 // Name: Required. Immutable. The name of the LoggingConfig singleton resource. 4048 // Format: projects/*/loggingConfig 4049 Name string `json:"name,omitempty"` 4050 // ServiceLogGenerationRules: Controls logging configurations more granularly 4051 // for each supported service. This overrides the default_log_generation_rule 4052 // for the services specified. For those not mentioned, they will fallback to 4053 // the default log generation rule. 4054 ServiceLogGenerationRules []*GoogleCloudRetailV2alphaLoggingConfigServiceLogGenerationRule `json:"serviceLogGenerationRules,omitempty"` 4055 4056 // ServerResponse contains the HTTP response code and headers from the server. 4057 googleapi.ServerResponse `json:"-"` 4058 // ForceSendFields is a list of field names (e.g. "DefaultLogGenerationRule") 4059 // to unconditionally include in API requests. By default, fields with empty or 4060 // default values are omitted from API requests. See 4061 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4062 // details. 4063 ForceSendFields []string `json:"-"` 4064 // NullFields is a list of field names (e.g. "DefaultLogGenerationRule") to 4065 // include in API requests with the JSON null value. By default, fields with 4066 // empty values are omitted from API requests. See 4067 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4068 NullFields []string `json:"-"` 4069 } 4070 4071 func (s *GoogleCloudRetailV2alphaLoggingConfig) MarshalJSON() ([]byte, error) { 4072 type NoMethod GoogleCloudRetailV2alphaLoggingConfig 4073 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4074 } 4075 4076 // GoogleCloudRetailV2alphaLoggingConfigLogGenerationRule: The logging 4077 // configurations for services supporting log generation. 4078 type GoogleCloudRetailV2alphaLoggingConfigLogGenerationRule struct { 4079 // InfoLogSampleRate: The log sample rate for INFO level log entries. You can 4080 // use this to reduce the number of entries generated for INFO level logs. DO 4081 // NOT set this field if the logging_level is not LoggingLevel.LOG_ALL. 4082 // Otherwise, an INVALID_ARGUMENT error is returned. Sample rate for INFO logs 4083 // defaults to 1 when unset (generate and send all INFO logs to Cloud Logging). 4084 // Its value must be greater than 0 and less than or equal to 1. 4085 InfoLogSampleRate float64 `json:"infoLogSampleRate,omitempty"` 4086 // LoggingLevel: The logging level. By default it is set to 4087 // `LOG_WARNINGS_AND_ABOVE`. 4088 // 4089 // Possible values: 4090 // "LOGGING_LEVEL_UNSPECIFIED" - Default value. Defaults to 4091 // `LOG_FOR_WARNINGS_AND_ABOVE` if unset. 4092 // "LOGGING_DISABLED" - No log will be generated and sent to Cloud Logging. 4093 // "LOG_ERRORS_AND_ABOVE" - Log for operations resulted in fatal error. 4094 // "LOG_WARNINGS_AND_ABOVE" - In addition to `LOG_ERRORS_AND_ABOVE`, also log 4095 // for operations that have soft errors, quality suggestions. 4096 // "LOG_ALL" - Log all operations, including successful ones. 4097 LoggingLevel string `json:"loggingLevel,omitempty"` 4098 // ForceSendFields is a list of field names (e.g. "InfoLogSampleRate") to 4099 // unconditionally include in API requests. By default, fields with empty or 4100 // default values are omitted from API requests. See 4101 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4102 // details. 4103 ForceSendFields []string `json:"-"` 4104 // NullFields is a list of field names (e.g. "InfoLogSampleRate") to include in 4105 // API requests with the JSON null value. By default, fields with empty values 4106 // are omitted from API requests. See 4107 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4108 NullFields []string `json:"-"` 4109 } 4110 4111 func (s *GoogleCloudRetailV2alphaLoggingConfigLogGenerationRule) MarshalJSON() ([]byte, error) { 4112 type NoMethod GoogleCloudRetailV2alphaLoggingConfigLogGenerationRule 4113 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4114 } 4115 4116 func (s *GoogleCloudRetailV2alphaLoggingConfigLogGenerationRule) UnmarshalJSON(data []byte) error { 4117 type NoMethod GoogleCloudRetailV2alphaLoggingConfigLogGenerationRule 4118 var s1 struct { 4119 InfoLogSampleRate gensupport.JSONFloat64 `json:"infoLogSampleRate"` 4120 *NoMethod 4121 } 4122 s1.NoMethod = (*NoMethod)(s) 4123 if err := json.Unmarshal(data, &s1); err != nil { 4124 return err 4125 } 4126 s.InfoLogSampleRate = float64(s1.InfoLogSampleRate) 4127 return nil 4128 } 4129 4130 // GoogleCloudRetailV2alphaLoggingConfigServiceLogGenerationRule: The granular 4131 // logging configurations for supported services. 4132 type GoogleCloudRetailV2alphaLoggingConfigServiceLogGenerationRule struct { 4133 // LogGenerationRule: The log generation rule that applies to this service. 4134 LogGenerationRule *GoogleCloudRetailV2alphaLoggingConfigLogGenerationRule `json:"logGenerationRule,omitempty"` 4135 // ServiceName: Required. Supported service names: "CatalogService", 4136 // "CompletionService", "ControlService", "MerchantCenterStreaming", 4137 // "ModelService", "PredictionService", "ProductService", 4138 // "ServingConfigService", "UserEventService", 4139 ServiceName string `json:"serviceName,omitempty"` 4140 // ForceSendFields is a list of field names (e.g. "LogGenerationRule") to 4141 // unconditionally include in API requests. By default, fields with empty or 4142 // default values are omitted from API requests. See 4143 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4144 // details. 4145 ForceSendFields []string `json:"-"` 4146 // NullFields is a list of field names (e.g. "LogGenerationRule") to include in 4147 // API requests with the JSON null value. By default, fields with empty values 4148 // are omitted from API requests. See 4149 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4150 NullFields []string `json:"-"` 4151 } 4152 4153 func (s *GoogleCloudRetailV2alphaLoggingConfigServiceLogGenerationRule) MarshalJSON() ([]byte, error) { 4154 type NoMethod GoogleCloudRetailV2alphaLoggingConfigServiceLogGenerationRule 4155 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4156 } 4157 4158 // GoogleCloudRetailV2alphaMerchantCenterAccountLink: Represents a link between 4159 // a Merchant Center account and a branch. After a link is established, 4160 // products from the linked Merchant Center account are streamed to the linked 4161 // branch. 4162 type GoogleCloudRetailV2alphaMerchantCenterAccountLink struct { 4163 // BranchId: Required. The branch ID (e.g. 0/1/2) within the catalog that 4164 // products from merchant_center_account_id are streamed to. When updating this 4165 // field, an empty value will use the currently configured default branch. 4166 // However, changing the default branch later on won't change the linked branch 4167 // here. A single branch ID can only have one linked Merchant Center account 4168 // ID. 4169 BranchId string `json:"branchId,omitempty"` 4170 // FeedFilters: Criteria for the Merchant Center feeds to be ingested via the 4171 // link. All offers will be ingested if the list is empty. Otherwise the offers 4172 // will be ingested from selected feeds. 4173 FeedFilters []*GoogleCloudRetailV2alphaMerchantCenterAccountLinkMerchantCenterFeedFilter `json:"feedFilters,omitempty"` 4174 // FeedLabel: The FeedLabel used to perform filtering. Note: this replaces 4175 // region_id 4176 // (https://developers.google.com/shopping-content/reference/rest/v2.1/products#Product.FIELDS.feed_label). 4177 // Example value: `US`. Example value: `FeedLabel1`. 4178 FeedLabel string `json:"feedLabel,omitempty"` 4179 // Id: Output only. Immutable. MerchantCenterAccountLink identifier, which is 4180 // the final component of name. This field is auto generated and follows the 4181 // convention: `BranchId_MerchantCenterAccountId`. 4182 // `projects/*/locations/global/catalogs/default_catalog/merchantCenterAccountLi 4183 // nks/id_1`. 4184 Id string `json:"id,omitempty"` 4185 // LanguageCode: Language of the title/description and other string attributes. 4186 // Use language tags defined by BCP 47 4187 // (https://www.rfc-editor.org/rfc/bcp/bcp47.txt). ISO 639-1. This specifies 4188 // the language of offers in Merchant Center that will be accepted. If empty, 4189 // no language filtering will be performed. Example value: `en`. 4190 LanguageCode string `json:"languageCode,omitempty"` 4191 // MerchantCenterAccountId: Required. The linked Merchant center account id 4192 // (https://developers.google.com/shopping-content/guides/accountstatuses). The 4193 // account must be a standalone account or a sub-account of a MCA. 4194 MerchantCenterAccountId int64 `json:"merchantCenterAccountId,omitempty,string"` 4195 // Name: Output only. Immutable. Full resource name of the Merchant Center 4196 // Account Link, such as 4197 // `projects/*/locations/global/catalogs/default_catalog/merchantCenterAccountLi 4198 // nks/merchant_center_account_link`. 4199 Name string `json:"name,omitempty"` 4200 // ProjectId: Output only. Google Cloud project ID. 4201 ProjectId string `json:"projectId,omitempty"` 4202 // Source: Optional. An optional arbitrary string that could be used as a tag 4203 // for tracking link source. 4204 Source string `json:"source,omitempty"` 4205 // State: Output only. Represents the state of the link. 4206 // 4207 // Possible values: 4208 // "STATE_UNSPECIFIED" - Default value. 4209 // "PENDING" - Link is created and LRO is not complete. 4210 // "ACTIVE" - Link is active. 4211 // "FAILED" - Link creation failed. 4212 State string `json:"state,omitempty"` 4213 // ForceSendFields is a list of field names (e.g. "BranchId") to 4214 // unconditionally include in API requests. By default, fields with empty or 4215 // default values are omitted from API requests. See 4216 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4217 // details. 4218 ForceSendFields []string `json:"-"` 4219 // NullFields is a list of field names (e.g. "BranchId") to include in API 4220 // requests with the JSON null value. By default, fields with empty values are 4221 // omitted from API requests. See 4222 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4223 NullFields []string `json:"-"` 4224 } 4225 4226 func (s *GoogleCloudRetailV2alphaMerchantCenterAccountLink) MarshalJSON() ([]byte, error) { 4227 type NoMethod GoogleCloudRetailV2alphaMerchantCenterAccountLink 4228 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4229 } 4230 4231 // GoogleCloudRetailV2alphaMerchantCenterAccountLinkMerchantCenterFeedFilter: 4232 // Merchant Center Feed filter criterion. 4233 type GoogleCloudRetailV2alphaMerchantCenterAccountLinkMerchantCenterFeedFilter struct { 4234 // PrimaryFeedId: Merchant Center primary feed ID. 4235 PrimaryFeedId int64 `json:"primaryFeedId,omitempty,string"` 4236 // PrimaryFeedName: Merchant Center primary feed name. The name is used for the 4237 // display purposes only. 4238 PrimaryFeedName string `json:"primaryFeedName,omitempty"` 4239 // ForceSendFields is a list of field names (e.g. "PrimaryFeedId") to 4240 // unconditionally include in API requests. By default, fields with empty or 4241 // default values are omitted from API requests. See 4242 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4243 // details. 4244 ForceSendFields []string `json:"-"` 4245 // NullFields is a list of field names (e.g. "PrimaryFeedId") to include in API 4246 // requests with the JSON null value. By default, fields with empty values are 4247 // omitted from API requests. See 4248 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4249 NullFields []string `json:"-"` 4250 } 4251 4252 func (s *GoogleCloudRetailV2alphaMerchantCenterAccountLinkMerchantCenterFeedFilter) MarshalJSON() ([]byte, error) { 4253 type NoMethod GoogleCloudRetailV2alphaMerchantCenterAccountLinkMerchantCenterFeedFilter 4254 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4255 } 4256 4257 // GoogleCloudRetailV2alphaMerchantCenterFeedFilter: Merchant Center Feed 4258 // filter criterion. 4259 type GoogleCloudRetailV2alphaMerchantCenterFeedFilter struct { 4260 // PrimaryFeedId: Merchant Center primary feed ID. 4261 PrimaryFeedId int64 `json:"primaryFeedId,omitempty,string"` 4262 // PrimaryFeedName: Merchant Center primary feed name. The name is used for the 4263 // display purposes only. 4264 PrimaryFeedName string `json:"primaryFeedName,omitempty"` 4265 // ForceSendFields is a list of field names (e.g. "PrimaryFeedId") to 4266 // unconditionally include in API requests. By default, fields with empty or 4267 // default values are omitted from API requests. See 4268 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4269 // details. 4270 ForceSendFields []string `json:"-"` 4271 // NullFields is a list of field names (e.g. "PrimaryFeedId") to include in API 4272 // requests with the JSON null value. By default, fields with empty values are 4273 // omitted from API requests. See 4274 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4275 NullFields []string `json:"-"` 4276 } 4277 4278 func (s *GoogleCloudRetailV2alphaMerchantCenterFeedFilter) MarshalJSON() ([]byte, error) { 4279 type NoMethod GoogleCloudRetailV2alphaMerchantCenterFeedFilter 4280 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4281 } 4282 4283 // GoogleCloudRetailV2alphaMerchantCenterLink: Represents a link between a 4284 // Merchant Center account and a branch. After a link is established, products 4285 // from the linked Merchant Center account are streamed to the linked branch. 4286 type GoogleCloudRetailV2alphaMerchantCenterLink struct { 4287 // BranchId: The branch ID (e.g. 0/1/2) within this catalog that products from 4288 // merchant_center_account_id are streamed to. When updating this field, an 4289 // empty value will use the currently configured default branch. However, 4290 // changing the default branch later on won't change the linked branch here. A 4291 // single branch ID can only have one linked Merchant Center account ID. 4292 BranchId string `json:"branchId,omitempty"` 4293 // Destinations: String representing the destination to import for, all if left 4294 // empty. List of possible values is given in Included destination 4295 // (https://support.google.com/merchants/answer/7501026). List of allowed 4296 // string values: "Shopping_ads", "Buy_on_google_listings", "Display_ads", 4297 // "Local_inventory _ads", "Free_listings", "Free_local_listings" NOTE: The 4298 // string values are case sensitive. 4299 Destinations []string `json:"destinations,omitempty"` 4300 // Feeds: Criteria for the Merchant Center feeds to be ingested via the link. 4301 // All offers will be ingested if the list is empty. Otherwise the offers will 4302 // be ingested from selected feeds. 4303 Feeds []*GoogleCloudRetailV2alphaMerchantCenterFeedFilter `json:"feeds,omitempty"` 4304 // LanguageCode: Language of the title/description and other string attributes. 4305 // Use language tags defined by BCP 47 4306 // (https://www.rfc-editor.org/rfc/bcp/bcp47.txt). ISO 639-1. This specifies 4307 // the language of offers in Merchant Center that will be accepted. If empty no 4308 // language filtering will be performed. Example value: `en`. 4309 LanguageCode string `json:"languageCode,omitempty"` 4310 // MerchantCenterAccountId: Required. The linked Merchant Center account ID 4311 // (https://developers.google.com/shopping-content/guides/accountstatuses). The 4312 // account must be a standalone account or a sub-account of a MCA. 4313 MerchantCenterAccountId int64 `json:"merchantCenterAccountId,omitempty,string"` 4314 // RegionCode: Region code of offers to accept. 2-letter Uppercase ISO 3166-1 4315 // alpha-2 code. List of values can be found here 4316 // (https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry) 4317 // under the `region` tag. If left blank no region filtering will be performed. 4318 // Example value: `US`. 4319 RegionCode string `json:"regionCode,omitempty"` 4320 // ForceSendFields is a list of field names (e.g. "BranchId") to 4321 // unconditionally include in API requests. By default, fields with empty or 4322 // default values are omitted from API requests. See 4323 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4324 // details. 4325 ForceSendFields []string `json:"-"` 4326 // NullFields is a list of field names (e.g. "BranchId") to include in API 4327 // requests with the JSON null value. By default, fields with empty values are 4328 // omitted from API requests. See 4329 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4330 NullFields []string `json:"-"` 4331 } 4332 4333 func (s *GoogleCloudRetailV2alphaMerchantCenterLink) MarshalJSON() ([]byte, error) { 4334 type NoMethod GoogleCloudRetailV2alphaMerchantCenterLink 4335 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4336 } 4337 4338 // GoogleCloudRetailV2alphaMerchantCenterLinkingConfig: Configures Merchant 4339 // Center linking. Links contained in the config will be used to sync data from 4340 // a Merchant Center account to a Cloud Retail branch. 4341 type GoogleCloudRetailV2alphaMerchantCenterLinkingConfig struct { 4342 // Links: Links between Merchant Center accounts and branches. 4343 Links []*GoogleCloudRetailV2alphaMerchantCenterLink `json:"links,omitempty"` 4344 // ForceSendFields is a list of field names (e.g. "Links") to unconditionally 4345 // include in API requests. By default, fields with empty or default values are 4346 // omitted from API requests. See 4347 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4348 // details. 4349 ForceSendFields []string `json:"-"` 4350 // NullFields is a list of field names (e.g. "Links") to include in API 4351 // requests with the JSON null value. By default, fields with empty values are 4352 // omitted from API requests. See 4353 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4354 NullFields []string `json:"-"` 4355 } 4356 4357 func (s *GoogleCloudRetailV2alphaMerchantCenterLinkingConfig) MarshalJSON() ([]byte, error) { 4358 type NoMethod GoogleCloudRetailV2alphaMerchantCenterLinkingConfig 4359 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4360 } 4361 4362 // GoogleCloudRetailV2alphaModel: Metadata that describes the training and 4363 // serving parameters of a Model. A Model can be associated with a 4364 // ServingConfig and then queried through the Predict API. 4365 type GoogleCloudRetailV2alphaModel struct { 4366 // CreateTime: Output only. Timestamp the Recommendation Model was created at. 4367 CreateTime string `json:"createTime,omitempty"` 4368 // DataState: Output only. The state of data requirements for this model: 4369 // `DATA_OK` and `DATA_ERROR`. Recommendation model cannot be trained if the 4370 // data is in `DATA_ERROR` state. Recommendation model can have `DATA_ERROR` 4371 // state even if serving state is `ACTIVE`: models were trained successfully 4372 // before, but cannot be refreshed because model no longer has sufficient data 4373 // for training. 4374 // 4375 // Possible values: 4376 // "DATA_STATE_UNSPECIFIED" - Unspecified default value, should never be 4377 // explicitly set. 4378 // "DATA_OK" - The model has sufficient training data. 4379 // "DATA_ERROR" - The model does not have sufficient training data. Error 4380 // messages can be queried via Stackdriver. 4381 DataState string `json:"dataState,omitempty"` 4382 // DisplayName: Required. The display name of the model. Should be human 4383 // readable, used to display Recommendation Models in the Retail Cloud Console 4384 // Dashboard. UTF-8 encoded string with limit of 1024 characters. 4385 DisplayName string `json:"displayName,omitempty"` 4386 // FilteringOption: Optional. If `RECOMMENDATIONS_FILTERING_ENABLED`, 4387 // recommendation filtering by attributes is enabled for the model. 4388 // 4389 // Possible values: 4390 // "RECOMMENDATIONS_FILTERING_OPTION_UNSPECIFIED" - Value used when unset. In 4391 // this case, server behavior defaults to RECOMMENDATIONS_FILTERING_DISABLED. 4392 // "RECOMMENDATIONS_FILTERING_DISABLED" - Recommendation filtering is 4393 // disabled. 4394 // "RECOMMENDATIONS_FILTERING_ENABLED" - Recommendation filtering is enabled. 4395 FilteringOption string `json:"filteringOption,omitempty"` 4396 // LastTuneTime: Output only. The timestamp when the latest successful tune 4397 // finished. 4398 LastTuneTime string `json:"lastTuneTime,omitempty"` 4399 // ModelFeaturesConfig: Optional. Additional model features config. 4400 ModelFeaturesConfig *GoogleCloudRetailV2alphaModelModelFeaturesConfig `json:"modelFeaturesConfig,omitempty"` 4401 // Name: Required. The fully qualified resource name of the model. Format: 4402 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/mode 4403 // ls/{model_id}` catalog_id has char limit of 50. recommendation_model_id has 4404 // char limit of 40. 4405 Name string `json:"name,omitempty"` 4406 // OptimizationObjective: Optional. The optimization objective e.g. `cvr`. 4407 // Currently supported values: `ctr`, `cvr`, `revenue-per-order`. If not 4408 // specified, we choose default based on model type. Default depends on type of 4409 // recommendation: `recommended-for-you` => `ctr` `others-you-may-like` => 4410 // `ctr` `frequently-bought-together` => `revenue_per_order` This field 4411 // together with optimization_objective describe model metadata to use to 4412 // control model training and serving. See 4413 // https://cloud.google.com/retail/docs/models for more details on what the 4414 // model metadata control and which combination of parameters are valid. For 4415 // invalid combinations of parameters (e.g. type = `frequently-bought-together` 4416 // and optimization_objective = `ctr`), you receive an error 400 if you try to 4417 // create/update a recommendation with this set of knobs. 4418 OptimizationObjective string `json:"optimizationObjective,omitempty"` 4419 // PageOptimizationConfig: Optional. The page optimization config. 4420 PageOptimizationConfig *GoogleCloudRetailV2alphaModelPageOptimizationConfig `json:"pageOptimizationConfig,omitempty"` 4421 // PeriodicTuningState: Optional. The state of periodic tuning. The period we 4422 // use is 3 months - to do a one-off tune earlier use the `TuneModel` method. 4423 // Default value is `PERIODIC_TUNING_ENABLED`. 4424 // 4425 // Possible values: 4426 // "PERIODIC_TUNING_STATE_UNSPECIFIED" - Unspecified default value, should 4427 // never be explicitly set. 4428 // "PERIODIC_TUNING_DISABLED" - The model has periodic tuning disabled. 4429 // Tuning can be reenabled by calling the `EnableModelPeriodicTuning` method or 4430 // by calling the `TuneModel` method. 4431 // "ALL_TUNING_DISABLED" - The model cannot be tuned with periodic tuning OR 4432 // the `TuneModel` method. Hide the options in customer UI and reject any 4433 // requests through the backend self serve API. 4434 // "PERIODIC_TUNING_ENABLED" - The model has periodic tuning enabled. Tuning 4435 // can be disabled by calling the `DisableModelPeriodicTuning` method. 4436 PeriodicTuningState string `json:"periodicTuningState,omitempty"` 4437 // ServingConfigLists: Output only. The list of valid serving configs 4438 // associated with the PageOptimizationConfig. 4439 ServingConfigLists []*GoogleCloudRetailV2alphaModelServingConfigList `json:"servingConfigLists,omitempty"` 4440 // ServingState: Output only. The serving state of the model: `ACTIVE`, 4441 // `NOT_ACTIVE`. 4442 // 4443 // Possible values: 4444 // "SERVING_STATE_UNSPECIFIED" - Unspecified serving state. 4445 // "INACTIVE" - The model is not serving. 4446 // "ACTIVE" - The model is serving and can be queried. 4447 // "TUNED" - The model is trained on tuned hyperparameters and can be 4448 // queried. 4449 ServingState string `json:"servingState,omitempty"` 4450 // TrainingState: Optional. The training state that the model is in (e.g. 4451 // `TRAINING` or `PAUSED`). Since part of the cost of running the service is 4452 // frequency of training - this can be used to determine when to train model in 4453 // order to control cost. If not specified: the default value for `CreateModel` 4454 // method is `TRAINING`. The default value for `UpdateModel` method is to keep 4455 // the state the same as before. 4456 // 4457 // Possible values: 4458 // "TRAINING_STATE_UNSPECIFIED" - Unspecified training state. 4459 // "PAUSED" - The model training is paused. 4460 // "TRAINING" - The model is training. 4461 TrainingState string `json:"trainingState,omitempty"` 4462 // TuningOperation: Output only. The tune operation associated with the model. 4463 // Can be used to determine if there is an ongoing tune for this 4464 // recommendation. Empty field implies no tune is goig on. 4465 TuningOperation string `json:"tuningOperation,omitempty"` 4466 // Type: Required. The type of model e.g. `home-page`. Currently supported 4467 // values: `recommended-for-you`, `others-you-may-like`, 4468 // `frequently-bought-together`, `page-optimization`, `similar-items`, 4469 // `buy-it-again`, `on-sale-items`, and `recently-viewed`(readonly value). This 4470 // field together with optimization_objective describe model metadata to use to 4471 // control model training and serving. See 4472 // https://cloud.google.com/retail/docs/models for more details on what the 4473 // model metadata control and which combination of parameters are valid. For 4474 // invalid combinations of parameters (e.g. type = `frequently-bought-together` 4475 // and optimization_objective = `ctr`), you receive an error 400 if you try to 4476 // create/update a recommendation with this set of knobs. 4477 Type string `json:"type,omitempty"` 4478 // UpdateTime: Output only. Timestamp the Recommendation Model was last 4479 // updated. E.g. if a Recommendation Model was paused - this would be the time 4480 // the pause was initiated. 4481 UpdateTime string `json:"updateTime,omitempty"` 4482 4483 // ServerResponse contains the HTTP response code and headers from the server. 4484 googleapi.ServerResponse `json:"-"` 4485 // ForceSendFields is a list of field names (e.g. "CreateTime") to 4486 // unconditionally include in API requests. By default, fields with empty or 4487 // default values are omitted from API requests. See 4488 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4489 // details. 4490 ForceSendFields []string `json:"-"` 4491 // NullFields is a list of field names (e.g. "CreateTime") to include in API 4492 // requests with the JSON null value. By default, fields with empty values are 4493 // omitted from API requests. See 4494 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4495 NullFields []string `json:"-"` 4496 } 4497 4498 func (s *GoogleCloudRetailV2alphaModel) MarshalJSON() ([]byte, error) { 4499 type NoMethod GoogleCloudRetailV2alphaModel 4500 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4501 } 4502 4503 // GoogleCloudRetailV2alphaModelFrequentlyBoughtTogetherFeaturesConfig: 4504 // Additional configs for the frequently-bought-together model type. 4505 type GoogleCloudRetailV2alphaModelFrequentlyBoughtTogetherFeaturesConfig struct { 4506 // ContextProductsType: Optional. Specifies the context of the model when it is 4507 // used in predict requests. Can only be set for the 4508 // `frequently-bought-together` type. If it isn't specified, it defaults to 4509 // MULTIPLE_CONTEXT_PRODUCTS. 4510 // 4511 // Possible values: 4512 // "CONTEXT_PRODUCTS_TYPE_UNSPECIFIED" - Unspecified default value, should 4513 // never be explicitly set. Defaults to MULTIPLE_CONTEXT_PRODUCTS. 4514 // "SINGLE_CONTEXT_PRODUCT" - Use only a single product as context for the 4515 // recommendation. Typically used on pages like add-to-cart or product details. 4516 // "MULTIPLE_CONTEXT_PRODUCTS" - Use one or multiple products as context for 4517 // the recommendation. Typically used on shopping cart pages. 4518 ContextProductsType string `json:"contextProductsType,omitempty"` 4519 // ForceSendFields is a list of field names (e.g. "ContextProductsType") to 4520 // unconditionally include in API requests. By default, fields with empty or 4521 // default values are omitted from API requests. See 4522 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4523 // details. 4524 ForceSendFields []string `json:"-"` 4525 // NullFields is a list of field names (e.g. "ContextProductsType") to include 4526 // in API requests with the JSON null value. By default, fields with empty 4527 // values are omitted from API requests. See 4528 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4529 NullFields []string `json:"-"` 4530 } 4531 4532 func (s *GoogleCloudRetailV2alphaModelFrequentlyBoughtTogetherFeaturesConfig) MarshalJSON() ([]byte, error) { 4533 type NoMethod GoogleCloudRetailV2alphaModelFrequentlyBoughtTogetherFeaturesConfig 4534 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4535 } 4536 4537 // GoogleCloudRetailV2alphaModelModelFeaturesConfig: Additional model features 4538 // config. 4539 type GoogleCloudRetailV2alphaModelModelFeaturesConfig struct { 4540 // FrequentlyBoughtTogetherConfig: Additional configs for 4541 // frequently-bought-together models. 4542 FrequentlyBoughtTogetherConfig *GoogleCloudRetailV2alphaModelFrequentlyBoughtTogetherFeaturesConfig `json:"frequentlyBoughtTogetherConfig,omitempty"` 4543 // ForceSendFields is a list of field names (e.g. 4544 // "FrequentlyBoughtTogetherConfig") to unconditionally include in API 4545 // requests. By default, fields with empty or default values are omitted from 4546 // API requests. See 4547 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4548 // details. 4549 ForceSendFields []string `json:"-"` 4550 // NullFields is a list of field names (e.g. "FrequentlyBoughtTogetherConfig") 4551 // to include in API requests with the JSON null value. By default, fields with 4552 // empty values are omitted from API requests. See 4553 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4554 NullFields []string `json:"-"` 4555 } 4556 4557 func (s *GoogleCloudRetailV2alphaModelModelFeaturesConfig) MarshalJSON() ([]byte, error) { 4558 type NoMethod GoogleCloudRetailV2alphaModelModelFeaturesConfig 4559 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4560 } 4561 4562 // GoogleCloudRetailV2alphaModelPageOptimizationConfig: The 4563 // PageOptimizationConfig for model training. This determines how many panels 4564 // to optimize for, and which serving configs to consider for each panel. The 4565 // purpose of this model is to optimize which ServingConfig to show on which 4566 // panels in way that optimizes the visitors shopping journey. 4567 type GoogleCloudRetailV2alphaModelPageOptimizationConfig struct { 4568 // PageOptimizationEventType: Required. The type of UserEvent this page 4569 // optimization is shown for. Each page has an associated event type - this 4570 // will be the corresponding event type for the page that the page optimization 4571 // model is used on. Supported types: * `add-to-cart`: Products being added to 4572 // cart. * `detail-page-view`: Products detail page viewed. * `home-page-view`: 4573 // Homepage viewed * `category-page-view`: Homepage viewed * 4574 // `shopping-cart-page-view`: User viewing a shopping cart. `home-page-view` 4575 // only allows models with type `recommended-for-you`. All other 4576 // page_optimization_event_type allow all Model.types. 4577 PageOptimizationEventType string `json:"pageOptimizationEventType,omitempty"` 4578 // Panels: Required. A list of panel configurations. Limit = 5. 4579 Panels []*GoogleCloudRetailV2alphaModelPageOptimizationConfigPanel `json:"panels,omitempty"` 4580 // Restriction: Optional. How to restrict results across panels e.g. can the 4581 // same ServingConfig be shown on multiple panels at once. If unspecified, 4582 // default to `UNIQUE_MODEL_RESTRICTION`. 4583 // 4584 // Possible values: 4585 // "RESTRICTION_UNSPECIFIED" - Unspecified value for restriction. 4586 // "NO_RESTRICTION" - Allow any ServingConfig to be show on any number of 4587 // panels. Example: `Panel1 candidates`: pdp_ctr, pdp_cvr, 4588 // home_page_ctr_no_diversity `Panel2 candidates`: home_page_ctr_no_diversity, 4589 // home_page_ctr_diversity, pdp_cvr_no_diversity `Restriction` = NO_RESTRICTION 4590 // `Valid combinations`: * * (pdp_ctr, home_page_ctr_no_diversity) * (pdp_ctr, 4591 // home_page_ctr_diversity) * (pdp_ctr, pdp_cvr_no_diversity) * (pdp_cvr, 4592 // home_page_ctr_no_diversity) * (pdp_cvr, home_page_ctr_diversity) * (pdp_cvr, 4593 // pdp_cvr_no_diversity) * (home_page_ctr_no_diversity, 4594 // home_page_ctr_no_diversity) * (home_page_ctr_no_diversity, 4595 // home_page_ctr_diversity) * (home_page_ctr_no_diversity, 4596 // pdp_cvr_no_diversity) * `Invalid combinations`: [] 4597 // "UNIQUE_SERVING_CONFIG_RESTRICTION" - Do not allow the same 4598 // ServingConfig.name to be shown on multiple panels. Example: `Panel1 4599 // candidates`: * pdp_ctr, pdp_cvr, home_page_ctr_no_diversity * `Panel2 4600 // candidates`: * home_page_ctr_no_diversity, home_page_ctr_diversity_low, 4601 // pdp_cvr_no_diversity * `Restriction` = `UNIQUE_SERVING_CONFIG_RESTRICTION` 4602 // `Valid combinations`: * * (pdp_ctr, home_page_ctr_no_diversity) * (pdp_ctr, 4603 // home_page_ctr_diversity_low) * (pdp_ctr, pdp_cvr_no_diversity) * (pdp_ctr, 4604 // pdp_cvr_no_diversity) * (pdp_cvr, home_page_ctr_no_diversity) * (pdp_cvr, 4605 // home_page_ctr_diversity_low) * (pdp_cvr, pdp_cvr_no_diversity) * 4606 // (home_page_ctr_no_diversity, home_page_ctr_diversity_low) * 4607 // (home_page_ctr_no_diversity, pdp_cvr_no_diversity) * `Invalid combinations`: 4608 // * * (home_page_ctr_no_diversity, home_page_ctr_no_diversity) * 4609 // "UNIQUE_MODEL_RESTRICTION" - Do not allow multiple ServingConfigs with 4610 // same Model.name to be show on on different panels. Example: `Panel1 4611 // candidates`: * pdp_ctr, pdp_cvr, home_page_ctr_no_diversity * `Panel2 4612 // candidates`: * home_page_ctr_no_diversity, home_page_ctr_diversity_low, 4613 // pdp_cvr_no_diversity * `Restriction` = `UNIQUE_MODEL_RESTRICTION` `Valid 4614 // combinations`: * * (pdp_ctr, home_page_ctr_no_diversity) * (pdp_ctr, 4615 // home_page_ctr_diversity) * (pdp_ctr, pdp_cvr_no_diversity) * (pdp_ctr, 4616 // pdp_cvr_no_diversity) * (pdp_cvr, home_page_ctr_no_diversity) * (pdp_cvr, 4617 // home_page_ctr_diversity_low) * (home_page_ctr_no_diversity, 4618 // pdp_cvr_no_diversity) * `Invalid combinations`: * * 4619 // (home_page_ctr_no_diversity, home_page_ctr_no_diversity) * (pdp_cvr, 4620 // pdp_cvr_no_diversity) * 4621 // "UNIQUE_MODEL_TYPE_RESTRICTION" - Do not allow multiple ServingConfigs 4622 // with same Model.type to be shown on different panels. Example: `Panel1 4623 // candidates`: * pdp_ctr, pdp_cvr, home_page_ctr_no_diversity * `Panel2 4624 // candidates`: * home_page_ctr_no_diversity, home_page_ctr_diversity_low, 4625 // pdp_cvr_no_diversity * `Restriction` = `UNIQUE_MODEL_RESTRICTION` `Valid 4626 // combinations`: * * (pdp_ctr, home_page_ctr_no_diversity) * (pdp_ctr, 4627 // home_page_ctr_diversity) * (pdp_cvr, home_page_ctr_no_diversity) * (pdp_cvr, 4628 // home_page_ctr_diversity_low) * (home_page_ctr_no_diversity, 4629 // pdp_cvr_no_diversity) * `Invalid combinations`: * * (pdp_ctr, 4630 // pdp_cvr_no_diversity) * (pdp_ctr, pdp_cvr_no_diversity) * (pdp_cvr, 4631 // pdp_cvr_no_diversity) * (home_page_ctr_no_diversity, 4632 // home_page_ctr_no_diversity) * (home_page_ctr_no_diversity, 4633 // home_page_ctr_diversity) * 4634 Restriction string `json:"restriction,omitempty"` 4635 // ForceSendFields is a list of field names (e.g. "PageOptimizationEventType") 4636 // to unconditionally include in API requests. By default, fields with empty or 4637 // default values are omitted from API requests. See 4638 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4639 // details. 4640 ForceSendFields []string `json:"-"` 4641 // NullFields is a list of field names (e.g. "PageOptimizationEventType") to 4642 // include in API requests with the JSON null value. By default, fields with 4643 // empty values are omitted from API requests. See 4644 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4645 NullFields []string `json:"-"` 4646 } 4647 4648 func (s *GoogleCloudRetailV2alphaModelPageOptimizationConfig) MarshalJSON() ([]byte, error) { 4649 type NoMethod GoogleCloudRetailV2alphaModelPageOptimizationConfig 4650 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4651 } 4652 4653 // GoogleCloudRetailV2alphaModelPageOptimizationConfigCandidate: A candidate to 4654 // consider for a given panel. Currently only ServingConfig are valid 4655 // candidates. 4656 type GoogleCloudRetailV2alphaModelPageOptimizationConfigCandidate struct { 4657 // ServingConfigId: This has to be a valid ServingConfig identifier. For 4658 // example, for a ServingConfig with full name: 4659 // `projects/*/locations/global/catalogs/default_catalog/servingConfigs/my_candi 4660 // date_config`, this would be `my_candidate_config`. 4661 ServingConfigId string `json:"servingConfigId,omitempty"` 4662 // ForceSendFields is a list of field names (e.g. "ServingConfigId") to 4663 // unconditionally include in API requests. By default, fields with empty or 4664 // default values are omitted from API requests. See 4665 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4666 // details. 4667 ForceSendFields []string `json:"-"` 4668 // NullFields is a list of field names (e.g. "ServingConfigId") to include in 4669 // API requests with the JSON null value. By default, fields with empty values 4670 // are omitted from API requests. See 4671 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4672 NullFields []string `json:"-"` 4673 } 4674 4675 func (s *GoogleCloudRetailV2alphaModelPageOptimizationConfigCandidate) MarshalJSON() ([]byte, error) { 4676 type NoMethod GoogleCloudRetailV2alphaModelPageOptimizationConfigCandidate 4677 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4678 } 4679 4680 // GoogleCloudRetailV2alphaModelPageOptimizationConfigPanel: An individual 4681 // panel with a list of ServingConfigs to consider for it. 4682 type GoogleCloudRetailV2alphaModelPageOptimizationConfigPanel struct { 4683 // Candidates: Required. The candidates to consider on the panel. 4684 Candidates []*GoogleCloudRetailV2alphaModelPageOptimizationConfigCandidate `json:"candidates,omitempty"` 4685 // DefaultCandidate: Required. The default candidate. If the model fails at 4686 // serving time, we fall back to the default. 4687 DefaultCandidate *GoogleCloudRetailV2alphaModelPageOptimizationConfigCandidate `json:"defaultCandidate,omitempty"` 4688 // DisplayName: Optional. The name to display for the panel. 4689 DisplayName string `json:"displayName,omitempty"` 4690 // ForceSendFields is a list of field names (e.g. "Candidates") to 4691 // unconditionally include in API requests. By default, fields with empty or 4692 // default values are omitted from API requests. See 4693 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4694 // details. 4695 ForceSendFields []string `json:"-"` 4696 // NullFields is a list of field names (e.g. "Candidates") to include in API 4697 // requests with the JSON null value. By default, fields with empty values are 4698 // omitted from API requests. See 4699 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4700 NullFields []string `json:"-"` 4701 } 4702 4703 func (s *GoogleCloudRetailV2alphaModelPageOptimizationConfigPanel) MarshalJSON() ([]byte, error) { 4704 type NoMethod GoogleCloudRetailV2alphaModelPageOptimizationConfigPanel 4705 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4706 } 4707 4708 // GoogleCloudRetailV2alphaModelServingConfigList: Represents an ordered 4709 // combination of valid serving configs, which can be used for 4710 // `PAGE_OPTIMIZATION` recommendations. 4711 type GoogleCloudRetailV2alphaModelServingConfigList struct { 4712 // ServingConfigIds: Optional. A set of valid serving configs that may be used 4713 // for `PAGE_OPTIMIZATION`. 4714 ServingConfigIds []string `json:"servingConfigIds,omitempty"` 4715 // ForceSendFields is a list of field names (e.g. "ServingConfigIds") to 4716 // unconditionally include in API requests. By default, fields with empty or 4717 // default values are omitted from API requests. See 4718 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4719 // details. 4720 ForceSendFields []string `json:"-"` 4721 // NullFields is a list of field names (e.g. "ServingConfigIds") to include in 4722 // API requests with the JSON null value. By default, fields with empty values 4723 // are omitted from API requests. See 4724 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4725 NullFields []string `json:"-"` 4726 } 4727 4728 func (s *GoogleCloudRetailV2alphaModelServingConfigList) MarshalJSON() ([]byte, error) { 4729 type NoMethod GoogleCloudRetailV2alphaModelServingConfigList 4730 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4731 } 4732 4733 // GoogleCloudRetailV2alphaOutputConfig: The output configuration setting. 4734 type GoogleCloudRetailV2alphaOutputConfig struct { 4735 // BigqueryDestination: The BigQuery location where the output is to be written 4736 // to. 4737 BigqueryDestination *GoogleCloudRetailV2alphaOutputConfigBigQueryDestination `json:"bigqueryDestination,omitempty"` 4738 // GcsDestination: The Google Cloud Storage location where the output is to be 4739 // written to. 4740 GcsDestination *GoogleCloudRetailV2alphaOutputConfigGcsDestination `json:"gcsDestination,omitempty"` 4741 // ForceSendFields is a list of field names (e.g. "BigqueryDestination") to 4742 // unconditionally include in API requests. By default, fields with empty or 4743 // default values are omitted from API requests. See 4744 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4745 // details. 4746 ForceSendFields []string `json:"-"` 4747 // NullFields is a list of field names (e.g. "BigqueryDestination") to include 4748 // in API requests with the JSON null value. By default, fields with empty 4749 // values are omitted from API requests. See 4750 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4751 NullFields []string `json:"-"` 4752 } 4753 4754 func (s *GoogleCloudRetailV2alphaOutputConfig) MarshalJSON() ([]byte, error) { 4755 type NoMethod GoogleCloudRetailV2alphaOutputConfig 4756 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4757 } 4758 4759 // GoogleCloudRetailV2alphaOutputConfigBigQueryDestination: The BigQuery output 4760 // destination configuration. 4761 type GoogleCloudRetailV2alphaOutputConfigBigQueryDestination struct { 4762 // DatasetId: Required. The ID of a BigQuery Dataset. 4763 DatasetId string `json:"datasetId,omitempty"` 4764 // TableIdPrefix: Required. The prefix of exported BigQuery tables. 4765 TableIdPrefix string `json:"tableIdPrefix,omitempty"` 4766 // TableType: Required. Describes the table type. The following values are 4767 // supported: * `table`: A BigQuery native table. * `view`: A virtual table 4768 // defined by a SQL query. 4769 TableType string `json:"tableType,omitempty"` 4770 // ForceSendFields is a list of field names (e.g. "DatasetId") to 4771 // unconditionally include in API requests. By default, fields with empty or 4772 // default values are omitted from API requests. See 4773 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4774 // details. 4775 ForceSendFields []string `json:"-"` 4776 // NullFields is a list of field names (e.g. "DatasetId") to include in API 4777 // requests with the JSON null value. By default, fields with empty values are 4778 // omitted from API requests. See 4779 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4780 NullFields []string `json:"-"` 4781 } 4782 4783 func (s *GoogleCloudRetailV2alphaOutputConfigBigQueryDestination) MarshalJSON() ([]byte, error) { 4784 type NoMethod GoogleCloudRetailV2alphaOutputConfigBigQueryDestination 4785 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4786 } 4787 4788 // GoogleCloudRetailV2alphaOutputConfigGcsDestination: The Google Cloud Storage 4789 // output destination configuration. 4790 type GoogleCloudRetailV2alphaOutputConfigGcsDestination struct { 4791 // OutputUriPrefix: Required. The output uri prefix for saving output data to 4792 // json files. Some mapping examples are as follows: output_uri_prefix sample 4793 // output(assuming the object is foo.json) ======================== 4794 // ============================================= gs://bucket/ 4795 // gs://bucket/foo.json gs://bucket/folder/ gs://bucket/folder/foo.json 4796 // gs://bucket/folder/item_ gs://bucket/folder/item_foo.json 4797 OutputUriPrefix string `json:"outputUriPrefix,omitempty"` 4798 // ForceSendFields is a list of field names (e.g. "OutputUriPrefix") to 4799 // unconditionally include in API requests. By default, fields with empty or 4800 // default values are omitted from API requests. See 4801 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4802 // details. 4803 ForceSendFields []string `json:"-"` 4804 // NullFields is a list of field names (e.g. "OutputUriPrefix") to include in 4805 // API requests with the JSON null value. By default, fields with empty values 4806 // are omitted from API requests. See 4807 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4808 NullFields []string `json:"-"` 4809 } 4810 4811 func (s *GoogleCloudRetailV2alphaOutputConfigGcsDestination) MarshalJSON() ([]byte, error) { 4812 type NoMethod GoogleCloudRetailV2alphaOutputConfigGcsDestination 4813 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4814 } 4815 4816 // GoogleCloudRetailV2alphaOutputResult: Output result that stores the 4817 // information about where the exported data is stored. 4818 type GoogleCloudRetailV2alphaOutputResult struct { 4819 // BigqueryResult: The BigQuery location where the result is stored. 4820 BigqueryResult []*GoogleCloudRetailV2alphaBigQueryOutputResult `json:"bigqueryResult,omitempty"` 4821 // GcsResult: The Google Cloud Storage location where the result is stored. 4822 GcsResult []*GoogleCloudRetailV2alphaGcsOutputResult `json:"gcsResult,omitempty"` 4823 // ForceSendFields is a list of field names (e.g. "BigqueryResult") to 4824 // unconditionally include in API requests. By default, fields with empty or 4825 // default values are omitted from API requests. See 4826 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4827 // details. 4828 ForceSendFields []string `json:"-"` 4829 // NullFields is a list of field names (e.g. "BigqueryResult") to include in 4830 // API requests with the JSON null value. By default, fields with empty values 4831 // are omitted from API requests. See 4832 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4833 NullFields []string `json:"-"` 4834 } 4835 4836 func (s *GoogleCloudRetailV2alphaOutputResult) MarshalJSON() ([]byte, error) { 4837 type NoMethod GoogleCloudRetailV2alphaOutputResult 4838 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4839 } 4840 4841 // GoogleCloudRetailV2alphaPauseModelRequest: Request for pausing training of a 4842 // model. 4843 type GoogleCloudRetailV2alphaPauseModelRequest struct { 4844 } 4845 4846 // GoogleCloudRetailV2alphaPredictRequest: Request message for Predict method. 4847 type GoogleCloudRetailV2alphaPredictRequest struct { 4848 // Filter: Filter for restricting prediction results with a length limit of 4849 // 5,000 characters. Accepts values for tags and the `filterOutOfStockItems` 4850 // flag. * Tag expressions. Restricts predictions to products that match all of 4851 // the specified tags. Boolean operators `OR` and `NOT` are supported if the 4852 // expression is enclosed in parentheses, and must be separated from the tag 4853 // values by a space. `-"tagA" is also supported and is equivalent to `NOT 4854 // "tagA". Tag values must be double quoted UTF-8 encoded strings with a size 4855 // limit of 1,000 characters. Note: "Recently viewed" models don't support tag 4856 // filtering at the moment. * filterOutOfStockItems. Restricts predictions to 4857 // products that do not have a stockState value of OUT_OF_STOCK. Examples: * 4858 // tag=("Red" OR "Blue") tag="New-Arrival" tag=(NOT "promotional") * 4859 // filterOutOfStockItems tag=(-"promotional") * filterOutOfStockItems If your 4860 // filter blocks all prediction results, the API will return *no* results. If 4861 // instead you want empty result sets to return generic (unfiltered) popular 4862 // products, set `strictFiltering` to False in `PredictRequest.params`. Note 4863 // that the API will never return items with storageStatus of "EXPIRED" or 4864 // "DELETED" regardless of filter choices. If `filterSyntaxV2` is set to true 4865 // under the `params` field, then attribute-based expressions are expected 4866 // instead of the above described tag-based syntax. Examples: * (colors: 4867 // ANY("Red", "Blue")) AND NOT (categories: ANY("Phones")) * (availability: 4868 // ANY("IN_STOCK")) AND (colors: ANY("Red") OR categories: ANY("Phones")) For 4869 // more information, see Filter recommendations 4870 // (https://cloud.google.com/retail/docs/filter-recs). 4871 Filter string `json:"filter,omitempty"` 4872 // Labels: The labels applied to a resource must meet the following 4873 // requirements: * Each resource can have multiple labels, up to a maximum of 4874 // 64. * Each label must be a key-value pair. * Keys have a minimum length of 1 4875 // character and a maximum length of 63 characters and cannot be empty. Values 4876 // can be empty and have a maximum length of 63 characters. * Keys and values 4877 // can contain only lowercase letters, numeric characters, underscores, and 4878 // dashes. All characters must use UTF-8 encoding, and international characters 4879 // are allowed. * The key portion of a label must be unique. However, you can 4880 // use the same key with multiple resources. * Keys must start with a lowercase 4881 // letter or international character. See Google Cloud Document 4882 // (https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) 4883 // for more details. 4884 Labels map[string]string `json:"labels,omitempty"` 4885 // PageSize: Maximum number of results to return. Set this property to the 4886 // number of prediction results needed. If zero, the service will choose a 4887 // reasonable default. The maximum allowed value is 100. Values above 100 will 4888 // be coerced to 100. 4889 PageSize int64 `json:"pageSize,omitempty"` 4890 // PageToken: This field is not used; leave it unset. 4891 PageToken string `json:"pageToken,omitempty"` 4892 // Params: Additional domain specific parameters for the predictions. Allowed 4893 // values: * `returnProduct`: Boolean. If set to true, the associated product 4894 // object will be returned in the `results.metadata` field in the prediction 4895 // response. * `returnScore`: Boolean. If set to true, the prediction 'score' 4896 // corresponding to each returned product will be set in the `results.metadata` 4897 // field in the prediction response. The given 'score' indicates the 4898 // probability of a product being clicked/purchased given the user's context 4899 // and history. * `strictFiltering`: Boolean. True by default. If set to false, 4900 // the service will return generic (unfiltered) popular products instead of 4901 // empty if your filter blocks all prediction results. * `priceRerankLevel`: 4902 // String. Default empty. If set to be non-empty, then it needs to be one of 4903 // {'no-price-reranking', 'low-price-reranking', 'medium-price-reranking', 4904 // 'high-price-reranking'}. This gives request-level control and adjusts 4905 // prediction results based on product price. * `diversityLevel`: String. 4906 // Default empty. If set to be non-empty, then it needs to be one of 4907 // {'no-diversity', 'low-diversity', 'medium-diversity', 'high-diversity', 4908 // 'auto-diversity'}. This gives request-level control and adjusts prediction 4909 // results based on product category. * `filterSyntaxV2`: Boolean. False by 4910 // default. If set to true, the `filter` field is interpreteted according to 4911 // the new, attribute-based syntax. 4912 Params googleapi.RawMessage `json:"params,omitempty"` 4913 // UserEvent: Required. Context about the user, what they are looking at and 4914 // what action they took to trigger the predict request. Note that this user 4915 // event detail won't be ingested to userEvent logs. Thus, a separate userEvent 4916 // write request is required for event logging. Don't set UserEvent.visitor_id 4917 // or UserInfo.user_id to the same fixed ID for different users. If you are 4918 // trying to receive non-personalized recommendations (not recommended; this 4919 // can negatively impact model performance), instead set UserEvent.visitor_id 4920 // to a random unique ID and leave UserInfo.user_id unset. 4921 UserEvent *GoogleCloudRetailV2alphaUserEvent `json:"userEvent,omitempty"` 4922 // ValidateOnly: Use validate only mode for this prediction query. If set to 4923 // true, a dummy model will be used that returns arbitrary products. Note that 4924 // the validate only mode should only be used for testing the API, or if the 4925 // model is not ready. 4926 ValidateOnly bool `json:"validateOnly,omitempty"` 4927 // ForceSendFields is a list of field names (e.g. "Filter") to unconditionally 4928 // include in API requests. By default, fields with empty or default values are 4929 // omitted from API requests. See 4930 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4931 // details. 4932 ForceSendFields []string `json:"-"` 4933 // NullFields is a list of field names (e.g. "Filter") to include in API 4934 // requests with the JSON null value. By default, fields with empty values are 4935 // omitted from API requests. See 4936 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4937 NullFields []string `json:"-"` 4938 } 4939 4940 func (s *GoogleCloudRetailV2alphaPredictRequest) MarshalJSON() ([]byte, error) { 4941 type NoMethod GoogleCloudRetailV2alphaPredictRequest 4942 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4943 } 4944 4945 // GoogleCloudRetailV2alphaPredictResponse: Response message for predict 4946 // method. 4947 type GoogleCloudRetailV2alphaPredictResponse struct { 4948 // AttributionToken: A unique attribution token. This should be included in the 4949 // UserEvent logs resulting from this recommendation, which enables accurate 4950 // attribution of recommendation model performance. 4951 AttributionToken string `json:"attributionToken,omitempty"` 4952 // MissingIds: IDs of products in the request that were missing from the 4953 // inventory. 4954 MissingIds []string `json:"missingIds,omitempty"` 4955 // Results: A list of recommended products. The order represents the ranking 4956 // (from the most relevant product to the least). 4957 Results []*GoogleCloudRetailV2alphaPredictResponsePredictionResult `json:"results,omitempty"` 4958 // ValidateOnly: True if the validateOnly property was set in the request. 4959 ValidateOnly bool `json:"validateOnly,omitempty"` 4960 4961 // ServerResponse contains the HTTP response code and headers from the server. 4962 googleapi.ServerResponse `json:"-"` 4963 // ForceSendFields is a list of field names (e.g. "AttributionToken") to 4964 // unconditionally include in API requests. By default, fields with empty or 4965 // default values are omitted from API requests. See 4966 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4967 // details. 4968 ForceSendFields []string `json:"-"` 4969 // NullFields is a list of field names (e.g. "AttributionToken") to include in 4970 // API requests with the JSON null value. By default, fields with empty values 4971 // are omitted from API requests. See 4972 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4973 NullFields []string `json:"-"` 4974 } 4975 4976 func (s *GoogleCloudRetailV2alphaPredictResponse) MarshalJSON() ([]byte, error) { 4977 type NoMethod GoogleCloudRetailV2alphaPredictResponse 4978 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4979 } 4980 4981 // GoogleCloudRetailV2alphaPredictResponsePredictionResult: PredictionResult 4982 // represents the recommendation prediction results. 4983 type GoogleCloudRetailV2alphaPredictResponsePredictionResult struct { 4984 // Id: ID of the recommended product 4985 Id string `json:"id,omitempty"` 4986 // Metadata: Additional product metadata / annotations. Possible values: * 4987 // `product`: JSON representation of the product. Is set if `returnProduct` is 4988 // set to true in `PredictRequest.params`. * `score`: Prediction score in 4989 // double value. Is set if `returnScore` is set to true in 4990 // `PredictRequest.params`. 4991 Metadata googleapi.RawMessage `json:"metadata,omitempty"` 4992 // ForceSendFields is a list of field names (e.g. "Id") to unconditionally 4993 // include in API requests. By default, fields with empty or default values are 4994 // omitted from API requests. See 4995 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4996 // details. 4997 ForceSendFields []string `json:"-"` 4998 // NullFields is a list of field names (e.g. "Id") to include in API requests 4999 // with the JSON null value. By default, fields with empty values are omitted 5000 // from API requests. See 5001 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5002 NullFields []string `json:"-"` 5003 } 5004 5005 func (s *GoogleCloudRetailV2alphaPredictResponsePredictionResult) MarshalJSON() ([]byte, error) { 5006 type NoMethod GoogleCloudRetailV2alphaPredictResponsePredictionResult 5007 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5008 } 5009 5010 // GoogleCloudRetailV2alphaPriceInfo: The price information of a Product. 5011 type GoogleCloudRetailV2alphaPriceInfo struct { 5012 // Cost: The costs associated with the sale of a particular product. Used for 5013 // gross profit reporting. * Profit = price - cost Google Merchant Center 5014 // property cost_of_goods_sold 5015 // (https://support.google.com/merchants/answer/9017895). 5016 Cost float64 `json:"cost,omitempty"` 5017 // CurrencyCode: The 3-letter currency code defined in ISO 4217 5018 // (https://www.iso.org/iso-4217-currency-codes.html). If this field is an 5019 // unrecognizable currency code, an INVALID_ARGUMENT error is returned. The 5020 // Product.Type.VARIANT Products with the same Product.primary_product_id must 5021 // share the same currency_code. Otherwise, a FAILED_PRECONDITION error is 5022 // returned. 5023 CurrencyCode string `json:"currencyCode,omitempty"` 5024 // OriginalPrice: Price of the product without any discount. If zero, by 5025 // default set to be the price. If set, original_price should be greater than 5026 // or equal to price, otherwise an INVALID_ARGUMENT error is thrown. 5027 OriginalPrice float64 `json:"originalPrice,omitempty"` 5028 // Price: Price of the product. Google Merchant Center property price 5029 // (https://support.google.com/merchants/answer/6324371). Schema.org property 5030 // Offer.price (https://schema.org/price). 5031 Price float64 `json:"price,omitempty"` 5032 // PriceEffectiveTime: The timestamp when the price starts to be effective. 5033 // This can be set as a future timestamp, and the price is only used for search 5034 // after price_effective_time. If so, the original_price must be set and 5035 // original_price is used before price_effective_time. Do not set if price is 5036 // always effective because it will cause additional latency during search. 5037 PriceEffectiveTime string `json:"priceEffectiveTime,omitempty"` 5038 // PriceExpireTime: The timestamp when the price stops to be effective. The 5039 // price is used for search before price_expire_time. If this field is set, the 5040 // original_price must be set and original_price is used after 5041 // price_expire_time. Do not set if price is always effective because it will 5042 // cause additional latency during search. 5043 PriceExpireTime string `json:"priceExpireTime,omitempty"` 5044 // PriceRange: Output only. The price range of all the child 5045 // Product.Type.VARIANT Products grouped together on the Product.Type.PRIMARY 5046 // Product. Only populated for Product.Type.PRIMARY Products. Note: This field 5047 // is OUTPUT_ONLY for ProductService.GetProduct. Do not set this field in API 5048 // requests. 5049 PriceRange *GoogleCloudRetailV2alphaPriceInfoPriceRange `json:"priceRange,omitempty"` 5050 // ForceSendFields is a list of field names (e.g. "Cost") to unconditionally 5051 // include in API requests. By default, fields with empty or default values are 5052 // omitted from API requests. See 5053 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5054 // details. 5055 ForceSendFields []string `json:"-"` 5056 // NullFields is a list of field names (e.g. "Cost") to include in API requests 5057 // with the JSON null value. By default, fields with empty values are omitted 5058 // from API requests. See 5059 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5060 NullFields []string `json:"-"` 5061 } 5062 5063 func (s *GoogleCloudRetailV2alphaPriceInfo) MarshalJSON() ([]byte, error) { 5064 type NoMethod GoogleCloudRetailV2alphaPriceInfo 5065 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5066 } 5067 5068 func (s *GoogleCloudRetailV2alphaPriceInfo) UnmarshalJSON(data []byte) error { 5069 type NoMethod GoogleCloudRetailV2alphaPriceInfo 5070 var s1 struct { 5071 Cost gensupport.JSONFloat64 `json:"cost"` 5072 OriginalPrice gensupport.JSONFloat64 `json:"originalPrice"` 5073 Price gensupport.JSONFloat64 `json:"price"` 5074 *NoMethod 5075 } 5076 s1.NoMethod = (*NoMethod)(s) 5077 if err := json.Unmarshal(data, &s1); err != nil { 5078 return err 5079 } 5080 s.Cost = float64(s1.Cost) 5081 s.OriginalPrice = float64(s1.OriginalPrice) 5082 s.Price = float64(s1.Price) 5083 return nil 5084 } 5085 5086 // GoogleCloudRetailV2alphaPriceInfoPriceRange: The price range of all variant 5087 // Product having the same Product.primary_product_id. 5088 type GoogleCloudRetailV2alphaPriceInfoPriceRange struct { 5089 // OriginalPrice: The inclusive Product.pricing_info.original_price internal of 5090 // all variant Product having the same Product.primary_product_id. 5091 OriginalPrice *GoogleCloudRetailV2alphaInterval `json:"originalPrice,omitempty"` 5092 // Price: The inclusive Product.pricing_info.price interval of all variant 5093 // Product having the same Product.primary_product_id. 5094 Price *GoogleCloudRetailV2alphaInterval `json:"price,omitempty"` 5095 // ForceSendFields is a list of field names (e.g. "OriginalPrice") to 5096 // unconditionally include in API requests. By default, fields with empty or 5097 // default values are omitted from API requests. See 5098 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5099 // details. 5100 ForceSendFields []string `json:"-"` 5101 // NullFields is a list of field names (e.g. "OriginalPrice") to include in API 5102 // requests with the JSON null value. By default, fields with empty values are 5103 // omitted from API requests. See 5104 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5105 NullFields []string `json:"-"` 5106 } 5107 5108 func (s *GoogleCloudRetailV2alphaPriceInfoPriceRange) MarshalJSON() ([]byte, error) { 5109 type NoMethod GoogleCloudRetailV2alphaPriceInfoPriceRange 5110 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5111 } 5112 5113 // GoogleCloudRetailV2alphaProduct: Product captures all metadata information 5114 // of items to be recommended or searched. 5115 type GoogleCloudRetailV2alphaProduct struct { 5116 // Attributes: Highly encouraged. Extra product attributes to be included. For 5117 // example, for products, this could include the store name, vendor, style, 5118 // color, etc. These are very strong signals for recommendation model, thus we 5119 // highly recommend providing the attributes here. Features that can take on 5120 // one of a limited number of possible values. Two types of features can be set 5121 // are: Textual features. some examples would be the brand/maker of a product, 5122 // or country of a customer. Numerical features. Some examples would be the 5123 // height/weight of a product, or age of a customer. For example: `{ "vendor": 5124 // {"text": ["vendor123", "vendor456"]}, "lengths_cm": {"numbers":[2.3, 15.4]}, 5125 // "heights_cm": {"numbers":[8.1, 6.4]} }`. This field needs to pass all below 5126 // criteria, otherwise an INVALID_ARGUMENT error is returned: * Max entries 5127 // count: 200. * The key must be a UTF-8 encoded string with a length limit of 5128 // 128 characters. * For indexable attribute, the key must match the pattern: 5129 // `a-zA-Z0-9*`. For example, `key0LikeThis` or `KEY_1_LIKE_THIS`. * For text 5130 // attributes, at most 400 values are allowed. Empty values are not allowed. 5131 // Each value must be a non-empty UTF-8 encoded string with a length limit of 5132 // 256 characters. * For number attributes, at most 400 values are allowed. 5133 Attributes map[string]GoogleCloudRetailV2alphaCustomAttribute `json:"attributes,omitempty"` 5134 // Audience: The target group associated with a given audience (e.g. male, 5135 // veterans, car owners, musicians, etc.) of the product. 5136 Audience *GoogleCloudRetailV2alphaAudience `json:"audience,omitempty"` 5137 // Availability: The online availability of the Product. Default to 5138 // Availability.IN_STOCK. Corresponding properties: Google Merchant Center 5139 // property availability (https://support.google.com/merchants/answer/6324448). 5140 // Schema.org property Offer.availability (https://schema.org/availability). 5141 // 5142 // Possible values: 5143 // "AVAILABILITY_UNSPECIFIED" - Default product availability. Default to 5144 // Availability.IN_STOCK if unset. 5145 // "IN_STOCK" - Product in stock. 5146 // "OUT_OF_STOCK" - Product out of stock. 5147 // "PREORDER" - Product that is in pre-order state. 5148 // "BACKORDER" - Product that is back-ordered (i.e. temporarily out of 5149 // stock). 5150 Availability string `json:"availability,omitempty"` 5151 // AvailableQuantity: The available quantity of the item. 5152 AvailableQuantity int64 `json:"availableQuantity,omitempty"` 5153 // AvailableTime: The timestamp when this Product becomes available for 5154 // SearchService.Search. Note that this is only applicable to Type.PRIMARY and 5155 // Type.COLLECTION, and ignored for Type.VARIANT. 5156 AvailableTime string `json:"availableTime,omitempty"` 5157 // Brands: The brands of the product. A maximum of 30 brands are allowed unless 5158 // overridden through the Google Cloud console. Each brand must be a UTF-8 5159 // encoded string with a length limit of 1,000 characters. Otherwise, an 5160 // INVALID_ARGUMENT error is returned. Corresponding properties: Google 5161 // Merchant Center property brand 5162 // (https://support.google.com/merchants/answer/6324351). Schema.org property 5163 // Product.brand (https://schema.org/brand). 5164 Brands []string `json:"brands,omitempty"` 5165 // Categories: Product categories. This field is repeated for supporting one 5166 // product belonging to several parallel categories. Strongly recommended using 5167 // the full path for better search / recommendation quality. To represent full 5168 // path of category, use '>' sign to separate different hierarchies. If '>' is 5169 // part of the category name, replace it with other character(s). For example, 5170 // if a shoes product belongs to both ["Shoes & Accessories" -> "Shoes"] and 5171 // ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be 5172 // represented as: "categories": [ "Shoes & Accessories > Shoes", "Sports & 5173 // Fitness > Athletic Clothing > Shoes" ] Must be set for Type.PRIMARY Product 5174 // otherwise an INVALID_ARGUMENT error is returned. At most 250 values are 5175 // allowed per Product unless overridden through the Google Cloud console. 5176 // Empty values are not allowed. Each value must be a UTF-8 encoded string with 5177 // a length limit of 5,000 characters. Otherwise, an INVALID_ARGUMENT error is 5178 // returned. Corresponding properties: Google Merchant Center property 5179 // google_product_category. Schema.org property [Product.category] 5180 // (https://schema.org/category). [mc_google_product_category]: 5181 // https://support.google.com/merchants/answer/6324436 5182 Categories []string `json:"categories,omitempty"` 5183 // CollectionMemberIds: The id of the collection members when type is 5184 // Type.COLLECTION. Non-existent product ids are allowed. The type of the 5185 // members must be either Type.PRIMARY or Type.VARIANT otherwise an 5186 // INVALID_ARGUMENT error is thrown. Should not set it for other types. A 5187 // maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is 5188 // return. 5189 CollectionMemberIds []string `json:"collectionMemberIds,omitempty"` 5190 // ColorInfo: The color of the product. Corresponding properties: Google 5191 // Merchant Center property color 5192 // (https://support.google.com/merchants/answer/6324487). Schema.org property 5193 // Product.color (https://schema.org/color). 5194 ColorInfo *GoogleCloudRetailV2alphaColorInfo `json:"colorInfo,omitempty"` 5195 // Conditions: The condition of the product. Strongly encouraged to use the 5196 // standard values: "new", "refurbished", "used". A maximum of 1 value is 5197 // allowed per Product. Each value must be a UTF-8 encoded string with a length 5198 // limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. 5199 // Corresponding properties: Google Merchant Center property condition 5200 // (https://support.google.com/merchants/answer/6324469). Schema.org property 5201 // Offer.itemCondition (https://schema.org/itemCondition). 5202 Conditions []string `json:"conditions,omitempty"` 5203 // Description: Product description. This field must be a UTF-8 encoded string 5204 // with a length limit of 5,000 characters. Otherwise, an INVALID_ARGUMENT 5205 // error is returned. Corresponding properties: Google Merchant Center property 5206 // description (https://support.google.com/merchants/answer/6324468). 5207 // Schema.org property Product.description (https://schema.org/description). 5208 Description string `json:"description,omitempty"` 5209 // ExpireTime: Note that this field is applied in the following ways: * If the 5210 // Product is already expired when it is uploaded, this product is not indexed 5211 // for search. * If the Product is not expired when it is uploaded, only the 5212 // Type.PRIMARY's and Type.COLLECTION's expireTime is respected, and 5213 // Type.VARIANT's expireTime is not used. In general, we suggest the users to 5214 // delete the stale products explicitly, instead of using this field to 5215 // determine staleness. expire_time must be later than available_time and 5216 // publish_time, otherwise an INVALID_ARGUMENT error is thrown. Corresponding 5217 // properties: Google Merchant Center property expiration_date 5218 // (https://support.google.com/merchants/answer/6324499). 5219 ExpireTime string `json:"expireTime,omitempty"` 5220 // FulfillmentInfo: Fulfillment information, such as the store IDs for in-store 5221 // pickup or region IDs for different shipping methods. All the elements must 5222 // have distinct FulfillmentInfo.type. Otherwise, an INVALID_ARGUMENT error is 5223 // returned. 5224 FulfillmentInfo []*GoogleCloudRetailV2alphaFulfillmentInfo `json:"fulfillmentInfo,omitempty"` 5225 // Gtin: The Global Trade Item Number (GTIN) of the product. This field must be 5226 // a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an 5227 // INVALID_ARGUMENT error is returned. This field must be a Unigram. Otherwise, 5228 // an INVALID_ARGUMENT error is returned. Corresponding properties: Google 5229 // Merchant Center property gtin 5230 // (https://support.google.com/merchants/answer/6324461). Schema.org property 5231 // Product.isbn (https://schema.org/isbn), Product.gtin8 5232 // (https://schema.org/gtin8), Product.gtin12 (https://schema.org/gtin12), 5233 // Product.gtin13 (https://schema.org/gtin13), or Product.gtin14 5234 // (https://schema.org/gtin14). If the value is not a valid GTIN, an 5235 // INVALID_ARGUMENT error is returned. 5236 Gtin string `json:"gtin,omitempty"` 5237 // Id: Immutable. Product identifier, which is the final component of name. For 5238 // example, this field is "id_1", if name is 5239 // `projects/*/locations/global/catalogs/default_catalog/branches/default_branch 5240 // /products/id_1`. This field must be a UTF-8 encoded string with a length 5241 // limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. 5242 // Corresponding properties: Google Merchant Center property id 5243 // (https://support.google.com/merchants/answer/6324405). Schema.org property 5244 // Product.sku (https://schema.org/sku). 5245 Id string `json:"id,omitempty"` 5246 // Images: Product images for the product. We highly recommend putting the main 5247 // image first. A maximum of 300 images are allowed. Corresponding properties: 5248 // Google Merchant Center property image_link 5249 // (https://support.google.com/merchants/answer/6324350). Schema.org property 5250 // Product.image (https://schema.org/image). 5251 Images []*GoogleCloudRetailV2alphaImage `json:"images,omitempty"` 5252 // LanguageCode: Language of the title/description and other string attributes. 5253 // Use language tags defined by BCP 47 5254 // (https://www.rfc-editor.org/rfc/bcp/bcp47.txt). For product prediction, this 5255 // field is ignored and the model automatically detects the text language. The 5256 // Product can include text in different languages, but duplicating Products to 5257 // provide text in multiple languages can result in degraded model performance. 5258 // For product search this field is in use. It defaults to "en-US" if unset. 5259 LanguageCode string `json:"languageCode,omitempty"` 5260 // LocalInventories: Output only. A list of local inventories specific to 5261 // different places. This field can be managed by 5262 // ProductService.AddLocalInventories and ProductService.RemoveLocalInventories 5263 // APIs if fine-grained, high-volume updates are necessary. 5264 LocalInventories []*GoogleCloudRetailV2alphaLocalInventory `json:"localInventories,omitempty"` 5265 // Materials: The material of the product. For example, "leather", "wooden". A 5266 // maximum of 20 values are allowed. Each value must be a UTF-8 encoded string 5267 // with a length limit of 200 characters. Otherwise, an INVALID_ARGUMENT error 5268 // is returned. Corresponding properties: Google Merchant Center property 5269 // material (https://support.google.com/merchants/answer/6324410). Schema.org 5270 // property Product.material (https://schema.org/material). 5271 Materials []string `json:"materials,omitempty"` 5272 // Name: Immutable. Full resource name of the product, such as 5273 // `projects/*/locations/global/catalogs/default_catalog/branches/default_branch 5274 // /products/product_id`. 5275 Name string `json:"name,omitempty"` 5276 // Patterns: The pattern or graphic print of the product. For example, 5277 // "striped", "polka dot", "paisley". A maximum of 20 values are allowed per 5278 // Product. Each value must be a UTF-8 encoded string with a length limit of 5279 // 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. 5280 // Corresponding properties: Google Merchant Center property pattern 5281 // (https://support.google.com/merchants/answer/6324483). Schema.org property 5282 // Product.pattern (https://schema.org/pattern). 5283 Patterns []string `json:"patterns,omitempty"` 5284 // PriceInfo: Product price and cost information. Corresponding properties: 5285 // Google Merchant Center property price 5286 // (https://support.google.com/merchants/answer/6324371). 5287 PriceInfo *GoogleCloudRetailV2alphaPriceInfo `json:"priceInfo,omitempty"` 5288 // PrimaryProductId: Variant group identifier. Must be an id, with the same 5289 // parent branch with this product. Otherwise, an error is thrown. For 5290 // Type.PRIMARY Products, this field can only be empty or set to the same value 5291 // as id. For VARIANT Products, this field cannot be empty. A maximum of 2,000 5292 // products are allowed to share the same Type.PRIMARY Product. Otherwise, an 5293 // INVALID_ARGUMENT error is returned. Corresponding properties: Google 5294 // Merchant Center property item_group_id 5295 // (https://support.google.com/merchants/answer/6324507). Schema.org property 5296 // Product.inProductGroupWithID (https://schema.org/inProductGroupWithID). 5297 PrimaryProductId string `json:"primaryProductId,omitempty"` 5298 // Promotions: The promotions applied to the product. A maximum of 10 values 5299 // are allowed per Product. Only Promotion.promotion_id will be used, other 5300 // fields will be ignored if set. 5301 Promotions []*GoogleCloudRetailV2alphaPromotion `json:"promotions,omitempty"` 5302 // PublishTime: The timestamp when the product is published by the retailer for 5303 // the first time, which indicates the freshness of the products. Note that 5304 // this field is different from available_time, given it purely describes 5305 // product freshness regardless of when it is available on search and 5306 // recommendation. 5307 PublishTime string `json:"publishTime,omitempty"` 5308 // Rating: The rating of this product. 5309 Rating *GoogleCloudRetailV2alphaRating `json:"rating,omitempty"` 5310 // RetrievableFields: Indicates which fields in the Products are returned in 5311 // SearchResponse. Supported fields for all types: * audience * availability * 5312 // brands * color_info * conditions * gtin * materials * name * patterns * 5313 // price_info * rating * sizes * title * uri Supported fields only for 5314 // Type.PRIMARY and Type.COLLECTION: * categories * description * images 5315 // Supported fields only for Type.VARIANT: * Only the first image in images To 5316 // mark attributes as retrievable, include paths of the form "attributes.key" 5317 // where "key" is the key of a custom attribute, as specified in attributes. 5318 // For Type.PRIMARY and Type.COLLECTION, the following fields are always 5319 // returned in SearchResponse by default: * name For Type.VARIANT, the 5320 // following fields are always returned in by default: * name * color_info The 5321 // maximum number of paths is 30. Otherwise, an INVALID_ARGUMENT error is 5322 // returned. Note: Returning more fields in SearchResponse can increase 5323 // response payload size and serving latency. This field is deprecated. Use the 5324 // retrievable site-wide control instead. 5325 RetrievableFields string `json:"retrievableFields,omitempty"` 5326 // Sizes: The size of the product. To represent different size systems or size 5327 // types, consider using this format: [[[size_system:]size_type:]size_value]. 5328 // For example, in "US:MENS:M", "US" represents size system; "MENS" represents 5329 // size type; "M" represents size value. In "GIRLS:27", size system is empty; 5330 // "GIRLS" represents size type; "27" represents size value. In "32 inches", 5331 // both size system and size type are empty, while size value is "32 inches". A 5332 // maximum of 20 values are allowed per Product. Each value must be a UTF-8 5333 // encoded string with a length limit of 128 characters. Otherwise, an 5334 // INVALID_ARGUMENT error is returned. Corresponding properties: Google 5335 // Merchant Center property size 5336 // (https://support.google.com/merchants/answer/6324492), size_type 5337 // (https://support.google.com/merchants/answer/6324497), and size_system 5338 // (https://support.google.com/merchants/answer/6324502). Schema.org property 5339 // Product.size (https://schema.org/size). 5340 Sizes []string `json:"sizes,omitempty"` 5341 // Tags: Custom tags associated with the product. At most 250 values are 5342 // allowed per Product. This value must be a UTF-8 encoded string with a length 5343 // limit of 1,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. 5344 // This tag can be used for filtering recommendation results by passing the tag 5345 // as part of the PredictRequest.filter. Corresponding properties: Google 5346 // Merchant Center property custom_label_0–4 5347 // (https://support.google.com/merchants/answer/6324473). 5348 Tags []string `json:"tags,omitempty"` 5349 // Title: Required. Product title. This field must be a UTF-8 encoded string 5350 // with a length limit of 1,000 characters. Otherwise, an INVALID_ARGUMENT 5351 // error is returned. Corresponding properties: Google Merchant Center property 5352 // title (https://support.google.com/merchants/answer/6324415). Schema.org 5353 // property Product.name (https://schema.org/name). 5354 Title string `json:"title,omitempty"` 5355 // Ttl: Input only. The TTL (time to live) of the product. Note that this is 5356 // only applicable to Type.PRIMARY and Type.COLLECTION, and ignored for 5357 // Type.VARIANT. In general, we suggest the users to delete the stale products 5358 // explicitly, instead of using this field to determine staleness. If it is 5359 // set, it must be a non-negative value, and expire_time is set as current 5360 // timestamp plus ttl. The derived expire_time is returned in the output and 5361 // ttl is left blank when retrieving the Product. If it is set, the product is 5362 // not available for SearchService.Search after current timestamp plus ttl. 5363 // However, the product can still be retrieved by ProductService.GetProduct and 5364 // ProductService.ListProducts. 5365 Ttl string `json:"ttl,omitempty"` 5366 // Type: Immutable. The type of the product. Default to 5367 // Catalog.product_level_config.ingestion_product_type if unset. 5368 // 5369 // Possible values: 5370 // "TYPE_UNSPECIFIED" - Default value. Default to 5371 // Catalog.product_level_config.ingestion_product_type if unset. 5372 // "PRIMARY" - The primary type. As the primary unit for predicting, indexing 5373 // and search serving, a Type.PRIMARY Product is grouped with multiple 5374 // Type.VARIANT Products. 5375 // "VARIANT" - The variant type. Type.VARIANT Products usually share some 5376 // common attributes on the same Type.PRIMARY Products, but they have variant 5377 // attributes like different colors, sizes and prices, etc. 5378 // "COLLECTION" - The collection type. Collection products are bundled 5379 // Type.PRIMARY Products or Type.VARIANT Products that are sold together, such 5380 // as a jewelry set with necklaces, earrings and rings, etc. 5381 Type string `json:"type,omitempty"` 5382 // Uri: Canonical URL directly linking to the product detail page. It is 5383 // strongly recommended to provide a valid uri for the product, otherwise the 5384 // service performance could be significantly degraded. This field must be a 5385 // UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, an 5386 // INVALID_ARGUMENT error is returned. Corresponding properties: Google 5387 // Merchant Center property link 5388 // (https://support.google.com/merchants/answer/6324416). Schema.org property 5389 // Offer.url (https://schema.org/url). 5390 Uri string `json:"uri,omitempty"` 5391 // Variants: Output only. Product variants grouped together on primary product 5392 // which share similar product attributes. It's automatically grouped by 5393 // primary_product_id for all the product variants. Only populated for 5394 // Type.PRIMARY Products. Note: This field is OUTPUT_ONLY for 5395 // ProductService.GetProduct. Do not set this field in API requests. 5396 Variants []*GoogleCloudRetailV2alphaProduct `json:"variants,omitempty"` 5397 5398 // ServerResponse contains the HTTP response code and headers from the server. 5399 googleapi.ServerResponse `json:"-"` 5400 // ForceSendFields is a list of field names (e.g. "Attributes") to 5401 // unconditionally include in API requests. By default, fields with empty or 5402 // default values are omitted from API requests. See 5403 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5404 // details. 5405 ForceSendFields []string `json:"-"` 5406 // NullFields is a list of field names (e.g. "Attributes") to include in API 5407 // requests with the JSON null value. By default, fields with empty values are 5408 // omitted from API requests. See 5409 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5410 NullFields []string `json:"-"` 5411 } 5412 5413 func (s *GoogleCloudRetailV2alphaProduct) MarshalJSON() ([]byte, error) { 5414 type NoMethod GoogleCloudRetailV2alphaProduct 5415 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5416 } 5417 5418 // GoogleCloudRetailV2alphaProductDetail: Detailed product information 5419 // associated with a user event. 5420 type GoogleCloudRetailV2alphaProductDetail struct { 5421 // Product: Required. Product information. Required field(s): * Product.id 5422 // Optional override field(s): * Product.price_info If any supported optional 5423 // fields are provided, we will treat them as a full override when looking up 5424 // product information from the catalog. Thus, it is important to ensure that 5425 // the overriding fields are accurate and complete. All other product fields 5426 // are ignored and instead populated via catalog lookup after event ingestion. 5427 Product *GoogleCloudRetailV2alphaProduct `json:"product,omitempty"` 5428 // Quantity: Quantity of the product associated with the user event. For 5429 // example, this field will be 2 if two products are added to the shopping cart 5430 // for `purchase-complete` event. Required for `add-to-cart` and 5431 // `purchase-complete` event types. 5432 Quantity int64 `json:"quantity,omitempty"` 5433 // ForceSendFields is a list of field names (e.g. "Product") to unconditionally 5434 // include in API requests. By default, fields with empty or default values are 5435 // omitted from API requests. See 5436 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5437 // details. 5438 ForceSendFields []string `json:"-"` 5439 // NullFields is a list of field names (e.g. "Product") to include in API 5440 // requests with the JSON null value. By default, fields with empty values are 5441 // omitted from API requests. See 5442 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5443 NullFields []string `json:"-"` 5444 } 5445 5446 func (s *GoogleCloudRetailV2alphaProductDetail) MarshalJSON() ([]byte, error) { 5447 type NoMethod GoogleCloudRetailV2alphaProductDetail 5448 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5449 } 5450 5451 // GoogleCloudRetailV2alphaProductInlineSource: The inline source for the input 5452 // config for ImportProducts method. 5453 type GoogleCloudRetailV2alphaProductInlineSource struct { 5454 // Products: Required. A list of products to update/create. Each product must 5455 // have a valid Product.id. Recommended max of 100 items. 5456 Products []*GoogleCloudRetailV2alphaProduct `json:"products,omitempty"` 5457 // ForceSendFields is a list of field names (e.g. "Products") to 5458 // unconditionally include in API requests. By default, fields with empty or 5459 // default values are omitted from API requests. See 5460 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5461 // details. 5462 ForceSendFields []string `json:"-"` 5463 // NullFields is a list of field names (e.g. "Products") to include in API 5464 // requests with the JSON null value. By default, fields with empty values are 5465 // omitted from API requests. See 5466 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5467 NullFields []string `json:"-"` 5468 } 5469 5470 func (s *GoogleCloudRetailV2alphaProductInlineSource) MarshalJSON() ([]byte, error) { 5471 type NoMethod GoogleCloudRetailV2alphaProductInlineSource 5472 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5473 } 5474 5475 // GoogleCloudRetailV2alphaProductInputConfig: The input config source for 5476 // products. 5477 type GoogleCloudRetailV2alphaProductInputConfig struct { 5478 // BigQuerySource: BigQuery input source. 5479 BigQuerySource *GoogleCloudRetailV2alphaBigQuerySource `json:"bigQuerySource,omitempty"` 5480 // GcsSource: Google Cloud Storage location for the input content. 5481 GcsSource *GoogleCloudRetailV2alphaGcsSource `json:"gcsSource,omitempty"` 5482 // ProductInlineSource: The Inline source for the input content for products. 5483 ProductInlineSource *GoogleCloudRetailV2alphaProductInlineSource `json:"productInlineSource,omitempty"` 5484 // ForceSendFields is a list of field names (e.g. "BigQuerySource") to 5485 // unconditionally include in API requests. By default, fields with empty or 5486 // default values are omitted from API requests. See 5487 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5488 // details. 5489 ForceSendFields []string `json:"-"` 5490 // NullFields is a list of field names (e.g. "BigQuerySource") to include in 5491 // API requests with the JSON null value. By default, fields with empty values 5492 // are omitted from API requests. See 5493 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5494 NullFields []string `json:"-"` 5495 } 5496 5497 func (s *GoogleCloudRetailV2alphaProductInputConfig) MarshalJSON() ([]byte, error) { 5498 type NoMethod GoogleCloudRetailV2alphaProductInputConfig 5499 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5500 } 5501 5502 // GoogleCloudRetailV2alphaProductLevelConfig: Configures what level the 5503 // product should be uploaded with regards to how users will be send events and 5504 // how predictions will be made. 5505 type GoogleCloudRetailV2alphaProductLevelConfig struct { 5506 // IngestionProductType: The type of Products allowed to be ingested into the 5507 // catalog. Acceptable values are: * `primary` (default): You can ingest 5508 // Products of all types. When ingesting a Product, its type will default to 5509 // Product.Type.PRIMARY if unset. * `variant` (incompatible with Retail 5510 // Search): You can only ingest Product.Type.VARIANT Products. This means 5511 // Product.primary_product_id cannot be empty. If this field is set to an 5512 // invalid value other than these, an INVALID_ARGUMENT error is returned. If 5513 // this field is `variant` and merchant_center_product_id_field is 5514 // `itemGroupId`, an INVALID_ARGUMENT error is returned. See Product levels 5515 // (https://cloud.google.com/retail/docs/catalog#product-levels) for more 5516 // details. 5517 IngestionProductType string `json:"ingestionProductType,omitempty"` 5518 // MerchantCenterProductIdField: Which field of Merchant Center Product 5519 // (/bigquery-transfer/docs/merchant-center-products-schema) should be imported 5520 // as Product.id. Acceptable values are: * `offerId` (default): Import 5521 // `offerId` as the product ID. * `itemGroupId`: Import `itemGroupId` as the 5522 // product ID. Notice that Retail API will choose one item from the ones with 5523 // the same `itemGroupId`, and use it to represent the item group. If this 5524 // field is set to an invalid value other than these, an INVALID_ARGUMENT error 5525 // is returned. If this field is `itemGroupId` and ingestion_product_type is 5526 // `variant`, an INVALID_ARGUMENT error is returned. See Product levels 5527 // (https://cloud.google.com/retail/docs/catalog#product-levels) for more 5528 // details. 5529 MerchantCenterProductIdField string `json:"merchantCenterProductIdField,omitempty"` 5530 // ForceSendFields is a list of field names (e.g. "IngestionProductType") to 5531 // unconditionally include in API requests. By default, fields with empty or 5532 // default values are omitted from API requests. See 5533 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5534 // details. 5535 ForceSendFields []string `json:"-"` 5536 // NullFields is a list of field names (e.g. "IngestionProductType") to include 5537 // in API requests with the JSON null value. By default, fields with empty 5538 // values are omitted from API requests. See 5539 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5540 NullFields []string `json:"-"` 5541 } 5542 5543 func (s *GoogleCloudRetailV2alphaProductLevelConfig) MarshalJSON() ([]byte, error) { 5544 type NoMethod GoogleCloudRetailV2alphaProductLevelConfig 5545 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5546 } 5547 5548 // GoogleCloudRetailV2alphaProject: Metadata that describes a Cloud Retail 5549 // Project. 5550 type GoogleCloudRetailV2alphaProject struct { 5551 // EnrolledSolutions: Output only. Retail API solutions that the project has 5552 // enrolled. 5553 // 5554 // Possible values: 5555 // "SOLUTION_TYPE_UNSPECIFIED" - Default value. 5556 // "SOLUTION_TYPE_RECOMMENDATION" - Used for Recommendations AI. 5557 // "SOLUTION_TYPE_SEARCH" - Used for Retail Search. 5558 EnrolledSolutions []string `json:"enrolledSolutions,omitempty"` 5559 // Name: Output only. Full resource name of the retail project, such as 5560 // `projects/{project_id_or_number}/retailProject`. 5561 Name string `json:"name,omitempty"` 5562 5563 // ServerResponse contains the HTTP response code and headers from the server. 5564 googleapi.ServerResponse `json:"-"` 5565 // ForceSendFields is a list of field names (e.g. "EnrolledSolutions") to 5566 // unconditionally include in API requests. By default, fields with empty or 5567 // default values are omitted from API requests. See 5568 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5569 // details. 5570 ForceSendFields []string `json:"-"` 5571 // NullFields is a list of field names (e.g. "EnrolledSolutions") to include in 5572 // API requests with the JSON null value. By default, fields with empty values 5573 // are omitted from API requests. See 5574 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5575 NullFields []string `json:"-"` 5576 } 5577 5578 func (s *GoogleCloudRetailV2alphaProject) MarshalJSON() ([]byte, error) { 5579 type NoMethod GoogleCloudRetailV2alphaProject 5580 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5581 } 5582 5583 // GoogleCloudRetailV2alphaPromotion: Promotion specification. 5584 type GoogleCloudRetailV2alphaPromotion struct { 5585 // PromotionId: Promotion identifier, which is the final component of name. For 5586 // example, this field is "free_gift", if name is 5587 // `projects/*/locations/global/catalogs/default_catalog/promotions/free_gift`. 5588 // The value must be a UTF-8 encoded string with a length limit of 128 5589 // characters, and match the pattern: `a-zA-Z*`. For example, id0LikeThis or 5590 // ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is returned. 5591 // Corresponds to Google Merchant Center property promotion_id 5592 // (https://support.google.com/merchants/answer/7050148). 5593 PromotionId string `json:"promotionId,omitempty"` 5594 // ForceSendFields is a list of field names (e.g. "PromotionId") to 5595 // unconditionally include in API requests. By default, fields with empty or 5596 // default values are omitted from API requests. See 5597 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5598 // details. 5599 ForceSendFields []string `json:"-"` 5600 // NullFields is a list of field names (e.g. "PromotionId") to include in API 5601 // requests with the JSON null value. By default, fields with empty values are 5602 // omitted from API requests. See 5603 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5604 NullFields []string `json:"-"` 5605 } 5606 5607 func (s *GoogleCloudRetailV2alphaPromotion) MarshalJSON() ([]byte, error) { 5608 type NoMethod GoogleCloudRetailV2alphaPromotion 5609 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5610 } 5611 5612 // GoogleCloudRetailV2alphaPurchaseTransaction: A transaction represents the 5613 // entire purchase transaction. 5614 type GoogleCloudRetailV2alphaPurchaseTransaction struct { 5615 // Cost: All the costs associated with the products. These can be manufacturing 5616 // costs, shipping expenses not borne by the end user, or any other costs, such 5617 // that: * Profit = revenue - tax - cost 5618 Cost float64 `json:"cost,omitempty"` 5619 // CurrencyCode: Required. Currency code. Use three-character ISO-4217 code. 5620 CurrencyCode string `json:"currencyCode,omitempty"` 5621 // Id: The transaction ID with a length limit of 128 characters. 5622 Id string `json:"id,omitempty"` 5623 // Revenue: Required. Total non-zero revenue or grand total associated with the 5624 // transaction. This value include shipping, tax, or other adjustments to total 5625 // revenue that you want to include as part of your revenue calculations. 5626 Revenue float64 `json:"revenue,omitempty"` 5627 // Tax: All the taxes associated with the transaction. 5628 Tax float64 `json:"tax,omitempty"` 5629 // ForceSendFields is a list of field names (e.g. "Cost") to unconditionally 5630 // include in API requests. By default, fields with empty or default values are 5631 // omitted from API requests. See 5632 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5633 // details. 5634 ForceSendFields []string `json:"-"` 5635 // NullFields is a list of field names (e.g. "Cost") to include in API requests 5636 // with the JSON null value. By default, fields with empty values are omitted 5637 // from API requests. See 5638 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5639 NullFields []string `json:"-"` 5640 } 5641 5642 func (s *GoogleCloudRetailV2alphaPurchaseTransaction) MarshalJSON() ([]byte, error) { 5643 type NoMethod GoogleCloudRetailV2alphaPurchaseTransaction 5644 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5645 } 5646 5647 func (s *GoogleCloudRetailV2alphaPurchaseTransaction) UnmarshalJSON(data []byte) error { 5648 type NoMethod GoogleCloudRetailV2alphaPurchaseTransaction 5649 var s1 struct { 5650 Cost gensupport.JSONFloat64 `json:"cost"` 5651 Revenue gensupport.JSONFloat64 `json:"revenue"` 5652 Tax gensupport.JSONFloat64 `json:"tax"` 5653 *NoMethod 5654 } 5655 s1.NoMethod = (*NoMethod)(s) 5656 if err := json.Unmarshal(data, &s1); err != nil { 5657 return err 5658 } 5659 s.Cost = float64(s1.Cost) 5660 s.Revenue = float64(s1.Revenue) 5661 s.Tax = float64(s1.Tax) 5662 return nil 5663 } 5664 5665 // GoogleCloudRetailV2alphaPurgeMetadata: Metadata related to the progress of 5666 // the Purge operation. This will be returned by the 5667 // google.longrunning.Operation.metadata field. 5668 type GoogleCloudRetailV2alphaPurgeMetadata struct { 5669 } 5670 5671 // GoogleCloudRetailV2alphaPurgeProductsMetadata: Metadata related to the 5672 // progress of the PurgeProducts operation. This will be returned by the 5673 // google.longrunning.Operation.metadata field. 5674 type GoogleCloudRetailV2alphaPurgeProductsMetadata struct { 5675 // CreateTime: Operation create time. 5676 CreateTime string `json:"createTime,omitempty"` 5677 // FailureCount: Count of entries that encountered errors while processing. 5678 FailureCount int64 `json:"failureCount,omitempty,string"` 5679 // SuccessCount: Count of entries that were deleted successfully. 5680 SuccessCount int64 `json:"successCount,omitempty,string"` 5681 // UpdateTime: Operation last update time. If the operation is done, this is 5682 // also the finish time. 5683 UpdateTime string `json:"updateTime,omitempty"` 5684 // ForceSendFields is a list of field names (e.g. "CreateTime") to 5685 // unconditionally include in API requests. By default, fields with empty or 5686 // default values are omitted from API requests. See 5687 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5688 // details. 5689 ForceSendFields []string `json:"-"` 5690 // NullFields is a list of field names (e.g. "CreateTime") to include in API 5691 // requests with the JSON null value. By default, fields with empty values are 5692 // omitted from API requests. See 5693 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5694 NullFields []string `json:"-"` 5695 } 5696 5697 func (s *GoogleCloudRetailV2alphaPurgeProductsMetadata) MarshalJSON() ([]byte, error) { 5698 type NoMethod GoogleCloudRetailV2alphaPurgeProductsMetadata 5699 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5700 } 5701 5702 // GoogleCloudRetailV2alphaPurgeProductsRequest: Request message for 5703 // PurgeProducts method. 5704 type GoogleCloudRetailV2alphaPurgeProductsRequest struct { 5705 // Filter: Required. The filter string to specify the products to be deleted 5706 // with a length limit of 5,000 characters. Empty string filter is not allowed. 5707 // "*" implies delete all items in a branch. The eligible fields for filtering 5708 // are: * `availability`: Double quoted Product.availability string. * 5709 // `create_time` : in ISO 8601 "zulu" format. Supported syntax: * Comparators 5710 // (">", "<", ">=", "<=", "="). Examples: * create_time <= 5711 // "2015-02-13T17:05:46Z" * availability = "IN_STOCK" * Conjunctions ("AND") 5712 // Examples: * create_time <= "2015-02-13T17:05:46Z" AND availability = 5713 // "PREORDER" * Disjunctions ("OR") Examples: * create_time <= 5714 // "2015-02-13T17:05:46Z" OR availability = "IN_STOCK" * Can support nested 5715 // queries. Examples: * (create_time <= "2015-02-13T17:05:46Z" AND availability 5716 // = "PREORDER") OR (create_time >= "2015-02-14T13:03:32Z" AND availability = 5717 // "IN_STOCK") * Filter Limits: * Filter should not contain more than 6 5718 // conditions. * Max nesting depth should not exceed 2 levels. Examples 5719 // queries: * Delete back order products created before a timestamp. 5720 // create_time <= "2015-02-13T17:05:46Z" OR availability = "BACKORDER" 5721 Filter string `json:"filter,omitempty"` 5722 // Force: Actually perform the purge. If `force` is set to false, the method 5723 // will return the expected purge count without deleting any products. 5724 Force bool `json:"force,omitempty"` 5725 // ForceSendFields is a list of field names (e.g. "Filter") to unconditionally 5726 // include in API requests. By default, fields with empty or default values are 5727 // omitted from API requests. See 5728 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5729 // details. 5730 ForceSendFields []string `json:"-"` 5731 // NullFields is a list of field names (e.g. "Filter") to include in API 5732 // requests with the JSON null value. By default, fields with empty values are 5733 // omitted from API requests. See 5734 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5735 NullFields []string `json:"-"` 5736 } 5737 5738 func (s *GoogleCloudRetailV2alphaPurgeProductsRequest) MarshalJSON() ([]byte, error) { 5739 type NoMethod GoogleCloudRetailV2alphaPurgeProductsRequest 5740 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5741 } 5742 5743 // GoogleCloudRetailV2alphaPurgeProductsResponse: Response of the 5744 // PurgeProductsRequest. If the long running operation is successfully done, 5745 // then this message is returned by the google.longrunning.Operations.response 5746 // field. 5747 type GoogleCloudRetailV2alphaPurgeProductsResponse struct { 5748 // PurgeCount: The total count of products purged as a result of the operation. 5749 PurgeCount int64 `json:"purgeCount,omitempty,string"` 5750 // PurgeSample: A sample of the product names that will be deleted. Only 5751 // populated if `force` is set to false. A max of 100 names will be returned 5752 // and the names are chosen at random. 5753 PurgeSample []string `json:"purgeSample,omitempty"` 5754 // ForceSendFields is a list of field names (e.g. "PurgeCount") to 5755 // unconditionally include in API requests. By default, fields with empty or 5756 // default values are omitted from API requests. See 5757 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5758 // details. 5759 ForceSendFields []string `json:"-"` 5760 // NullFields is a list of field names (e.g. "PurgeCount") to include in API 5761 // requests with the JSON null value. By default, fields with empty values are 5762 // omitted from API requests. See 5763 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5764 NullFields []string `json:"-"` 5765 } 5766 5767 func (s *GoogleCloudRetailV2alphaPurgeProductsResponse) MarshalJSON() ([]byte, error) { 5768 type NoMethod GoogleCloudRetailV2alphaPurgeProductsResponse 5769 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5770 } 5771 5772 // GoogleCloudRetailV2alphaPurgeUserEventsRequest: Request message for 5773 // PurgeUserEvents method. 5774 type GoogleCloudRetailV2alphaPurgeUserEventsRequest struct { 5775 // Filter: Required. The filter string to specify the events to be deleted with 5776 // a length limit of 5,000 characters. Empty string filter is not allowed. The 5777 // eligible fields for filtering are: * `eventType`: Double quoted 5778 // UserEvent.event_type string. * `eventTime`: in ISO 8601 "zulu" format. * 5779 // `visitorId`: Double quoted string. Specifying this will delete all events 5780 // associated with a visitor. * `userId`: Double quoted string. Specifying this 5781 // will delete all events associated with a user. Examples: * Deleting all 5782 // events in a time range: `eventTime > "2012-04-23T18:25:43.511Z" eventTime < 5783 // "2012-04-23T18:30:43.511Z" * Deleting specific eventType in time range: 5784 // `eventTime > "2012-04-23T18:25:43.511Z" eventType = "detail-page-view" * 5785 // Deleting all events for a specific visitor: `visitorId = "visitor1024" The 5786 // filtering fields are assumed to have an implicit AND. 5787 Filter string `json:"filter,omitempty"` 5788 // Force: Actually perform the purge. If `force` is set to false, the method 5789 // will return the expected purge count without deleting any user events. 5790 Force bool `json:"force,omitempty"` 5791 // ForceSendFields is a list of field names (e.g. "Filter") to unconditionally 5792 // include in API requests. By default, fields with empty or default values are 5793 // omitted from API requests. See 5794 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5795 // details. 5796 ForceSendFields []string `json:"-"` 5797 // NullFields is a list of field names (e.g. "Filter") to include in API 5798 // requests with the JSON null value. By default, fields with empty values are 5799 // omitted from API requests. See 5800 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5801 NullFields []string `json:"-"` 5802 } 5803 5804 func (s *GoogleCloudRetailV2alphaPurgeUserEventsRequest) MarshalJSON() ([]byte, error) { 5805 type NoMethod GoogleCloudRetailV2alphaPurgeUserEventsRequest 5806 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5807 } 5808 5809 // GoogleCloudRetailV2alphaPurgeUserEventsResponse: Response of the 5810 // PurgeUserEventsRequest. If the long running operation is successfully done, 5811 // then this message is returned by the google.longrunning.Operations.response 5812 // field. 5813 type GoogleCloudRetailV2alphaPurgeUserEventsResponse struct { 5814 // PurgedEventsCount: The total count of events purged as a result of the 5815 // operation. 5816 PurgedEventsCount int64 `json:"purgedEventsCount,omitempty,string"` 5817 // ForceSendFields is a list of field names (e.g. "PurgedEventsCount") to 5818 // unconditionally include in API requests. By default, fields with empty or 5819 // default values are omitted from API requests. See 5820 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5821 // details. 5822 ForceSendFields []string `json:"-"` 5823 // NullFields is a list of field names (e.g. "PurgedEventsCount") to include in 5824 // API requests with the JSON null value. By default, fields with empty values 5825 // are omitted from API requests. See 5826 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5827 NullFields []string `json:"-"` 5828 } 5829 5830 func (s *GoogleCloudRetailV2alphaPurgeUserEventsResponse) MarshalJSON() ([]byte, error) { 5831 type NoMethod GoogleCloudRetailV2alphaPurgeUserEventsResponse 5832 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5833 } 5834 5835 // GoogleCloudRetailV2alphaRating: The rating of a Product. 5836 type GoogleCloudRetailV2alphaRating struct { 5837 // AverageRating: The average rating of the Product. The rating is scaled at 5838 // 1-5. Otherwise, an INVALID_ARGUMENT error is returned. 5839 AverageRating float64 `json:"averageRating,omitempty"` 5840 // RatingCount: The total number of ratings. This value is independent of the 5841 // value of rating_histogram. This value must be nonnegative. Otherwise, an 5842 // INVALID_ARGUMENT error is returned. 5843 RatingCount int64 `json:"ratingCount,omitempty"` 5844 // RatingHistogram: List of rating counts per rating value (index = rating - 5845 // 1). The list is empty if there is no rating. If the list is non-empty, its 5846 // size is always 5. Otherwise, an INVALID_ARGUMENT error is returned. For 5847 // example, [41, 14, 13, 47, 303]. It means that the Product got 41 ratings 5848 // with 1 star, 14 ratings with 2 star, and so on. 5849 RatingHistogram []int64 `json:"ratingHistogram,omitempty"` 5850 // ForceSendFields is a list of field names (e.g. "AverageRating") to 5851 // unconditionally include in API requests. By default, fields with empty or 5852 // default values are omitted from API requests. See 5853 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5854 // details. 5855 ForceSendFields []string `json:"-"` 5856 // NullFields is a list of field names (e.g. "AverageRating") to include in API 5857 // requests with the JSON null value. By default, fields with empty values are 5858 // omitted from API requests. See 5859 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5860 NullFields []string `json:"-"` 5861 } 5862 5863 func (s *GoogleCloudRetailV2alphaRating) MarshalJSON() ([]byte, error) { 5864 type NoMethod GoogleCloudRetailV2alphaRating 5865 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5866 } 5867 5868 func (s *GoogleCloudRetailV2alphaRating) UnmarshalJSON(data []byte) error { 5869 type NoMethod GoogleCloudRetailV2alphaRating 5870 var s1 struct { 5871 AverageRating gensupport.JSONFloat64 `json:"averageRating"` 5872 *NoMethod 5873 } 5874 s1.NoMethod = (*NoMethod)(s) 5875 if err := json.Unmarshal(data, &s1); err != nil { 5876 return err 5877 } 5878 s.AverageRating = float64(s1.AverageRating) 5879 return nil 5880 } 5881 5882 // GoogleCloudRetailV2alphaRejoinUserEventsMetadata: Metadata for 5883 // `RejoinUserEvents` method. 5884 type GoogleCloudRetailV2alphaRejoinUserEventsMetadata struct { 5885 } 5886 5887 // GoogleCloudRetailV2alphaRejoinUserEventsRequest: Request message for 5888 // RejoinUserEvents method. 5889 type GoogleCloudRetailV2alphaRejoinUserEventsRequest struct { 5890 // UserEventRejoinScope: The type of the user event rejoin to define the scope 5891 // and range of the user events to be rejoined with the latest product catalog. 5892 // Defaults to `USER_EVENT_REJOIN_SCOPE_UNSPECIFIED` if this field is not set, 5893 // or set to an invalid integer value. 5894 // 5895 // Possible values: 5896 // "USER_EVENT_REJOIN_SCOPE_UNSPECIFIED" - Rejoin all events with the latest 5897 // product catalog, including both joined events and unjoined events. 5898 // "JOINED_EVENTS" - Only rejoin joined events with the latest product 5899 // catalog. 5900 // "UNJOINED_EVENTS" - Only rejoin unjoined events with the latest product 5901 // catalog. 5902 UserEventRejoinScope string `json:"userEventRejoinScope,omitempty"` 5903 // ForceSendFields is a list of field names (e.g. "UserEventRejoinScope") to 5904 // unconditionally include in API requests. By default, fields with empty or 5905 // default values are omitted from API requests. See 5906 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5907 // details. 5908 ForceSendFields []string `json:"-"` 5909 // NullFields is a list of field names (e.g. "UserEventRejoinScope") to include 5910 // in API requests with the JSON null value. By default, fields with empty 5911 // values are omitted from API requests. See 5912 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5913 NullFields []string `json:"-"` 5914 } 5915 5916 func (s *GoogleCloudRetailV2alphaRejoinUserEventsRequest) MarshalJSON() ([]byte, error) { 5917 type NoMethod GoogleCloudRetailV2alphaRejoinUserEventsRequest 5918 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5919 } 5920 5921 // GoogleCloudRetailV2alphaRejoinUserEventsResponse: Response message for 5922 // `RejoinUserEvents` method. 5923 type GoogleCloudRetailV2alphaRejoinUserEventsResponse struct { 5924 // RejoinedUserEventsCount: Number of user events that were joined with latest 5925 // product catalog. 5926 RejoinedUserEventsCount int64 `json:"rejoinedUserEventsCount,omitempty,string"` 5927 // ForceSendFields is a list of field names (e.g. "RejoinedUserEventsCount") to 5928 // unconditionally include in API requests. By default, fields with empty or 5929 // default values are omitted from API requests. See 5930 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5931 // details. 5932 ForceSendFields []string `json:"-"` 5933 // NullFields is a list of field names (e.g. "RejoinedUserEventsCount") to 5934 // include in API requests with the JSON null value. By default, fields with 5935 // empty values are omitted from API requests. See 5936 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5937 NullFields []string `json:"-"` 5938 } 5939 5940 func (s *GoogleCloudRetailV2alphaRejoinUserEventsResponse) MarshalJSON() ([]byte, error) { 5941 type NoMethod GoogleCloudRetailV2alphaRejoinUserEventsResponse 5942 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5943 } 5944 5945 // GoogleCloudRetailV2alphaRemoveCatalogAttributeRequest: Request for 5946 // CatalogService.RemoveCatalogAttribute method. 5947 type GoogleCloudRetailV2alphaRemoveCatalogAttributeRequest struct { 5948 // Key: Required. The attribute name key of the CatalogAttribute to remove. 5949 Key string `json:"key,omitempty"` 5950 // ForceSendFields is a list of field names (e.g. "Key") to unconditionally 5951 // include in API requests. By default, fields with empty or default values are 5952 // omitted from API requests. See 5953 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5954 // details. 5955 ForceSendFields []string `json:"-"` 5956 // NullFields is a list of field names (e.g. "Key") to include in API requests 5957 // with the JSON null value. By default, fields with empty values are omitted 5958 // from API requests. See 5959 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5960 NullFields []string `json:"-"` 5961 } 5962 5963 func (s *GoogleCloudRetailV2alphaRemoveCatalogAttributeRequest) MarshalJSON() ([]byte, error) { 5964 type NoMethod GoogleCloudRetailV2alphaRemoveCatalogAttributeRequest 5965 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5966 } 5967 5968 // GoogleCloudRetailV2alphaRemoveControlRequest: Request for RemoveControl 5969 // method. 5970 type GoogleCloudRetailV2alphaRemoveControlRequest struct { 5971 // ControlId: Required. The id of the control to apply. Assumed to be in the 5972 // same catalog as the serving config. 5973 ControlId string `json:"controlId,omitempty"` 5974 // ForceSendFields is a list of field names (e.g. "ControlId") to 5975 // unconditionally include in API requests. By default, fields with empty or 5976 // default values are omitted from API requests. See 5977 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5978 // details. 5979 ForceSendFields []string `json:"-"` 5980 // NullFields is a list of field names (e.g. "ControlId") to include in API 5981 // requests with the JSON null value. By default, fields with empty values are 5982 // omitted from API requests. See 5983 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5984 NullFields []string `json:"-"` 5985 } 5986 5987 func (s *GoogleCloudRetailV2alphaRemoveControlRequest) MarshalJSON() ([]byte, error) { 5988 type NoMethod GoogleCloudRetailV2alphaRemoveControlRequest 5989 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5990 } 5991 5992 // GoogleCloudRetailV2alphaRemoveFulfillmentPlacesMetadata: Metadata related to 5993 // the progress of the RemoveFulfillmentPlaces operation. Currently empty 5994 // because there is no meaningful metadata populated from the 5995 // ProductService.RemoveFulfillmentPlaces method. 5996 type GoogleCloudRetailV2alphaRemoveFulfillmentPlacesMetadata struct { 5997 } 5998 5999 // GoogleCloudRetailV2alphaRemoveFulfillmentPlacesRequest: Request message for 6000 // ProductService.RemoveFulfillmentPlaces method. 6001 type GoogleCloudRetailV2alphaRemoveFulfillmentPlacesRequest struct { 6002 // AllowMissing: If set to true, and the Product is not found, the fulfillment 6003 // information will still be processed and retained for at most 1 day and 6004 // processed once the Product is created. If set to false, a NOT_FOUND error is 6005 // returned if the Product is not found. 6006 AllowMissing bool `json:"allowMissing,omitempty"` 6007 // PlaceIds: Required. The IDs for this type, such as the store IDs for 6008 // "pickup-in-store" or the region IDs for "same-day-delivery", to be removed 6009 // for this type. At least 1 value is required, and a maximum of 2000 values 6010 // are allowed. Each value must be a string with a length limit of 10 6011 // characters, matching the pattern `[a-zA-Z0-9_-]+`, such as "store1" or 6012 // "REGION-2". Otherwise, an INVALID_ARGUMENT error is returned. 6013 PlaceIds []string `json:"placeIds,omitempty"` 6014 // RemoveTime: The time when the fulfillment updates are issued, used to 6015 // prevent out-of-order updates on fulfillment information. If not provided, 6016 // the internal system time will be used. 6017 RemoveTime string `json:"removeTime,omitempty"` 6018 // Type: Required. The fulfillment type, including commonly used types (such as 6019 // pickup in store and same day delivery), and custom types. Supported values: 6020 // * "pickup-in-store" * "ship-to-store" * "same-day-delivery" * 6021 // "next-day-delivery" * "custom-type-1" * "custom-type-2" * "custom-type-3" * 6022 // "custom-type-4" * "custom-type-5" If this field is set to an invalid value 6023 // other than these, an INVALID_ARGUMENT error is returned. This field directly 6024 // corresponds to Product.fulfillment_info.type. 6025 Type string `json:"type,omitempty"` 6026 // ForceSendFields is a list of field names (e.g. "AllowMissing") to 6027 // unconditionally include in API requests. By default, fields with empty or 6028 // default values are omitted from API requests. See 6029 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6030 // details. 6031 ForceSendFields []string `json:"-"` 6032 // NullFields is a list of field names (e.g. "AllowMissing") to include in API 6033 // requests with the JSON null value. By default, fields with empty values are 6034 // omitted from API requests. See 6035 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6036 NullFields []string `json:"-"` 6037 } 6038 6039 func (s *GoogleCloudRetailV2alphaRemoveFulfillmentPlacesRequest) MarshalJSON() ([]byte, error) { 6040 type NoMethod GoogleCloudRetailV2alphaRemoveFulfillmentPlacesRequest 6041 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6042 } 6043 6044 // GoogleCloudRetailV2alphaRemoveFulfillmentPlacesResponse: Response of the 6045 // RemoveFulfillmentPlacesRequest. Currently empty because there is no 6046 // meaningful response populated from the 6047 // ProductService.RemoveFulfillmentPlaces method. 6048 type GoogleCloudRetailV2alphaRemoveFulfillmentPlacesResponse struct { 6049 } 6050 6051 // GoogleCloudRetailV2alphaRemoveLocalInventoriesMetadata: Metadata related to 6052 // the progress of the RemoveLocalInventories operation. Currently empty 6053 // because there is no meaningful metadata populated from the 6054 // ProductService.RemoveLocalInventories method. 6055 type GoogleCloudRetailV2alphaRemoveLocalInventoriesMetadata struct { 6056 } 6057 6058 // GoogleCloudRetailV2alphaRemoveLocalInventoriesRequest: Request message for 6059 // ProductService.RemoveLocalInventories method. 6060 type GoogleCloudRetailV2alphaRemoveLocalInventoriesRequest struct { 6061 // AllowMissing: If set to true, and the Product is not found, the local 6062 // inventory removal request will still be processed and retained for at most 1 6063 // day and processed once the Product is created. If set to false, a NOT_FOUND 6064 // error is returned if the Product is not found. 6065 AllowMissing bool `json:"allowMissing,omitempty"` 6066 // PlaceIds: Required. A list of place IDs to have their inventory deleted. At 6067 // most 3000 place IDs are allowed per request. 6068 PlaceIds []string `json:"placeIds,omitempty"` 6069 // RemoveTime: The time when the inventory deletions are issued. Used to 6070 // prevent out-of-order updates and deletions on local inventory fields. If not 6071 // provided, the internal system time will be used. 6072 RemoveTime string `json:"removeTime,omitempty"` 6073 // ForceSendFields is a list of field names (e.g. "AllowMissing") to 6074 // unconditionally include in API requests. By default, fields with empty or 6075 // default values are omitted from API requests. See 6076 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6077 // details. 6078 ForceSendFields []string `json:"-"` 6079 // NullFields is a list of field names (e.g. "AllowMissing") to include in API 6080 // requests with the JSON null value. By default, fields with empty values are 6081 // omitted from API requests. See 6082 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6083 NullFields []string `json:"-"` 6084 } 6085 6086 func (s *GoogleCloudRetailV2alphaRemoveLocalInventoriesRequest) MarshalJSON() ([]byte, error) { 6087 type NoMethod GoogleCloudRetailV2alphaRemoveLocalInventoriesRequest 6088 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6089 } 6090 6091 // GoogleCloudRetailV2alphaRemoveLocalInventoriesResponse: Response of the 6092 // ProductService.RemoveLocalInventories API. Currently empty because there is 6093 // no meaningful response populated from the 6094 // ProductService.RemoveLocalInventories method. 6095 type GoogleCloudRetailV2alphaRemoveLocalInventoriesResponse struct { 6096 } 6097 6098 // GoogleCloudRetailV2alphaReplaceCatalogAttributeRequest: Request for 6099 // CatalogService.ReplaceCatalogAttribute method. 6100 type GoogleCloudRetailV2alphaReplaceCatalogAttributeRequest struct { 6101 // CatalogAttribute: Required. The updated CatalogAttribute. 6102 CatalogAttribute *GoogleCloudRetailV2alphaCatalogAttribute `json:"catalogAttribute,omitempty"` 6103 // UpdateMask: Indicates which fields in the provided CatalogAttribute to 6104 // update. The following are NOT supported: * CatalogAttribute.key If not set, 6105 // all supported fields are updated. 6106 UpdateMask string `json:"updateMask,omitempty"` 6107 // ForceSendFields is a list of field names (e.g. "CatalogAttribute") to 6108 // unconditionally include in API requests. By default, fields with empty or 6109 // default values are omitted from API requests. See 6110 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6111 // details. 6112 ForceSendFields []string `json:"-"` 6113 // NullFields is a list of field names (e.g. "CatalogAttribute") to include in 6114 // API requests with the JSON null value. By default, fields with empty values 6115 // are omitted from API requests. See 6116 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6117 NullFields []string `json:"-"` 6118 } 6119 6120 func (s *GoogleCloudRetailV2alphaReplaceCatalogAttributeRequest) MarshalJSON() ([]byte, error) { 6121 type NoMethod GoogleCloudRetailV2alphaReplaceCatalogAttributeRequest 6122 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6123 } 6124 6125 // GoogleCloudRetailV2alphaResumeModelRequest: Request for resuming training of 6126 // a model. 6127 type GoogleCloudRetailV2alphaResumeModelRequest struct { 6128 } 6129 6130 // GoogleCloudRetailV2alphaRule: A rule is a condition-action pair * A 6131 // condition defines when a rule is to be triggered. * An action specifies what 6132 // occurs on that trigger. Currently rules only work for controls with 6133 // SOLUTION_TYPE_SEARCH. 6134 type GoogleCloudRetailV2alphaRule struct { 6135 // BoostAction: A boost action. 6136 BoostAction *GoogleCloudRetailV2alphaRuleBoostAction `json:"boostAction,omitempty"` 6137 // Condition: Required. The condition that triggers the rule. If the condition 6138 // is empty, the rule will always apply. 6139 Condition *GoogleCloudRetailV2alphaCondition `json:"condition,omitempty"` 6140 // DoNotAssociateAction: Prevents term from being associated with other terms. 6141 DoNotAssociateAction *GoogleCloudRetailV2alphaRuleDoNotAssociateAction `json:"doNotAssociateAction,omitempty"` 6142 // FilterAction: Filters results. 6143 FilterAction *GoogleCloudRetailV2alphaRuleFilterAction `json:"filterAction,omitempty"` 6144 // ForceReturnFacetAction: Force returns an attribute as a facet in the 6145 // request. 6146 ForceReturnFacetAction *GoogleCloudRetailV2alphaRuleForceReturnFacetAction `json:"forceReturnFacetAction,omitempty"` 6147 // IgnoreAction: Ignores specific terms from query during search. 6148 IgnoreAction *GoogleCloudRetailV2alphaRuleIgnoreAction `json:"ignoreAction,omitempty"` 6149 // OnewaySynonymsAction: Treats specific term as a synonym with a group of 6150 // terms. Group of terms will not be treated as synonyms with the specific 6151 // term. 6152 OnewaySynonymsAction *GoogleCloudRetailV2alphaRuleOnewaySynonymsAction `json:"onewaySynonymsAction,omitempty"` 6153 // RedirectAction: Redirects a shopper to a specific page. 6154 RedirectAction *GoogleCloudRetailV2alphaRuleRedirectAction `json:"redirectAction,omitempty"` 6155 // RemoveFacetAction: Remove an attribute as a facet in the request (if 6156 // present). 6157 RemoveFacetAction *GoogleCloudRetailV2alphaRuleRemoveFacetAction `json:"removeFacetAction,omitempty"` 6158 // ReplacementAction: Replaces specific terms in the query. 6159 ReplacementAction *GoogleCloudRetailV2alphaRuleReplacementAction `json:"replacementAction,omitempty"` 6160 // TwowaySynonymsAction: Treats a set of terms as synonyms of one another. 6161 TwowaySynonymsAction *GoogleCloudRetailV2alphaRuleTwowaySynonymsAction `json:"twowaySynonymsAction,omitempty"` 6162 // ForceSendFields is a list of field names (e.g. "BoostAction") to 6163 // unconditionally include in API requests. By default, fields with empty or 6164 // default values are omitted from API requests. See 6165 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6166 // details. 6167 ForceSendFields []string `json:"-"` 6168 // NullFields is a list of field names (e.g. "BoostAction") to include in API 6169 // requests with the JSON null value. By default, fields with empty values are 6170 // omitted from API requests. See 6171 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6172 NullFields []string `json:"-"` 6173 } 6174 6175 func (s *GoogleCloudRetailV2alphaRule) MarshalJSON() ([]byte, error) { 6176 type NoMethod GoogleCloudRetailV2alphaRule 6177 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6178 } 6179 6180 // GoogleCloudRetailV2alphaRuleBoostAction: A boost action to apply to results 6181 // matching condition specified above. 6182 type GoogleCloudRetailV2alphaRuleBoostAction struct { 6183 // Boost: Strength of the condition boost, which must be in [-1, 1]. Negative 6184 // boost means demotion. Default is 0.0. Setting to 1.0 gives the item a big 6185 // promotion. However, it does not necessarily mean that the boosted item will 6186 // be the top result at all times, nor that other items will be excluded. 6187 // Results could still be shown even when none of them matches the condition. 6188 // And results that are significantly more relevant to the search query can 6189 // still trump your heavily favored but irrelevant items. Setting to -1.0 gives 6190 // the item a big demotion. However, results that are deeply relevant might 6191 // still be shown. The item will have an upstream battle to get a fairly high 6192 // ranking, but it is not blocked out completely. Setting to 0.0 means no boost 6193 // applied. The boosting condition is ignored. 6194 Boost float64 `json:"boost,omitempty"` 6195 // ProductsFilter: The filter can have a max size of 5000 characters. An 6196 // expression which specifies which products to apply an action to. The syntax 6197 // and supported fields are the same as a filter expression. See 6198 // SearchRequest.filter for detail syntax and limitations. Examples: * To boost 6199 // products with product ID "product_1" or "product_2", and color "Red" or 6200 // "Blue": *(id: ANY("product_1", "product_2")) * *AND * *(colorFamilies: 6201 // ANY("Red", "Blue")) * 6202 ProductsFilter string `json:"productsFilter,omitempty"` 6203 // ForceSendFields is a list of field names (e.g. "Boost") to unconditionally 6204 // include in API requests. By default, fields with empty or default values are 6205 // omitted from API requests. See 6206 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6207 // details. 6208 ForceSendFields []string `json:"-"` 6209 // NullFields is a list of field names (e.g. "Boost") to include in API 6210 // requests with the JSON null value. By default, fields with empty values are 6211 // omitted from API requests. See 6212 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6213 NullFields []string `json:"-"` 6214 } 6215 6216 func (s *GoogleCloudRetailV2alphaRuleBoostAction) MarshalJSON() ([]byte, error) { 6217 type NoMethod GoogleCloudRetailV2alphaRuleBoostAction 6218 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6219 } 6220 6221 func (s *GoogleCloudRetailV2alphaRuleBoostAction) UnmarshalJSON(data []byte) error { 6222 type NoMethod GoogleCloudRetailV2alphaRuleBoostAction 6223 var s1 struct { 6224 Boost gensupport.JSONFloat64 `json:"boost"` 6225 *NoMethod 6226 } 6227 s1.NoMethod = (*NoMethod)(s) 6228 if err := json.Unmarshal(data, &s1); err != nil { 6229 return err 6230 } 6231 s.Boost = float64(s1.Boost) 6232 return nil 6233 } 6234 6235 // GoogleCloudRetailV2alphaRuleDoNotAssociateAction: Prevents `query_term` from 6236 // being associated with specified terms during search. Example: Don't 6237 // associate "gShoe" and "cheap". 6238 type GoogleCloudRetailV2alphaRuleDoNotAssociateAction struct { 6239 // DoNotAssociateTerms: Cannot contain duplicates or the query term. Can 6240 // specify up to 100 terms. 6241 DoNotAssociateTerms []string `json:"doNotAssociateTerms,omitempty"` 6242 // QueryTerms: Terms from the search query. Will not consider 6243 // do_not_associate_terms for search if in search query. Can specify up to 100 6244 // terms. 6245 QueryTerms []string `json:"queryTerms,omitempty"` 6246 // Terms: Will be [deprecated = true] post migration; 6247 Terms []string `json:"terms,omitempty"` 6248 // ForceSendFields is a list of field names (e.g. "DoNotAssociateTerms") to 6249 // unconditionally include in API requests. By default, fields with empty or 6250 // default values are omitted from API requests. See 6251 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6252 // details. 6253 ForceSendFields []string `json:"-"` 6254 // NullFields is a list of field names (e.g. "DoNotAssociateTerms") to include 6255 // in API requests with the JSON null value. By default, fields with empty 6256 // values are omitted from API requests. See 6257 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6258 NullFields []string `json:"-"` 6259 } 6260 6261 func (s *GoogleCloudRetailV2alphaRuleDoNotAssociateAction) MarshalJSON() ([]byte, error) { 6262 type NoMethod GoogleCloudRetailV2alphaRuleDoNotAssociateAction 6263 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6264 } 6265 6266 // GoogleCloudRetailV2alphaRuleFilterAction: * Rule Condition: - No 6267 // Condition.query_terms provided is a global match. - 1 or more 6268 // Condition.query_terms provided are combined with OR operator. * Action 6269 // Input: The request query and filter that are applied to the retrieved 6270 // products, in addition to any filters already provided with the 6271 // SearchRequest. The AND operator is used to combine the query's existing 6272 // filters with the filter rule(s). NOTE: May result in 0 results when filters 6273 // conflict. * Action Result: Filters the returned objects to be ONLY those 6274 // that passed the filter. 6275 type GoogleCloudRetailV2alphaRuleFilterAction struct { 6276 // Filter: A filter to apply on the matching condition results. Supported 6277 // features: * filter must be set. * Filter syntax is identical to 6278 // SearchRequest.filter. For more information, see Filter 6279 // (/retail/docs/filter-and-order#filter). * To filter products with product ID 6280 // "product_1" or "product_2", and color "Red" or "Blue": *(id: 6281 // ANY("product_1", "product_2")) * *AND * *(colorFamilies: ANY("Red", "Blue")) 6282 // * 6283 Filter string `json:"filter,omitempty"` 6284 // ForceSendFields is a list of field names (e.g. "Filter") to unconditionally 6285 // include in API requests. By default, fields with empty or default values are 6286 // omitted from API requests. See 6287 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6288 // details. 6289 ForceSendFields []string `json:"-"` 6290 // NullFields is a list of field names (e.g. "Filter") to include in API 6291 // requests with the JSON null value. By default, fields with empty values are 6292 // omitted from API requests. See 6293 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6294 NullFields []string `json:"-"` 6295 } 6296 6297 func (s *GoogleCloudRetailV2alphaRuleFilterAction) MarshalJSON() ([]byte, error) { 6298 type NoMethod GoogleCloudRetailV2alphaRuleFilterAction 6299 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6300 } 6301 6302 // GoogleCloudRetailV2alphaRuleForceReturnFacetAction: Force returns an 6303 // attribute/facet in the request around a certain position or above. * Rule 6304 // Condition: Must specify non-empty Condition.query_terms (for search only) or 6305 // Condition.page_categories (for browse only), but can't specify both. * 6306 // Action Inputs: attribute name, position * Action Result: Will force return a 6307 // facet key around a certain position or above if the condition is satisfied. 6308 // Example: Suppose the query is "shoes", the Condition.query_terms is "shoes", 6309 // the ForceReturnFacetAction.FacetPositionAdjustment.attribute_name is "size" 6310 // and the ForceReturnFacetAction.FacetPositionAdjustment.position is 8. Two 6311 // cases: a) The facet key "size" is not already in the top 8 slots, then the 6312 // facet "size" will appear at a position close to 8. b) The facet key "size" 6313 // in among the top 8 positions in the request, then it will stay at its 6314 // current rank. 6315 type GoogleCloudRetailV2alphaRuleForceReturnFacetAction struct { 6316 // FacetPositionAdjustments: Each instance corresponds to a force return 6317 // attribute for the given condition. There can't be more 3 instances here. 6318 FacetPositionAdjustments []*GoogleCloudRetailV2alphaRuleForceReturnFacetActionFacetPositionAdjustment `json:"facetPositionAdjustments,omitempty"` 6319 // ForceSendFields is a list of field names (e.g. "FacetPositionAdjustments") 6320 // to unconditionally include in API requests. By default, fields with empty or 6321 // default values are omitted from API requests. See 6322 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6323 // details. 6324 ForceSendFields []string `json:"-"` 6325 // NullFields is a list of field names (e.g. "FacetPositionAdjustments") to 6326 // include in API requests with the JSON null value. By default, fields with 6327 // empty values are omitted from API requests. See 6328 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6329 NullFields []string `json:"-"` 6330 } 6331 6332 func (s *GoogleCloudRetailV2alphaRuleForceReturnFacetAction) MarshalJSON() ([]byte, error) { 6333 type NoMethod GoogleCloudRetailV2alphaRuleForceReturnFacetAction 6334 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6335 } 6336 6337 // GoogleCloudRetailV2alphaRuleForceReturnFacetActionFacetPositionAdjustment: 6338 // Each facet position adjustment consists of a single attribute name (i.e. 6339 // facet key) along with a specified position. 6340 type GoogleCloudRetailV2alphaRuleForceReturnFacetActionFacetPositionAdjustment struct { 6341 // AttributeName: The attribute name to force return as a facet. Each attribute 6342 // name should be a valid attribute name, be non-empty and contain at most 80 6343 // characters long. 6344 AttributeName string `json:"attributeName,omitempty"` 6345 // Position: This is the position in the request as explained above. It should 6346 // be strictly positive be at most 100. 6347 Position int64 `json:"position,omitempty"` 6348 // ForceSendFields is a list of field names (e.g. "AttributeName") to 6349 // unconditionally include in API requests. By default, fields with empty or 6350 // default values are omitted from API requests. See 6351 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6352 // details. 6353 ForceSendFields []string `json:"-"` 6354 // NullFields is a list of field names (e.g. "AttributeName") to include in API 6355 // requests with the JSON null value. By default, fields with empty values are 6356 // omitted from API requests. See 6357 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6358 NullFields []string `json:"-"` 6359 } 6360 6361 func (s *GoogleCloudRetailV2alphaRuleForceReturnFacetActionFacetPositionAdjustment) MarshalJSON() ([]byte, error) { 6362 type NoMethod GoogleCloudRetailV2alphaRuleForceReturnFacetActionFacetPositionAdjustment 6363 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6364 } 6365 6366 // GoogleCloudRetailV2alphaRuleIgnoreAction: Prevents a term in the query from 6367 // being used in search. Example: Don't search for "shoddy". 6368 type GoogleCloudRetailV2alphaRuleIgnoreAction struct { 6369 // IgnoreTerms: Terms to ignore in the search query. 6370 IgnoreTerms []string `json:"ignoreTerms,omitempty"` 6371 // ForceSendFields is a list of field names (e.g. "IgnoreTerms") to 6372 // unconditionally include in API requests. By default, fields with empty or 6373 // default values are omitted from API requests. See 6374 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6375 // details. 6376 ForceSendFields []string `json:"-"` 6377 // NullFields is a list of field names (e.g. "IgnoreTerms") to include in API 6378 // requests with the JSON null value. By default, fields with empty values are 6379 // omitted from API requests. See 6380 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6381 NullFields []string `json:"-"` 6382 } 6383 6384 func (s *GoogleCloudRetailV2alphaRuleIgnoreAction) MarshalJSON() ([]byte, error) { 6385 type NoMethod GoogleCloudRetailV2alphaRuleIgnoreAction 6386 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6387 } 6388 6389 // GoogleCloudRetailV2alphaRuleOnewaySynonymsAction: Maps a set of terms to a 6390 // set of synonyms. Set of synonyms will be treated as synonyms of each query 6391 // term only. `query_terms` will not be treated as synonyms of each other. 6392 // Example: "sneakers" will use a synonym of "shoes". "shoes" will not use a 6393 // synonym of "sneakers". 6394 type GoogleCloudRetailV2alphaRuleOnewaySynonymsAction struct { 6395 // OnewayTerms: Will be [deprecated = true] post migration; 6396 OnewayTerms []string `json:"onewayTerms,omitempty"` 6397 // QueryTerms: Terms from the search query. Will treat synonyms as their 6398 // synonyms. Not themselves synonyms of the synonyms. Can specify up to 100 6399 // terms. 6400 QueryTerms []string `json:"queryTerms,omitempty"` 6401 // Synonyms: Defines a set of synonyms. Cannot contain duplicates. Can specify 6402 // up to 100 synonyms. 6403 Synonyms []string `json:"synonyms,omitempty"` 6404 // ForceSendFields is a list of field names (e.g. "OnewayTerms") to 6405 // unconditionally include in API requests. By default, fields with empty or 6406 // default values are omitted from API requests. See 6407 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6408 // details. 6409 ForceSendFields []string `json:"-"` 6410 // NullFields is a list of field names (e.g. "OnewayTerms") to include in API 6411 // requests with the JSON null value. By default, fields with empty values are 6412 // omitted from API requests. See 6413 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6414 NullFields []string `json:"-"` 6415 } 6416 6417 func (s *GoogleCloudRetailV2alphaRuleOnewaySynonymsAction) MarshalJSON() ([]byte, error) { 6418 type NoMethod GoogleCloudRetailV2alphaRuleOnewaySynonymsAction 6419 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6420 } 6421 6422 // GoogleCloudRetailV2alphaRuleRedirectAction: Redirects a shopper to a 6423 // specific page. * Rule Condition: Must specify Condition.query_terms. * 6424 // Action Input: Request Query * Action Result: Redirects shopper to provided 6425 // uri. 6426 type GoogleCloudRetailV2alphaRuleRedirectAction struct { 6427 // RedirectUri: URL must have length equal or less than 2000 characters. 6428 RedirectUri string `json:"redirectUri,omitempty"` 6429 // ForceSendFields is a list of field names (e.g. "RedirectUri") to 6430 // unconditionally include in API requests. By default, fields with empty or 6431 // default values are omitted from API requests. See 6432 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6433 // details. 6434 ForceSendFields []string `json:"-"` 6435 // NullFields is a list of field names (e.g. "RedirectUri") to include in API 6436 // requests with the JSON null value. By default, fields with empty values are 6437 // omitted from API requests. See 6438 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6439 NullFields []string `json:"-"` 6440 } 6441 6442 func (s *GoogleCloudRetailV2alphaRuleRedirectAction) MarshalJSON() ([]byte, error) { 6443 type NoMethod GoogleCloudRetailV2alphaRuleRedirectAction 6444 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6445 } 6446 6447 // GoogleCloudRetailV2alphaRuleRemoveFacetAction: Removes an attribute/facet in 6448 // the request if is present. * Rule Condition: Must specify non-empty 6449 // Condition.query_terms (for search only) or Condition.page_categories (for 6450 // browse only), but can't specify both. * Action Input: attribute name * 6451 // Action Result: Will remove the attribute (as a facet) from the request if it 6452 // is present. Example: Suppose the query is "shoes", the Condition.query_terms 6453 // is "shoes" and the attribute name "size", then facet key "size" will be 6454 // removed from the request (if it is present). 6455 type GoogleCloudRetailV2alphaRuleRemoveFacetAction struct { 6456 // AttributeNames: The attribute names (i.e. facet keys) to remove from the 6457 // dynamic facets (if present in the request). There can't be more 3 attribute 6458 // names. Each attribute name should be a valid attribute name, be non-empty 6459 // and contain at most 80 characters. 6460 AttributeNames []string `json:"attributeNames,omitempty"` 6461 // ForceSendFields is a list of field names (e.g. "AttributeNames") to 6462 // unconditionally include in API requests. By default, fields with empty or 6463 // default values are omitted from API requests. See 6464 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6465 // details. 6466 ForceSendFields []string `json:"-"` 6467 // NullFields is a list of field names (e.g. "AttributeNames") to include in 6468 // API requests with the JSON null value. By default, fields with empty values 6469 // are omitted from API requests. See 6470 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6471 NullFields []string `json:"-"` 6472 } 6473 6474 func (s *GoogleCloudRetailV2alphaRuleRemoveFacetAction) MarshalJSON() ([]byte, error) { 6475 type NoMethod GoogleCloudRetailV2alphaRuleRemoveFacetAction 6476 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6477 } 6478 6479 // GoogleCloudRetailV2alphaRuleReplacementAction: Replaces a term in the query. 6480 // Multiple replacement candidates can be specified. All `query_terms` will be 6481 // replaced with the replacement term. Example: Replace "gShoe" with "google 6482 // shoe". 6483 type GoogleCloudRetailV2alphaRuleReplacementAction struct { 6484 // QueryTerms: Terms from the search query. Will be replaced by replacement 6485 // term. Can specify up to 100 terms. 6486 QueryTerms []string `json:"queryTerms,omitempty"` 6487 // ReplacementTerm: Term that will be used for replacement. 6488 ReplacementTerm string `json:"replacementTerm,omitempty"` 6489 // Term: Will be [deprecated = true] post migration; 6490 Term string `json:"term,omitempty"` 6491 // ForceSendFields is a list of field names (e.g. "QueryTerms") to 6492 // unconditionally include in API requests. By default, fields with empty or 6493 // default values are omitted from API requests. See 6494 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6495 // details. 6496 ForceSendFields []string `json:"-"` 6497 // NullFields is a list of field names (e.g. "QueryTerms") to include in API 6498 // requests with the JSON null value. By default, fields with empty values are 6499 // omitted from API requests. See 6500 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6501 NullFields []string `json:"-"` 6502 } 6503 6504 func (s *GoogleCloudRetailV2alphaRuleReplacementAction) MarshalJSON() ([]byte, error) { 6505 type NoMethod GoogleCloudRetailV2alphaRuleReplacementAction 6506 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6507 } 6508 6509 // GoogleCloudRetailV2alphaRuleTwowaySynonymsAction: Creates a set of terms 6510 // that will be treated as synonyms of each other. Example: synonyms of 6511 // "sneakers" and "shoes": * "sneakers" will use a synonym of "shoes". * 6512 // "shoes" will use a synonym of "sneakers". 6513 type GoogleCloudRetailV2alphaRuleTwowaySynonymsAction struct { 6514 // Synonyms: Defines a set of synonyms. Can specify up to 100 synonyms. Must 6515 // specify at least 2 synonyms. 6516 Synonyms []string `json:"synonyms,omitempty"` 6517 // ForceSendFields is a list of field names (e.g. "Synonyms") to 6518 // unconditionally include in API requests. By default, fields with empty or 6519 // default values are omitted from API requests. See 6520 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6521 // details. 6522 ForceSendFields []string `json:"-"` 6523 // NullFields is a list of field names (e.g. "Synonyms") to include in API 6524 // requests with the JSON null value. By default, fields with empty values are 6525 // omitted from API requests. See 6526 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6527 NullFields []string `json:"-"` 6528 } 6529 6530 func (s *GoogleCloudRetailV2alphaRuleTwowaySynonymsAction) MarshalJSON() ([]byte, error) { 6531 type NoMethod GoogleCloudRetailV2alphaRuleTwowaySynonymsAction 6532 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6533 } 6534 6535 // GoogleCloudRetailV2alphaSearchRequest: Request message for 6536 // SearchService.Search method. 6537 type GoogleCloudRetailV2alphaSearchRequest struct { 6538 // BoostSpec: Boost specification to boost certain products. For more 6539 // information, see Boost results 6540 // (https://cloud.google.com/retail/docs/boosting). Notice that if both 6541 // ServingConfig.boost_control_ids and SearchRequest.boost_spec are set, the 6542 // boost conditions from both places are evaluated. If a search request matches 6543 // multiple boost conditions, the final boost score is equal to the sum of the 6544 // boost scores from all matched boost conditions. 6545 BoostSpec *GoogleCloudRetailV2alphaSearchRequestBoostSpec `json:"boostSpec,omitempty"` 6546 // Branch: The branch resource name, such as 6547 // `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use 6548 // "default_branch" as the branch ID or leave this field empty, to search 6549 // products under the default branch. 6550 Branch string `json:"branch,omitempty"` 6551 // CanonicalFilter: The default filter that is applied when a user performs a 6552 // search without checking any filters on the search page. The filter applied 6553 // to every search request when quality improvement such as query expansion is 6554 // needed. In the case a query does not have a sufficient amount of results 6555 // this filter will be used to determine whether or not to enable the query 6556 // expansion flow. The original filter will still be used for the query 6557 // expanded search. This field is strongly recommended to achieve high search 6558 // quality. For more information about filter syntax, see SearchRequest.filter. 6559 CanonicalFilter string `json:"canonicalFilter,omitempty"` 6560 // DynamicFacetSpec: Deprecated. Refer to 6561 // https://cloud.google.com/retail/docs/configs#dynamic to enable dynamic 6562 // facets. Do not set this field. The specification for dynamically generated 6563 // facets. Notice that only textual facets can be dynamically generated. 6564 DynamicFacetSpec *GoogleCloudRetailV2alphaSearchRequestDynamicFacetSpec `json:"dynamicFacetSpec,omitempty"` 6565 // Entity: The entity for customers that may run multiple different entities, 6566 // domains, sites or regions, for example, `Google US`, `Google Ads`, `Waymo`, 6567 // `google.com`, `youtube.com`, etc. If this is set, it should be exactly 6568 // matched with UserEvent.entity to get search results boosted by entity. 6569 Entity string `json:"entity,omitempty"` 6570 // FacetSpecs: Facet specifications for faceted search. If empty, no facets are 6571 // returned. A maximum of 200 values are allowed. Otherwise, an 6572 // INVALID_ARGUMENT error is returned. 6573 FacetSpecs []*GoogleCloudRetailV2alphaSearchRequestFacetSpec `json:"facetSpecs,omitempty"` 6574 // Filter: The filter syntax consists of an expression language for 6575 // constructing a predicate from one or more fields of the products being 6576 // filtered. Filter expression is case-sensitive. For more information, see 6577 // Filter (https://cloud.google.com/retail/docs/filter-and-order#filter). If 6578 // this field is unrecognizable, an INVALID_ARGUMENT is returned. 6579 Filter string `json:"filter,omitempty"` 6580 // Labels: The labels applied to a resource must meet the following 6581 // requirements: * Each resource can have multiple labels, up to a maximum of 6582 // 64. * Each label must be a key-value pair. * Keys have a minimum length of 1 6583 // character and a maximum length of 63 characters and cannot be empty. Values 6584 // can be empty and have a maximum length of 63 characters. * Keys and values 6585 // can contain only lowercase letters, numeric characters, underscores, and 6586 // dashes. All characters must use UTF-8 encoding, and international characters 6587 // are allowed. * The key portion of a label must be unique. However, you can 6588 // use the same key with multiple resources. * Keys must start with a lowercase 6589 // letter or international character. For more information, see Requirements 6590 // for labels 6591 // (https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) 6592 // in the Resource Manager documentation. 6593 Labels map[string]string `json:"labels,omitempty"` 6594 // Offset: A 0-indexed integer that specifies the current offset (that is, 6595 // starting result location, amongst the Products deemed by the API as 6596 // relevant) in search results. This field is only considered if page_token is 6597 // unset. If this field is negative, an INVALID_ARGUMENT is returned. 6598 Offset int64 `json:"offset,omitempty"` 6599 // OrderBy: The order in which products are returned. Products can be ordered 6600 // by a field in an Product object. Leave it unset if ordered by relevance. 6601 // OrderBy expression is case-sensitive. For more information, see Order 6602 // (https://cloud.google.com/retail/docs/filter-and-order#order). If this field 6603 // is unrecognizable, an INVALID_ARGUMENT is returned. 6604 OrderBy string `json:"orderBy,omitempty"` 6605 // PageCategories: The categories associated with a category page. Must be set 6606 // for category navigation queries to achieve good search quality. The format 6607 // should be the same as UserEvent.page_categories; To represent full path of 6608 // category, use '>' sign to separate different hierarchies. If '>' is part of 6609 // the category name, replace it with other character(s). Category pages 6610 // include special pages such as sales or promotions. For instance, a special 6611 // sale page may have the category hierarchy: "pageCategories" : ["Sales > 2017 6612 // Black Friday Deals"]. 6613 PageCategories []string `json:"pageCategories,omitempty"` 6614 // PageSize: Maximum number of Products to return. If unspecified, defaults to 6615 // a reasonable value. The maximum allowed value is 120. Values above 120 will 6616 // be coerced to 120. If this field is negative, an INVALID_ARGUMENT is 6617 // returned. 6618 PageSize int64 `json:"pageSize,omitempty"` 6619 // PageToken: A page token SearchResponse.next_page_token, received from a 6620 // previous SearchService.Search call. Provide this to retrieve the subsequent 6621 // page. When paginating, all other parameters provided to SearchService.Search 6622 // must match the call that provided the page token. Otherwise, an 6623 // INVALID_ARGUMENT error is returned. 6624 PageToken string `json:"pageToken,omitempty"` 6625 // PersonalizationSpec: The specification for personalization. Notice that if 6626 // both ServingConfig.personalization_spec and 6627 // SearchRequest.personalization_spec are set. 6628 // SearchRequest.personalization_spec will override 6629 // ServingConfig.personalization_spec. 6630 PersonalizationSpec *GoogleCloudRetailV2alphaSearchRequestPersonalizationSpec `json:"personalizationSpec,omitempty"` 6631 // Query: Raw search query. If this field is empty, the request is considered a 6632 // category browsing request and returned results are based on filter and 6633 // page_categories. 6634 Query string `json:"query,omitempty"` 6635 // QueryExpansionSpec: The query expansion specification that specifies the 6636 // conditions under which query expansion occurs. For more information, see 6637 // Query expansion 6638 // (https://cloud.google.com/retail/docs/result-size#query_expansion). 6639 QueryExpansionSpec *GoogleCloudRetailV2alphaSearchRequestQueryExpansionSpec `json:"queryExpansionSpec,omitempty"` 6640 // RelevanceThreshold: The relevance threshold of the search results. Defaults 6641 // to RelevanceThreshold.HIGH, which means only the most relevant results are 6642 // shown, and the least number of results are returned. For more information, 6643 // see Adjust result size 6644 // (https://cloud.google.com/retail/docs/result-size#relevance_thresholding). 6645 // 6646 // Possible values: 6647 // "RELEVANCE_THRESHOLD_UNSPECIFIED" - Default value. In this case, server 6648 // behavior defaults to RelevanceThreshold.HIGH. 6649 // "HIGH" - High relevance threshold. 6650 // "MEDIUM" - Medium relevance threshold. 6651 // "LOW" - Low relevance threshold. 6652 // "LOWEST" - Lowest relevance threshold. 6653 RelevanceThreshold string `json:"relevanceThreshold,omitempty"` 6654 // SearchMode: The search mode of the search request. If not specified, a 6655 // single search request triggers both product search and faceted search. 6656 // 6657 // Possible values: 6658 // "SEARCH_MODE_UNSPECIFIED" - Default value. In this case both product 6659 // search and faceted search will be performed. Both 6660 // SearchResponse.SearchResult and SearchResponse.Facet will be returned. 6661 // "PRODUCT_SEARCH_ONLY" - Only product search will be performed. The faceted 6662 // search will be disabled. Only SearchResponse.SearchResult will be returned. 6663 // SearchResponse.Facet will not be returned, even if SearchRequest.facet_specs 6664 // or SearchRequest.dynamic_facet_spec is set. 6665 // "FACETED_SEARCH_ONLY" - Only faceted search will be performed. The product 6666 // search will be disabled. When in this mode, one or both of 6667 // SearchRequest.facet_specs and SearchRequest.dynamic_facet_spec should be 6668 // set. Otherwise, an INVALID_ARGUMENT error is returned. Only 6669 // SearchResponse.Facet will be returned. SearchResponse.SearchResult will not 6670 // be returned. 6671 SearchMode string `json:"searchMode,omitempty"` 6672 // SpellCorrectionSpec: The spell correction specification that specifies the 6673 // mode under which spell correction will take effect. 6674 SpellCorrectionSpec *GoogleCloudRetailV2alphaSearchRequestSpellCorrectionSpec `json:"spellCorrectionSpec,omitempty"` 6675 // UserInfo: User information. 6676 UserInfo *GoogleCloudRetailV2alphaUserInfo `json:"userInfo,omitempty"` 6677 // VariantRollupKeys: The keys to fetch and rollup the matching variant 6678 // Products attributes, FulfillmentInfo or LocalInventorys attributes. The 6679 // attributes from all the matching variant Products or LocalInventorys are 6680 // merged and de-duplicated. Notice that rollup attributes will lead to extra 6681 // query latency. Maximum number of keys is 30. For FulfillmentInfo, a 6682 // fulfillment type and a fulfillment ID must be provided in the format of 6683 // "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123", 6684 // "pickupInStore" is fulfillment type and "store123" is the store ID. 6685 // Supported keys are: * colorFamilies * price * originalPrice * discount * 6686 // variantId * inventory(place_id,price) * inventory(place_id,original_price) * 6687 // inventory(place_id,attributes.key), where key is any key in the 6688 // Product.local_inventories.attributes map. * attributes.key, where key is any 6689 // key in the Product.attributes map. * pickupInStore.id, where id is any 6690 // FulfillmentInfo.place_ids for FulfillmentInfo.type "pickup-in-store". * 6691 // shipToStore.id, where id is any FulfillmentInfo.place_ids for 6692 // FulfillmentInfo.type "ship-to-store". * sameDayDelivery.id, where id is any 6693 // FulfillmentInfo.place_ids for FulfillmentInfo.type "same-day-delivery". * 6694 // nextDayDelivery.id, where id is any FulfillmentInfo.place_ids for 6695 // FulfillmentInfo.type "next-day-delivery". * customFulfillment1.id, where id 6696 // is any FulfillmentInfo.place_ids for FulfillmentInfo.type "custom-type-1". * 6697 // customFulfillment2.id, where id is any FulfillmentInfo.place_ids for 6698 // FulfillmentInfo.type "custom-type-2". * customFulfillment3.id, where id is 6699 // any FulfillmentInfo.place_ids for FulfillmentInfo.type "custom-type-3". * 6700 // customFulfillment4.id, where id is any FulfillmentInfo.place_ids for 6701 // FulfillmentInfo.type "custom-type-4". * customFulfillment5.id, where id is 6702 // any FulfillmentInfo.place_ids for FulfillmentInfo.type "custom-type-5". If 6703 // this field is set to an invalid value other than these, an INVALID_ARGUMENT 6704 // error is returned. 6705 VariantRollupKeys []string `json:"variantRollupKeys,omitempty"` 6706 // VisitorId: Required. A unique identifier for tracking visitors. For example, 6707 // this could be implemented with an HTTP cookie, which should be able to 6708 // uniquely identify a visitor on a single device. This unique identifier 6709 // should not change if the visitor logs in or out of the website. This should 6710 // be the same identifier as UserEvent.visitor_id. The field must be a UTF-8 6711 // encoded string with a length limit of 128 characters. Otherwise, an 6712 // INVALID_ARGUMENT error is returned. 6713 VisitorId string `json:"visitorId,omitempty"` 6714 // ForceSendFields is a list of field names (e.g. "BoostSpec") to 6715 // unconditionally include in API requests. By default, fields with empty or 6716 // default values are omitted from API requests. See 6717 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6718 // details. 6719 ForceSendFields []string `json:"-"` 6720 // NullFields is a list of field names (e.g. "BoostSpec") to include in API 6721 // requests with the JSON null value. By default, fields with empty values are 6722 // omitted from API requests. See 6723 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6724 NullFields []string `json:"-"` 6725 } 6726 6727 func (s *GoogleCloudRetailV2alphaSearchRequest) MarshalJSON() ([]byte, error) { 6728 type NoMethod GoogleCloudRetailV2alphaSearchRequest 6729 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6730 } 6731 6732 // GoogleCloudRetailV2alphaSearchRequestBoostSpec: Boost specification to boost 6733 // certain items. 6734 type GoogleCloudRetailV2alphaSearchRequestBoostSpec struct { 6735 // ConditionBoostSpecs: Condition boost specifications. If a product matches 6736 // multiple conditions in the specifictions, boost scores from these 6737 // specifications are all applied and combined in a non-linear way. Maximum 6738 // number of specifications is 20. 6739 ConditionBoostSpecs []*GoogleCloudRetailV2alphaSearchRequestBoostSpecConditionBoostSpec `json:"conditionBoostSpecs,omitempty"` 6740 // SkipBoostSpecValidation: Whether to skip boostspec validation. If this field 6741 // is set to true, invalid BoostSpec.condition_boost_specs will be ignored and 6742 // valid BoostSpec.condition_boost_specs will still be applied. 6743 SkipBoostSpecValidation bool `json:"skipBoostSpecValidation,omitempty"` 6744 // ForceSendFields is a list of field names (e.g. "ConditionBoostSpecs") to 6745 // unconditionally include in API requests. By default, fields with empty or 6746 // default values are omitted from API requests. See 6747 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6748 // details. 6749 ForceSendFields []string `json:"-"` 6750 // NullFields is a list of field names (e.g. "ConditionBoostSpecs") to include 6751 // in API requests with the JSON null value. By default, fields with empty 6752 // values are omitted from API requests. See 6753 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6754 NullFields []string `json:"-"` 6755 } 6756 6757 func (s *GoogleCloudRetailV2alphaSearchRequestBoostSpec) MarshalJSON() ([]byte, error) { 6758 type NoMethod GoogleCloudRetailV2alphaSearchRequestBoostSpec 6759 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6760 } 6761 6762 // GoogleCloudRetailV2alphaSearchRequestBoostSpecConditionBoostSpec: Boost 6763 // applies to products which match a condition. 6764 type GoogleCloudRetailV2alphaSearchRequestBoostSpecConditionBoostSpec struct { 6765 // Boost: Strength of the condition boost, which should be in [-1, 1]. Negative 6766 // boost means demotion. Default is 0.0. Setting to 1.0 gives the item a big 6767 // promotion. However, it does not necessarily mean that the boosted item will 6768 // be the top result at all times, nor that other items will be excluded. 6769 // Results could still be shown even when none of them matches the condition. 6770 // And results that are significantly more relevant to the search query can 6771 // still trump your heavily favored but irrelevant items. Setting to -1.0 gives 6772 // the item a big demotion. However, results that are deeply relevant might 6773 // still be shown. The item will have an upstream battle to get a fairly high 6774 // ranking, but it is not blocked out completely. Setting to 0.0 means no boost 6775 // applied. The boosting condition is ignored. 6776 Boost float64 `json:"boost,omitempty"` 6777 // Condition: An expression which specifies a boost condition. The syntax and 6778 // supported fields are the same as a filter expression. See 6779 // SearchRequest.filter for detail syntax and limitations. Examples: * To boost 6780 // products with product ID "product_1" or "product_2", and color "Red" or 6781 // "Blue": * (id: ANY("product_1", "product_2")) AND (colorFamilies: 6782 // ANY("Red","Blue")) 6783 Condition string `json:"condition,omitempty"` 6784 // ForceSendFields is a list of field names (e.g. "Boost") to unconditionally 6785 // include in API requests. By default, fields with empty or default values are 6786 // omitted from API requests. See 6787 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6788 // details. 6789 ForceSendFields []string `json:"-"` 6790 // NullFields is a list of field names (e.g. "Boost") to include in API 6791 // requests with the JSON null value. By default, fields with empty values are 6792 // omitted from API requests. See 6793 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6794 NullFields []string `json:"-"` 6795 } 6796 6797 func (s *GoogleCloudRetailV2alphaSearchRequestBoostSpecConditionBoostSpec) MarshalJSON() ([]byte, error) { 6798 type NoMethod GoogleCloudRetailV2alphaSearchRequestBoostSpecConditionBoostSpec 6799 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6800 } 6801 6802 func (s *GoogleCloudRetailV2alphaSearchRequestBoostSpecConditionBoostSpec) UnmarshalJSON(data []byte) error { 6803 type NoMethod GoogleCloudRetailV2alphaSearchRequestBoostSpecConditionBoostSpec 6804 var s1 struct { 6805 Boost gensupport.JSONFloat64 `json:"boost"` 6806 *NoMethod 6807 } 6808 s1.NoMethod = (*NoMethod)(s) 6809 if err := json.Unmarshal(data, &s1); err != nil { 6810 return err 6811 } 6812 s.Boost = float64(s1.Boost) 6813 return nil 6814 } 6815 6816 // GoogleCloudRetailV2alphaSearchRequestDynamicFacetSpec: The specifications of 6817 // dynamically generated facets. 6818 type GoogleCloudRetailV2alphaSearchRequestDynamicFacetSpec struct { 6819 // Mode: Mode of the DynamicFacet feature. Defaults to Mode.DISABLED if it's 6820 // unset. 6821 // 6822 // Possible values: 6823 // "MODE_UNSPECIFIED" - Default value. 6824 // "DISABLED" - Disable Dynamic Facet. 6825 // "ENABLED" - Automatic mode built by Google Retail Search. 6826 Mode string `json:"mode,omitempty"` 6827 // ForceSendFields is a list of field names (e.g. "Mode") to unconditionally 6828 // include in API requests. By default, fields with empty or default values are 6829 // omitted from API requests. See 6830 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6831 // details. 6832 ForceSendFields []string `json:"-"` 6833 // NullFields is a list of field names (e.g. "Mode") to include in API requests 6834 // with the JSON null value. By default, fields with empty values are omitted 6835 // from API requests. See 6836 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6837 NullFields []string `json:"-"` 6838 } 6839 6840 func (s *GoogleCloudRetailV2alphaSearchRequestDynamicFacetSpec) MarshalJSON() ([]byte, error) { 6841 type NoMethod GoogleCloudRetailV2alphaSearchRequestDynamicFacetSpec 6842 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6843 } 6844 6845 // GoogleCloudRetailV2alphaSearchRequestFacetSpec: A facet specification to 6846 // perform faceted search. 6847 type GoogleCloudRetailV2alphaSearchRequestFacetSpec struct { 6848 // EnableDynamicPosition: Enables dynamic position for this facet. If set to 6849 // true, the position of this facet among all facets in the response is 6850 // determined by Google Retail Search. It is ordered together with dynamic 6851 // facets if dynamic facets is enabled. If set to false, the position of this 6852 // facet in the response is the same as in the request, and it is ranked before 6853 // the facets with dynamic position enable and all dynamic facets. For example, 6854 // you may always want to have rating facet returned in the response, but it's 6855 // not necessarily to always display the rating facet at the top. In that case, 6856 // you can set enable_dynamic_position to true so that the position of rating 6857 // facet in response is determined by Google Retail Search. Another example, 6858 // assuming you have the following facets in the request: * "rating", 6859 // enable_dynamic_position = true * "price", enable_dynamic_position = false * 6860 // "brands", enable_dynamic_position = false And also you have a dynamic facets 6861 // enable, which generates a facet "gender". Then, the final order of the 6862 // facets in the response can be ("price", "brands", "rating", "gender") or 6863 // ("price", "brands", "gender", "rating") depends on how Google Retail Search 6864 // orders "gender" and "rating" facets. However, notice that "price" and 6865 // "brands" are always ranked at first and second position because their 6866 // enable_dynamic_position values are false. 6867 EnableDynamicPosition bool `json:"enableDynamicPosition,omitempty"` 6868 // ExcludedFilterKeys: List of keys to exclude when faceting. By default, 6869 // FacetKey.key is not excluded from the filter unless it is listed in this 6870 // field. Listing a facet key in this field allows its values to appear as 6871 // facet results, even when they are filtered out of search results. Using this 6872 // field does not affect what search results are returned. For example, suppose 6873 // there are 100 products with the color facet "Red" and 200 products with the 6874 // color facet "Blue". A query containing the filter "colorFamilies:ANY("Red")" 6875 // and having "colorFamilies" as FacetKey.key would by default return only 6876 // "Red" products in the search results, and also return "Red" with count 100 6877 // as the only color facet. Although there are also blue products available, 6878 // "Blue" would not be shown as an available facet value. If "colorFamilies" is 6879 // listed in "excludedFilterKeys", then the query returns the facet values 6880 // "Red" with count 100 and "Blue" with count 200, because the "colorFamilies" 6881 // key is now excluded from the filter. Because this field doesn't affect 6882 // search results, the search results are still correctly filtered to return 6883 // only "Red" products. A maximum of 100 values are allowed. Otherwise, an 6884 // INVALID_ARGUMENT error is returned. 6885 ExcludedFilterKeys []string `json:"excludedFilterKeys,omitempty"` 6886 // FacetKey: Required. The facet key specification. 6887 FacetKey *GoogleCloudRetailV2alphaSearchRequestFacetSpecFacetKey `json:"facetKey,omitempty"` 6888 // Limit: Maximum of facet values that should be returned for this facet. If 6889 // unspecified, defaults to 50. The maximum allowed value is 300. Values above 6890 // 300 will be coerced to 300. If this field is negative, an INVALID_ARGUMENT 6891 // is returned. 6892 Limit int64 `json:"limit,omitempty"` 6893 // ForceSendFields is a list of field names (e.g. "EnableDynamicPosition") to 6894 // unconditionally include in API requests. By default, fields with empty or 6895 // default values are omitted from API requests. See 6896 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6897 // details. 6898 ForceSendFields []string `json:"-"` 6899 // NullFields is a list of field names (e.g. "EnableDynamicPosition") to 6900 // include in API requests with the JSON null value. By default, fields with 6901 // empty values are omitted from API requests. See 6902 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6903 NullFields []string `json:"-"` 6904 } 6905 6906 func (s *GoogleCloudRetailV2alphaSearchRequestFacetSpec) MarshalJSON() ([]byte, error) { 6907 type NoMethod GoogleCloudRetailV2alphaSearchRequestFacetSpec 6908 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6909 } 6910 6911 // GoogleCloudRetailV2alphaSearchRequestFacetSpecFacetKey: Specifies how a 6912 // facet is computed. 6913 type GoogleCloudRetailV2alphaSearchRequestFacetSpecFacetKey struct { 6914 // CaseInsensitive: True to make facet keys case insensitive when getting 6915 // faceting values with prefixes or contains; false otherwise. 6916 CaseInsensitive bool `json:"caseInsensitive,omitempty"` 6917 // Contains: Only get facet values that contains the given strings. For 6918 // example, suppose "categories" has three values "Women > Shoe", "Women > 6919 // Dress" and "Men > Shoe". If set "contains" to "Shoe", the "categories" facet 6920 // gives only "Women > Shoe" and "Men > Shoe". Only supported on textual 6921 // fields. Maximum is 10. 6922 Contains []string `json:"contains,omitempty"` 6923 // Intervals: Set only if values should be bucketized into intervals. Must be 6924 // set for facets with numerical values. Must not be set for facet with text 6925 // values. Maximum number of intervals is 40. For all numerical facet keys that 6926 // appear in the list of products from the catalog, the percentiles 0, 10, 30, 6927 // 50, 70, 90, and 100 are computed from their distribution weekly. If the 6928 // model assigns a high score to a numerical facet key and its intervals are 6929 // not specified in the search request, these percentiles become the bounds for 6930 // its intervals and are returned in the response. If the facet key intervals 6931 // are specified in the request, then the specified intervals are returned 6932 // instead. 6933 Intervals []*GoogleCloudRetailV2alphaInterval `json:"intervals,omitempty"` 6934 // Key: Required. Supported textual and numerical facet keys in Product object, 6935 // over which the facet values are computed. Facet key is case-sensitive. 6936 // Allowed facet keys when FacetKey.query is not specified: * textual_field = * 6937 // "brands" * "categories" * "genders" * "ageGroups" * "availability" * 6938 // "colorFamilies" * "colors" * "sizes" * "materials" * "patterns" * 6939 // "conditions" * "attributes.key" * "pickupInStore" * "shipToStore" * 6940 // "sameDayDelivery" * "nextDayDelivery" * "customFulfillment1" * 6941 // "customFulfillment2" * "customFulfillment3" * "customFulfillment4" * 6942 // "customFulfillment5" * "inventory(place_id,attributes.key)" * 6943 // numerical_field = * "price" * "discount" * "rating" * "ratingCount" * 6944 // "attributes.key" * "inventory(place_id,price)" * 6945 // "inventory(place_id,original_price)" * "inventory(place_id,attributes.key)" 6946 Key string `json:"key,omitempty"` 6947 // OrderBy: The order in which SearchResponse.Facet.values are returned. 6948 // Allowed values are: * "count desc", which means order by 6949 // SearchResponse.Facet.values.count descending. * "value desc", which means 6950 // order by SearchResponse.Facet.values.value descending. Only applies to 6951 // textual facets. If not set, textual values are sorted in natural order 6952 // (https://en.wikipedia.org/wiki/Natural_sort_order); numerical intervals are 6953 // sorted in the order given by FacetSpec.FacetKey.intervals; 6954 // FulfillmentInfo.place_ids are sorted in the order given by 6955 // FacetSpec.FacetKey.restricted_values. 6956 OrderBy string `json:"orderBy,omitempty"` 6957 // Prefixes: Only get facet values that start with the given string prefix. For 6958 // example, suppose "categories" has three values "Women > Shoe", "Women > 6959 // Dress" and "Men > Shoe". If set "prefixes" to "Women", the "categories" 6960 // facet gives only "Women > Shoe" and "Women > Dress". Only supported on 6961 // textual fields. Maximum is 10. 6962 Prefixes []string `json:"prefixes,omitempty"` 6963 // Query: The query that is used to compute facet for the given facet key. When 6964 // provided, it overrides the default behavior of facet computation. The query 6965 // syntax is the same as a filter expression. See SearchRequest.filter for 6966 // detail syntax and limitations. Notice that there is no limitation on 6967 // FacetKey.key when query is specified. In the response, 6968 // SearchResponse.Facet.values.value is always "1" and 6969 // SearchResponse.Facet.values.count is the number of results that match the 6970 // query. For example, you can set a customized facet for "shipToStore", where 6971 // FacetKey.key is "customizedShipToStore", and FacetKey.query is 6972 // "availability: ANY(\"IN_STOCK\") AND shipToStore: ANY(\"123\")". Then the 6973 // facet counts the products that are both in stock and ship to store "123". 6974 Query string `json:"query,omitempty"` 6975 // RestrictedValues: Only get facet for the given restricted values. For 6976 // example, when using "pickupInStore" as key and set restricted values to 6977 // ["store123", "store456"], only facets for "store123" and "store456" are 6978 // returned. Only supported on predefined textual fields, custom textual 6979 // attributes and fulfillments. Maximum is 20. Must be set for the fulfillment 6980 // facet keys: * pickupInStore * shipToStore * sameDayDelivery * 6981 // nextDayDelivery * customFulfillment1 * customFulfillment2 * 6982 // customFulfillment3 * customFulfillment4 * customFulfillment5 6983 RestrictedValues []string `json:"restrictedValues,omitempty"` 6984 // ReturnMinMax: Returns the min and max value for each numerical facet 6985 // intervals. Ignored for textual facets. 6986 ReturnMinMax bool `json:"returnMinMax,omitempty"` 6987 // ForceSendFields is a list of field names (e.g. "CaseInsensitive") to 6988 // unconditionally include in API requests. By default, fields with empty or 6989 // default values are omitted from API requests. See 6990 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6991 // details. 6992 ForceSendFields []string `json:"-"` 6993 // NullFields is a list of field names (e.g. "CaseInsensitive") to include in 6994 // API requests with the JSON null value. By default, fields with empty values 6995 // are omitted from API requests. See 6996 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6997 NullFields []string `json:"-"` 6998 } 6999 7000 func (s *GoogleCloudRetailV2alphaSearchRequestFacetSpecFacetKey) MarshalJSON() ([]byte, error) { 7001 type NoMethod GoogleCloudRetailV2alphaSearchRequestFacetSpecFacetKey 7002 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7003 } 7004 7005 // GoogleCloudRetailV2alphaSearchRequestPersonalizationSpec: The specification 7006 // for personalization. 7007 type GoogleCloudRetailV2alphaSearchRequestPersonalizationSpec struct { 7008 // Mode: Defaults to Mode.AUTO. 7009 // 7010 // Possible values: 7011 // "MODE_UNSPECIFIED" - Default value. In this case, server behavior defaults 7012 // to Mode.AUTO. 7013 // "AUTO" - Let CRS decide whether to use personalization based on quality of 7014 // user event data. 7015 // "DISABLED" - Disable personalization. 7016 Mode string `json:"mode,omitempty"` 7017 // ForceSendFields is a list of field names (e.g. "Mode") to unconditionally 7018 // include in API requests. By default, fields with empty or default values are 7019 // omitted from API requests. See 7020 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7021 // details. 7022 ForceSendFields []string `json:"-"` 7023 // NullFields is a list of field names (e.g. "Mode") to include in API requests 7024 // with the JSON null value. By default, fields with empty values are omitted 7025 // from API requests. See 7026 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7027 NullFields []string `json:"-"` 7028 } 7029 7030 func (s *GoogleCloudRetailV2alphaSearchRequestPersonalizationSpec) MarshalJSON() ([]byte, error) { 7031 type NoMethod GoogleCloudRetailV2alphaSearchRequestPersonalizationSpec 7032 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7033 } 7034 7035 // GoogleCloudRetailV2alphaSearchRequestQueryExpansionSpec: Specification to 7036 // determine under which conditions query expansion should occur. 7037 type GoogleCloudRetailV2alphaSearchRequestQueryExpansionSpec struct { 7038 // Condition: The condition under which query expansion should occur. Default 7039 // to Condition.DISABLED. 7040 // 7041 // Possible values: 7042 // "CONDITION_UNSPECIFIED" - Unspecified query expansion condition. In this 7043 // case, server behavior defaults to Condition.DISABLED. 7044 // "DISABLED" - Disabled query expansion. Only the exact search query is 7045 // used, even if SearchResponse.total_size is zero. 7046 // "AUTO" - Automatic query expansion built by Google Retail Search. 7047 Condition string `json:"condition,omitempty"` 7048 // PinUnexpandedResults: Whether to pin unexpanded results. If this field is 7049 // set to true, unexpanded products are always at the top of the search 7050 // results, followed by the expanded results. 7051 PinUnexpandedResults bool `json:"pinUnexpandedResults,omitempty"` 7052 // ForceSendFields is a list of field names (e.g. "Condition") to 7053 // unconditionally include in API requests. By default, fields with empty or 7054 // default values are omitted from API requests. See 7055 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7056 // details. 7057 ForceSendFields []string `json:"-"` 7058 // NullFields is a list of field names (e.g. "Condition") to include in API 7059 // requests with the JSON null value. By default, fields with empty values are 7060 // omitted from API requests. See 7061 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7062 NullFields []string `json:"-"` 7063 } 7064 7065 func (s *GoogleCloudRetailV2alphaSearchRequestQueryExpansionSpec) MarshalJSON() ([]byte, error) { 7066 type NoMethod GoogleCloudRetailV2alphaSearchRequestQueryExpansionSpec 7067 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7068 } 7069 7070 // GoogleCloudRetailV2alphaSearchRequestSpellCorrectionSpec: The specification 7071 // for query spell correction. 7072 type GoogleCloudRetailV2alphaSearchRequestSpellCorrectionSpec struct { 7073 // Mode: The mode under which spell correction should take effect to replace 7074 // the original search query. Default to Mode.AUTO. 7075 // 7076 // Possible values: 7077 // "MODE_UNSPECIFIED" - Unspecified spell correction mode. In this case, 7078 // server behavior defaults to Mode.AUTO. 7079 // "SUGGESTION_ONLY" - Google Retail Search will try to find a spell 7080 // suggestion if there is any and put in the SearchResponse.corrected_query. 7081 // The spell suggestion will not be used as the search query. 7082 // "AUTO" - Automatic spell correction built by Google Retail Search. Search 7083 // will be based on the corrected query if found. 7084 Mode string `json:"mode,omitempty"` 7085 // ForceSendFields is a list of field names (e.g. "Mode") to unconditionally 7086 // include in API requests. By default, fields with empty or default values are 7087 // omitted from API requests. See 7088 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7089 // details. 7090 ForceSendFields []string `json:"-"` 7091 // NullFields is a list of field names (e.g. "Mode") to include in API requests 7092 // with the JSON null value. By default, fields with empty values are omitted 7093 // from API requests. See 7094 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7095 NullFields []string `json:"-"` 7096 } 7097 7098 func (s *GoogleCloudRetailV2alphaSearchRequestSpellCorrectionSpec) MarshalJSON() ([]byte, error) { 7099 type NoMethod GoogleCloudRetailV2alphaSearchRequestSpellCorrectionSpec 7100 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7101 } 7102 7103 // GoogleCloudRetailV2alphaSearchResponse: Response message for 7104 // SearchService.Search method. 7105 type GoogleCloudRetailV2alphaSearchResponse struct { 7106 // AppliedControls: The fully qualified resource name of applied controls 7107 // (https://cloud.google.com/retail/docs/serving-control-rules). 7108 AppliedControls []string `json:"appliedControls,omitempty"` 7109 // AttributionToken: A unique search token. This should be included in the 7110 // UserEvent logs resulting from this search, which enables accurate 7111 // attribution of search model performance. 7112 AttributionToken string `json:"attributionToken,omitempty"` 7113 // CorrectedQuery: Contains the spell corrected query, if found. If the spell 7114 // correction type is AUTOMATIC, then the search results are based on 7115 // corrected_query. Otherwise the original query is used for search. 7116 CorrectedQuery string `json:"correctedQuery,omitempty"` 7117 // ExperimentInfo: Metadata related to A/B testing Experiment associated with 7118 // this response. Only exists when an experiment is triggered. 7119 ExperimentInfo []*GoogleCloudRetailV2alphaExperimentInfo `json:"experimentInfo,omitempty"` 7120 // Facets: Results of facets requested by user. 7121 Facets []*GoogleCloudRetailV2alphaSearchResponseFacet `json:"facets,omitempty"` 7122 // InvalidConditionBoostSpecs: The invalid 7123 // SearchRequest.BoostSpec.condition_boost_specs that are not applied during 7124 // serving. 7125 InvalidConditionBoostSpecs []*GoogleCloudRetailV2alphaSearchRequestBoostSpecConditionBoostSpec `json:"invalidConditionBoostSpecs,omitempty"` 7126 // NextPageToken: A token that can be sent as SearchRequest.page_token to 7127 // retrieve the next page. If this field is omitted, there are no subsequent 7128 // pages. 7129 NextPageToken string `json:"nextPageToken,omitempty"` 7130 // QueryExpansionInfo: Query expansion information for the returned results. 7131 QueryExpansionInfo *GoogleCloudRetailV2alphaSearchResponseQueryExpansionInfo `json:"queryExpansionInfo,omitempty"` 7132 // RedirectUri: The URI of a customer-defined redirect page. If redirect action 7133 // is triggered, no search is performed, and only redirect_uri and 7134 // attribution_token are set in the response. 7135 RedirectUri string `json:"redirectUri,omitempty"` 7136 // Results: A list of matched items. The order represents the ranking. 7137 Results []*GoogleCloudRetailV2alphaSearchResponseSearchResult `json:"results,omitempty"` 7138 // TotalSize: The estimated total count of matched items irrespective of 7139 // pagination. The count of results returned by pagination may be less than the 7140 // total_size that matches. 7141 TotalSize int64 `json:"totalSize,omitempty"` 7142 7143 // ServerResponse contains the HTTP response code and headers from the server. 7144 googleapi.ServerResponse `json:"-"` 7145 // ForceSendFields is a list of field names (e.g. "AppliedControls") to 7146 // unconditionally include in API requests. By default, fields with empty or 7147 // default values are omitted from API requests. See 7148 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7149 // details. 7150 ForceSendFields []string `json:"-"` 7151 // NullFields is a list of field names (e.g. "AppliedControls") to include in 7152 // API requests with the JSON null value. By default, fields with empty values 7153 // are omitted from API requests. See 7154 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7155 NullFields []string `json:"-"` 7156 } 7157 7158 func (s *GoogleCloudRetailV2alphaSearchResponse) MarshalJSON() ([]byte, error) { 7159 type NoMethod GoogleCloudRetailV2alphaSearchResponse 7160 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7161 } 7162 7163 // GoogleCloudRetailV2alphaSearchResponseFacet: A facet result. 7164 type GoogleCloudRetailV2alphaSearchResponseFacet struct { 7165 // DynamicFacet: Whether the facet is dynamically generated. 7166 DynamicFacet bool `json:"dynamicFacet,omitempty"` 7167 // Key: The key for this facet. E.g., "colorFamilies" or "price" or 7168 // "attributes.attr1". 7169 Key string `json:"key,omitempty"` 7170 // Values: The facet values for this field. 7171 Values []*GoogleCloudRetailV2alphaSearchResponseFacetFacetValue `json:"values,omitempty"` 7172 // ForceSendFields is a list of field names (e.g. "DynamicFacet") to 7173 // unconditionally include in API requests. By default, fields with empty or 7174 // default values are omitted from API requests. See 7175 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7176 // details. 7177 ForceSendFields []string `json:"-"` 7178 // NullFields is a list of field names (e.g. "DynamicFacet") to include in API 7179 // requests with the JSON null value. By default, fields with empty values are 7180 // omitted from API requests. See 7181 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7182 NullFields []string `json:"-"` 7183 } 7184 7185 func (s *GoogleCloudRetailV2alphaSearchResponseFacet) MarshalJSON() ([]byte, error) { 7186 type NoMethod GoogleCloudRetailV2alphaSearchResponseFacet 7187 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7188 } 7189 7190 // GoogleCloudRetailV2alphaSearchResponseFacetFacetValue: A facet value which 7191 // contains value names and their count. 7192 type GoogleCloudRetailV2alphaSearchResponseFacetFacetValue struct { 7193 // Count: Number of items that have this facet value. 7194 Count int64 `json:"count,omitempty,string"` 7195 // Interval: Interval value for a facet, such as [10, 20) for facet "price". 7196 Interval *GoogleCloudRetailV2alphaInterval `json:"interval,omitempty"` 7197 // MaxValue: The maximum value in the FacetValue.interval. Only supported on 7198 // numerical facets and returned if 7199 // SearchRequest.FacetSpec.FacetKey.return_min_max is true. 7200 MaxValue float64 `json:"maxValue,omitempty"` 7201 // MinValue: The minimum value in the FacetValue.interval. Only supported on 7202 // numerical facets and returned if 7203 // SearchRequest.FacetSpec.FacetKey.return_min_max is true. 7204 MinValue float64 `json:"minValue,omitempty"` 7205 // Value: Text value of a facet, such as "Black" for facet "colorFamilies". 7206 Value string `json:"value,omitempty"` 7207 // ForceSendFields is a list of field names (e.g. "Count") to unconditionally 7208 // include in API requests. By default, fields with empty or default values are 7209 // omitted from API requests. See 7210 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7211 // details. 7212 ForceSendFields []string `json:"-"` 7213 // NullFields is a list of field names (e.g. "Count") to include in API 7214 // requests with the JSON null value. By default, fields with empty values are 7215 // omitted from API requests. See 7216 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7217 NullFields []string `json:"-"` 7218 } 7219 7220 func (s *GoogleCloudRetailV2alphaSearchResponseFacetFacetValue) MarshalJSON() ([]byte, error) { 7221 type NoMethod GoogleCloudRetailV2alphaSearchResponseFacetFacetValue 7222 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7223 } 7224 7225 func (s *GoogleCloudRetailV2alphaSearchResponseFacetFacetValue) UnmarshalJSON(data []byte) error { 7226 type NoMethod GoogleCloudRetailV2alphaSearchResponseFacetFacetValue 7227 var s1 struct { 7228 MaxValue gensupport.JSONFloat64 `json:"maxValue"` 7229 MinValue gensupport.JSONFloat64 `json:"minValue"` 7230 *NoMethod 7231 } 7232 s1.NoMethod = (*NoMethod)(s) 7233 if err := json.Unmarshal(data, &s1); err != nil { 7234 return err 7235 } 7236 s.MaxValue = float64(s1.MaxValue) 7237 s.MinValue = float64(s1.MinValue) 7238 return nil 7239 } 7240 7241 // GoogleCloudRetailV2alphaSearchResponseQueryExpansionInfo: Information 7242 // describing query expansion including whether expansion has occurred. 7243 type GoogleCloudRetailV2alphaSearchResponseQueryExpansionInfo struct { 7244 // ExpandedQuery: Bool describing whether query expansion has occurred. 7245 ExpandedQuery bool `json:"expandedQuery,omitempty"` 7246 // PinnedResultCount: Number of pinned results. This field will only be set 7247 // when expansion happens and 7248 // SearchRequest.QueryExpansionSpec.pin_unexpanded_results is set to true. 7249 PinnedResultCount int64 `json:"pinnedResultCount,omitempty,string"` 7250 // ForceSendFields is a list of field names (e.g. "ExpandedQuery") to 7251 // unconditionally include in API requests. By default, fields with empty or 7252 // default values are omitted from API requests. See 7253 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7254 // details. 7255 ForceSendFields []string `json:"-"` 7256 // NullFields is a list of field names (e.g. "ExpandedQuery") to include in API 7257 // requests with the JSON null value. By default, fields with empty values are 7258 // omitted from API requests. See 7259 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7260 NullFields []string `json:"-"` 7261 } 7262 7263 func (s *GoogleCloudRetailV2alphaSearchResponseQueryExpansionInfo) MarshalJSON() ([]byte, error) { 7264 type NoMethod GoogleCloudRetailV2alphaSearchResponseQueryExpansionInfo 7265 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7266 } 7267 7268 // GoogleCloudRetailV2alphaSearchResponseSearchResult: Represents the search 7269 // results. 7270 type GoogleCloudRetailV2alphaSearchResponseSearchResult struct { 7271 // Id: Product.id of the searched Product. 7272 Id string `json:"id,omitempty"` 7273 // MatchingVariantCount: The count of matched variant Products. 7274 MatchingVariantCount int64 `json:"matchingVariantCount,omitempty"` 7275 // MatchingVariantFields: If a variant Product matches the search query, this 7276 // map indicates which Product fields are matched. The key is the Product.name, 7277 // the value is a field mask of the matched Product fields. If matched 7278 // attributes cannot be determined, this map will be empty. For example, a key 7279 // "sku1" with field mask "products.color_info" indicates there is a match 7280 // between "sku1" ColorInfo and the query. 7281 MatchingVariantFields map[string]string `json:"matchingVariantFields,omitempty"` 7282 // PersonalLabels: Specifies previous events related to this product for this 7283 // user based on UserEvent with same SearchRequest.visitor_id or 7284 // UserInfo.user_id. This is set only when 7285 // SearchRequest.PersonalizationSpec.mode is 7286 // SearchRequest.PersonalizationSpec.Mode.AUTO. Possible values: * `purchased`: 7287 // Indicates that this product has been purchased before. 7288 PersonalLabels []string `json:"personalLabels,omitempty"` 7289 // Product: The product data snippet in the search response. Only Product.name 7290 // is guaranteed to be populated. Product.variants contains the product 7291 // variants that match the search query. If there are multiple product variants 7292 // matching the query, top 5 most relevant product variants are returned and 7293 // ordered by relevancy. If relevancy can be deternmined, use 7294 // matching_variant_fields to look up matched product variants fields. If 7295 // relevancy cannot be determined, e.g. when searching "shoe" all products in a 7296 // shoe product can be a match, 5 product variants are returned but order is 7297 // meaningless. 7298 Product *GoogleCloudRetailV2alphaProduct `json:"product,omitempty"` 7299 // VariantRollupValues: The rollup matching variant Product attributes. The key 7300 // is one of the SearchRequest.variant_rollup_keys. The values are the merged 7301 // and de-duplicated Product attributes. Notice that the rollup values are 7302 // respect filter. For example, when filtering by "colorFamilies:ANY(\"red\")" 7303 // and rollup "colorFamilies", only "red" is returned. For textual and 7304 // numerical attributes, the rollup values is a list of string or double values 7305 // with type google.protobuf.ListValue. For example, if there are two variants 7306 // with colors "red" and "blue", the rollup values are { key: "colorFamilies" 7307 // value { list_value { values { string_value: "red" } values { string_value: 7308 // "blue" } } } } For FulfillmentInfo, the rollup values is a double value with 7309 // type google.protobuf.Value. For example, `{key: "pickupInStore.store1" value 7310 // { number_value: 10 }}` means a there are 10 variants in this product are 7311 // available in the store "store1". 7312 VariantRollupValues googleapi.RawMessage `json:"variantRollupValues,omitempty"` 7313 // ForceSendFields is a list of field names (e.g. "Id") to unconditionally 7314 // include in API requests. By default, fields with empty or default values are 7315 // omitted from API requests. See 7316 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7317 // details. 7318 ForceSendFields []string `json:"-"` 7319 // NullFields is a list of field names (e.g. "Id") to include in API requests 7320 // with the JSON null value. By default, fields with empty values are omitted 7321 // from API requests. See 7322 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7323 NullFields []string `json:"-"` 7324 } 7325 7326 func (s *GoogleCloudRetailV2alphaSearchResponseSearchResult) MarshalJSON() ([]byte, error) { 7327 type NoMethod GoogleCloudRetailV2alphaSearchResponseSearchResult 7328 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7329 } 7330 7331 // GoogleCloudRetailV2alphaServingConfig: Configures metadata that is used to 7332 // generate serving time results (e.g. search results or recommendation 7333 // predictions). 7334 type GoogleCloudRetailV2alphaServingConfig struct { 7335 // BoostControlIds: Condition boost specifications. If a product matches 7336 // multiple conditions in the specifications, boost scores from these 7337 // specifications are all applied and combined in a non-linear way. Maximum 7338 // number of specifications is 100. Notice that if both 7339 // ServingConfig.boost_control_ids and SearchRequest.boost_spec are set, the 7340 // boost conditions from both places are evaluated. If a search request matches 7341 // multiple boost conditions, the final boost score is equal to the sum of the 7342 // boost scores from all matched boost conditions. Can only be set if 7343 // solution_types is SOLUTION_TYPE_SEARCH. 7344 BoostControlIds []string `json:"boostControlIds,omitempty"` 7345 // DisplayName: Required. The human readable serving config display name. Used 7346 // in Retail UI. This field must be a UTF-8 encoded string with a length limit 7347 // of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. 7348 DisplayName string `json:"displayName,omitempty"` 7349 // DiversityLevel: How much diversity to use in recommendation model results 7350 // e.g. `medium-diversity` or `high-diversity`. Currently supported values: * 7351 // `no-diversity` * `low-diversity` * `medium-diversity` * `high-diversity` * 7352 // `auto-diversity` If not specified, we choose default based on recommendation 7353 // model type. Default value: `no-diversity`. Can only be set if solution_types 7354 // is SOLUTION_TYPE_RECOMMENDATION. 7355 DiversityLevel string `json:"diversityLevel,omitempty"` 7356 // DiversityType: What kind of diversity to use - data driven or rule based. If 7357 // unset, the server behavior defaults to RULE_BASED_DIVERSITY. 7358 // 7359 // Possible values: 7360 // "DIVERSITY_TYPE_UNSPECIFIED" - Default value. 7361 // "RULE_BASED_DIVERSITY" - Rule based diversity. 7362 // "DATA_DRIVEN_DIVERSITY" - Data driven diversity. 7363 DiversityType string `json:"diversityType,omitempty"` 7364 // DoNotAssociateControlIds: Condition do not associate specifications. If 7365 // multiple do not associate conditions match, all matching do not associate 7366 // controls in the list will execute. - Order does not matter. - Maximum number 7367 // of specifications is 100. Can only be set if solution_types is 7368 // SOLUTION_TYPE_SEARCH. 7369 DoNotAssociateControlIds []string `json:"doNotAssociateControlIds,omitempty"` 7370 // DynamicFacetSpec: The specification for dynamically generated facets. Notice 7371 // that only textual facets can be dynamically generated. Can only be set if 7372 // solution_types is SOLUTION_TYPE_SEARCH. 7373 DynamicFacetSpec *GoogleCloudRetailV2alphaSearchRequestDynamicFacetSpec `json:"dynamicFacetSpec,omitempty"` 7374 // EnableCategoryFilterLevel: Whether to add additional category filters on the 7375 // `similar-items` model. If not specified, we enable it by default. Allowed 7376 // values are: * `no-category-match`: No additional filtering of original 7377 // results from the model and the customer's filters. * 7378 // `relaxed-category-match`: Only keep results with categories that match at 7379 // least one item categories in the PredictRequests's context item. * If 7380 // customer also sends filters in the PredictRequest, then the results will 7381 // satisfy both conditions (user given and category match). Can only be set if 7382 // solution_types is SOLUTION_TYPE_RECOMMENDATION. 7383 EnableCategoryFilterLevel string `json:"enableCategoryFilterLevel,omitempty"` 7384 // FacetControlIds: Facet specifications for faceted search. If empty, no 7385 // facets are returned. The ids refer to the ids of Control resources with only 7386 // the Facet control set. These controls are assumed to be in the same Catalog 7387 // as the ServingConfig. A maximum of 100 values are allowed. Otherwise, an 7388 // INVALID_ARGUMENT error is returned. Can only be set if solution_types is 7389 // SOLUTION_TYPE_SEARCH. 7390 FacetControlIds []string `json:"facetControlIds,omitempty"` 7391 // FilterControlIds: Condition filter specifications. If a product matches 7392 // multiple conditions in the specifications, filters from these specifications 7393 // are all applied and combined via the AND operator. Maximum number of 7394 // specifications is 100. Can only be set if solution_types is 7395 // SOLUTION_TYPE_SEARCH. 7396 FilterControlIds []string `json:"filterControlIds,omitempty"` 7397 // IgnoreControlIds: Condition ignore specifications. If multiple ignore 7398 // conditions match, all matching ignore controls in the list will execute. - 7399 // Order does not matter. - Maximum number of specifications is 100. Can only 7400 // be set if solution_types is SOLUTION_TYPE_SEARCH. 7401 IgnoreControlIds []string `json:"ignoreControlIds,omitempty"` 7402 // IgnoreRecsDenylist: When the flag is enabled, the products in the denylist 7403 // will not be filtered out in the recommendation filtering results. 7404 IgnoreRecsDenylist bool `json:"ignoreRecsDenylist,omitempty"` 7405 // ModelId: The id of the model in the same Catalog to use at serving time. 7406 // Currently only RecommendationModels are supported: 7407 // https://cloud.google.com/retail/recommendations-ai/docs/create-models Can be 7408 // changed but only to a compatible model (e.g. others-you-may-like CTR to 7409 // others-you-may-like CVR). Required when solution_types is 7410 // SOLUTION_TYPE_RECOMMENDATION. 7411 ModelId string `json:"modelId,omitempty"` 7412 // Name: Immutable. Fully qualified name 7413 // `projects/*/locations/global/catalogs/*/servingConfig/*` 7414 Name string `json:"name,omitempty"` 7415 // OnewaySynonymsControlIds: Condition oneway synonyms specifications. If 7416 // multiple oneway synonyms conditions match, all matching oneway synonyms 7417 // controls in the list will execute. Order of controls in the list will not 7418 // matter. Maximum number of specifications is 100. Can only be set if 7419 // solution_types is SOLUTION_TYPE_SEARCH. 7420 OnewaySynonymsControlIds []string `json:"onewaySynonymsControlIds,omitempty"` 7421 // PersonalizationSpec: The specification for personalization spec. Can only be 7422 // set if solution_types is SOLUTION_TYPE_SEARCH. Notice that if both 7423 // ServingConfig.personalization_spec and SearchRequest.personalization_spec 7424 // are set. SearchRequest.personalization_spec will override 7425 // ServingConfig.personalization_spec. 7426 PersonalizationSpec *GoogleCloudRetailV2alphaSearchRequestPersonalizationSpec `json:"personalizationSpec,omitempty"` 7427 // PriceRerankingLevel: How much price ranking we want in serving results. 7428 // Price reranking causes product items with a similar recommendation 7429 // probability to be ordered by price, with the highest-priced items first. 7430 // This setting could result in a decrease in click-through and conversion 7431 // rates. Allowed values are: * `no-price-reranking` * `low-price-reranking` * 7432 // `medium-price-reranking` * `high-price-reranking` If not specified, we 7433 // choose default based on model type. Default value: `no-price-reranking`. Can 7434 // only be set if solution_types is SOLUTION_TYPE_RECOMMENDATION. 7435 PriceRerankingLevel string `json:"priceRerankingLevel,omitempty"` 7436 // RedirectControlIds: Condition redirect specifications. Only the first 7437 // triggered redirect action is applied, even if multiple apply. Maximum number 7438 // of specifications is 1000. Can only be set if solution_types is 7439 // SOLUTION_TYPE_SEARCH. 7440 RedirectControlIds []string `json:"redirectControlIds,omitempty"` 7441 // ReplacementControlIds: Condition replacement specifications. - Applied 7442 // according to the order in the list. - A previously replaced term can not be 7443 // re-replaced. - Maximum number of specifications is 100. Can only be set if 7444 // solution_types is SOLUTION_TYPE_SEARCH. 7445 ReplacementControlIds []string `json:"replacementControlIds,omitempty"` 7446 // SolutionTypes: Required. Immutable. Specifies the solution types that a 7447 // serving config can be associated with. Currently we support setting only one 7448 // type of solution. 7449 // 7450 // Possible values: 7451 // "SOLUTION_TYPE_UNSPECIFIED" - Default value. 7452 // "SOLUTION_TYPE_RECOMMENDATION" - Used for Recommendations AI. 7453 // "SOLUTION_TYPE_SEARCH" - Used for Retail Search. 7454 SolutionTypes []string `json:"solutionTypes,omitempty"` 7455 // TwowaySynonymsControlIds: Condition synonyms specifications. If multiple 7456 // syonyms conditions match, all matching synonyms control in the list will 7457 // execute. Order of controls in the list will not matter. Maximum number of 7458 // specifications is 100. Can only be set if solution_types is 7459 // SOLUTION_TYPE_SEARCH. 7460 TwowaySynonymsControlIds []string `json:"twowaySynonymsControlIds,omitempty"` 7461 7462 // ServerResponse contains the HTTP response code and headers from the server. 7463 googleapi.ServerResponse `json:"-"` 7464 // ForceSendFields is a list of field names (e.g. "BoostControlIds") to 7465 // unconditionally include in API requests. By default, fields with empty or 7466 // default values are omitted from API requests. See 7467 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7468 // details. 7469 ForceSendFields []string `json:"-"` 7470 // NullFields is a list of field names (e.g. "BoostControlIds") to include in 7471 // API requests with the JSON null value. By default, fields with empty values 7472 // are omitted from API requests. See 7473 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7474 NullFields []string `json:"-"` 7475 } 7476 7477 func (s *GoogleCloudRetailV2alphaServingConfig) MarshalJSON() ([]byte, error) { 7478 type NoMethod GoogleCloudRetailV2alphaServingConfig 7479 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7480 } 7481 7482 // GoogleCloudRetailV2alphaSetDefaultBranchRequest: Request message to set a 7483 // specified branch as new default_branch. 7484 type GoogleCloudRetailV2alphaSetDefaultBranchRequest struct { 7485 // BranchId: The final component of the resource name of a branch. This field 7486 // must be one of "0", "1" or "2". Otherwise, an INVALID_ARGUMENT error is 7487 // returned. If there are no sufficient active products in the targeted branch 7488 // and force is not set, a FAILED_PRECONDITION error is returned. 7489 BranchId string `json:"branchId,omitempty"` 7490 // Force: If set to true, it permits switching to a branch with branch_id even 7491 // if it has no sufficient active products. 7492 Force bool `json:"force,omitempty"` 7493 // Note: Some note on this request, this can be retrieved by 7494 // CatalogService.GetDefaultBranch before next valid default branch set occurs. 7495 // This field must be a UTF-8 encoded string with a length limit of 1,000 7496 // characters. Otherwise, an INVALID_ARGUMENT error is returned. 7497 Note string `json:"note,omitempty"` 7498 // ForceSendFields is a list of field names (e.g. "BranchId") to 7499 // unconditionally include in API requests. By default, fields with empty or 7500 // default values are omitted from API requests. See 7501 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7502 // details. 7503 ForceSendFields []string `json:"-"` 7504 // NullFields is a list of field names (e.g. "BranchId") to include in API 7505 // requests with the JSON null value. By default, fields with empty values are 7506 // omitted from API requests. See 7507 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7508 NullFields []string `json:"-"` 7509 } 7510 7511 func (s *GoogleCloudRetailV2alphaSetDefaultBranchRequest) MarshalJSON() ([]byte, error) { 7512 type NoMethod GoogleCloudRetailV2alphaSetDefaultBranchRequest 7513 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7514 } 7515 7516 // GoogleCloudRetailV2alphaSetInventoryMetadata: Metadata related to the 7517 // progress of the SetInventory operation. Currently empty because there is no 7518 // meaningful metadata populated from the ProductService.SetInventory method. 7519 type GoogleCloudRetailV2alphaSetInventoryMetadata struct { 7520 } 7521 7522 // GoogleCloudRetailV2alphaSetInventoryRequest: Request message for 7523 // ProductService.SetInventory method. 7524 type GoogleCloudRetailV2alphaSetInventoryRequest struct { 7525 // AllowMissing: If set to true, and the Product with name Product.name is not 7526 // found, the inventory update will still be processed and retained for at most 7527 // 1 day until the Product is created. If set to false, a NOT_FOUND error is 7528 // returned if the Product is not found. 7529 AllowMissing bool `json:"allowMissing,omitempty"` 7530 // Inventory: Required. The inventory information to update. The allowable 7531 // fields to update are: * Product.price_info * Product.availability * 7532 // Product.available_quantity * Product.fulfillment_info The updated inventory 7533 // fields must be specified in SetInventoryRequest.set_mask. If 7534 // SetInventoryRequest.inventory.name is empty or invalid, an INVALID_ARGUMENT 7535 // error is returned. If the caller does not have permission to update the 7536 // Product named in Product.name, regardless of whether or not it exists, a 7537 // PERMISSION_DENIED error is returned. If the Product to update does not have 7538 // existing inventory information, the provided inventory information will be 7539 // inserted. If the Product to update has existing inventory information, the 7540 // provided inventory information will be merged while respecting the last 7541 // update time for each inventory field, using the provided or default value 7542 // for SetInventoryRequest.set_time. The caller can replace place IDs for a 7543 // subset of fulfillment types in the following ways: * Adds "fulfillment_info" 7544 // in SetInventoryRequest.set_mask * Specifies only the desired fulfillment 7545 // types and corresponding place IDs to update in 7546 // SetInventoryRequest.inventory.fulfillment_info The caller can clear all 7547 // place IDs from a subset of fulfillment types in the following ways: * Adds 7548 // "fulfillment_info" in SetInventoryRequest.set_mask * Specifies only the 7549 // desired fulfillment types to clear in 7550 // SetInventoryRequest.inventory.fulfillment_info * Checks that only the 7551 // desired fulfillment info types have empty 7552 // SetInventoryRequest.inventory.fulfillment_info.place_ids The last update 7553 // time is recorded for the following inventory fields: * Product.price_info * 7554 // Product.availability * Product.available_quantity * Product.fulfillment_info 7555 // If a full overwrite of inventory information while ignoring timestamps is 7556 // needed, ProductService.UpdateProduct should be invoked instead. 7557 Inventory *GoogleCloudRetailV2alphaProduct `json:"inventory,omitempty"` 7558 // SetMask: Indicates which inventory fields in the provided Product to update. 7559 // At least one field must be provided. If an unsupported or unknown field is 7560 // provided, an INVALID_ARGUMENT error is returned and the entire update will 7561 // be ignored. 7562 SetMask string `json:"setMask,omitempty"` 7563 // SetTime: The time when the request is issued, used to prevent out-of-order 7564 // updates on inventory fields with the last update time recorded. If not 7565 // provided, the internal system time will be used. 7566 SetTime string `json:"setTime,omitempty"` 7567 // ForceSendFields is a list of field names (e.g. "AllowMissing") to 7568 // unconditionally include in API requests. By default, fields with empty or 7569 // default values are omitted from API requests. See 7570 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7571 // details. 7572 ForceSendFields []string `json:"-"` 7573 // NullFields is a list of field names (e.g. "AllowMissing") to include in API 7574 // requests with the JSON null value. By default, fields with empty values are 7575 // omitted from API requests. See 7576 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7577 NullFields []string `json:"-"` 7578 } 7579 7580 func (s *GoogleCloudRetailV2alphaSetInventoryRequest) MarshalJSON() ([]byte, error) { 7581 type NoMethod GoogleCloudRetailV2alphaSetInventoryRequest 7582 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7583 } 7584 7585 // GoogleCloudRetailV2alphaSetInventoryResponse: Response of the 7586 // SetInventoryRequest. Currently empty because there is no meaningful response 7587 // populated from the ProductService.SetInventory method. 7588 type GoogleCloudRetailV2alphaSetInventoryResponse struct { 7589 } 7590 7591 // GoogleCloudRetailV2alphaTransformedUserEventsMetadata: Metadata related to 7592 // transform user events operation. 7593 type GoogleCloudRetailV2alphaTransformedUserEventsMetadata struct { 7594 // SourceEventsCount: Count of entries in the source user events BigQuery 7595 // table. 7596 SourceEventsCount int64 `json:"sourceEventsCount,omitempty,string"` 7597 // TransformedEventsCount: Count of entries in the transformed user events 7598 // BigQuery table, which could be different from the actually imported number 7599 // of user events. 7600 TransformedEventsCount int64 `json:"transformedEventsCount,omitempty,string"` 7601 // ForceSendFields is a list of field names (e.g. "SourceEventsCount") to 7602 // unconditionally include in API requests. By default, fields with empty or 7603 // default values are omitted from API requests. See 7604 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7605 // details. 7606 ForceSendFields []string `json:"-"` 7607 // NullFields is a list of field names (e.g. "SourceEventsCount") to include in 7608 // API requests with the JSON null value. By default, fields with empty values 7609 // are omitted from API requests. See 7610 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7611 NullFields []string `json:"-"` 7612 } 7613 7614 func (s *GoogleCloudRetailV2alphaTransformedUserEventsMetadata) MarshalJSON() ([]byte, error) { 7615 type NoMethod GoogleCloudRetailV2alphaTransformedUserEventsMetadata 7616 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7617 } 7618 7619 // GoogleCloudRetailV2alphaTuneModelMetadata: Metadata associated with a tune 7620 // operation. 7621 type GoogleCloudRetailV2alphaTuneModelMetadata struct { 7622 // Model: The resource name of the model that this tune applies to. Format: 7623 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/mode 7624 // ls/{model_id}` 7625 Model string `json:"model,omitempty"` 7626 // ForceSendFields is a list of field names (e.g. "Model") to unconditionally 7627 // include in API requests. By default, fields with empty or default values are 7628 // omitted from API requests. See 7629 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7630 // details. 7631 ForceSendFields []string `json:"-"` 7632 // NullFields is a list of field names (e.g. "Model") to include in API 7633 // requests with the JSON null value. By default, fields with empty values are 7634 // omitted from API requests. See 7635 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7636 NullFields []string `json:"-"` 7637 } 7638 7639 func (s *GoogleCloudRetailV2alphaTuneModelMetadata) MarshalJSON() ([]byte, error) { 7640 type NoMethod GoogleCloudRetailV2alphaTuneModelMetadata 7641 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7642 } 7643 7644 // GoogleCloudRetailV2alphaTuneModelRequest: Request to manually start a tuning 7645 // process now (instead of waiting for the periodically scheduled tuning to 7646 // happen). 7647 type GoogleCloudRetailV2alphaTuneModelRequest struct { 7648 } 7649 7650 // GoogleCloudRetailV2alphaTuneModelResponse: Response associated with a tune 7651 // operation. 7652 type GoogleCloudRetailV2alphaTuneModelResponse struct { 7653 } 7654 7655 // GoogleCloudRetailV2alphaUserEvent: UserEvent captures all metadata 7656 // information Retail API needs to know about how end users interact with 7657 // customers' website. 7658 type GoogleCloudRetailV2alphaUserEvent struct { 7659 // Attributes: Extra user event features to include in the recommendation 7660 // model. If you provide custom attributes for ingested user events, also 7661 // include them in the user events that you associate with prediction requests. 7662 // Custom attribute formatting must be consistent between imported events and 7663 // events provided with prediction requests. This lets the Retail API use those 7664 // custom attributes when training models and serving predictions, which helps 7665 // improve recommendation quality. This field needs to pass all below criteria, 7666 // otherwise an INVALID_ARGUMENT error is returned: * The key must be a UTF-8 7667 // encoded string with a length limit of 5,000 characters. * For text 7668 // attributes, at most 400 values are allowed. Empty values are not allowed. 7669 // Each value must be a UTF-8 encoded string with a length limit of 256 7670 // characters. * For number attributes, at most 400 values are allowed. For 7671 // product recommendations, an example of extra user information is 7672 // traffic_channel, which is how a user arrives at the site. Users can arrive 7673 // at the site by coming to the site directly, coming through Google search, or 7674 // in other ways. 7675 Attributes map[string]GoogleCloudRetailV2alphaCustomAttribute `json:"attributes,omitempty"` 7676 // AttributionToken: Highly recommended for user events that are the result of 7677 // PredictionService.Predict. This field enables accurate attribution of 7678 // recommendation model performance. The value must be a valid 7679 // PredictResponse.attribution_token for user events that are the result of 7680 // PredictionService.Predict. The value must be a valid 7681 // SearchResponse.attribution_token for user events that are the result of 7682 // SearchService.Search. This token enables us to accurately attribute page 7683 // view or purchase back to the event and the particular predict response 7684 // containing this clicked/purchased product. If user clicks on product K in 7685 // the recommendation results, pass PredictResponse.attribution_token as a URL 7686 // parameter to product K's page. When recording events on product K's page, 7687 // log the PredictResponse.attribution_token to this field. 7688 AttributionToken string `json:"attributionToken,omitempty"` 7689 // CartId: The ID or name of the associated shopping cart. This ID is used to 7690 // associate multiple items added or present in the cart before purchase. This 7691 // can only be set for `add-to-cart`, `purchase-complete`, or 7692 // `shopping-cart-page-view` events. 7693 CartId string `json:"cartId,omitempty"` 7694 // CompletionDetail: The main auto-completion details related to the event. 7695 // This field should be set for `search` event when autocomplete function is 7696 // enabled and the user clicks a suggestion for search. 7697 CompletionDetail *GoogleCloudRetailV2alphaCompletionDetail `json:"completionDetail,omitempty"` 7698 // Entity: The entity for customers that may run multiple different entities, 7699 // domains, sites or regions, for example, `Google US`, `Google Ads`, `Waymo`, 7700 // `google.com`, `youtube.com`, etc. We recommend that you set this field to 7701 // get better per-entity search, completion, and prediction results. 7702 Entity string `json:"entity,omitempty"` 7703 // EventTime: Only required for UserEventService.ImportUserEvents method. 7704 // Timestamp of when the user event happened. 7705 EventTime string `json:"eventTime,omitempty"` 7706 // EventType: Required. User event type. Allowed values are: * `add-to-cart`: 7707 // Products being added to cart. * `remove-from-cart`: Products being removed 7708 // from cart. * `category-page-view`: Special pages such as sale or promotion 7709 // pages viewed. * `detail-page-view`: Products detail page viewed. * 7710 // `home-page-view`: Homepage viewed. * `promotion-offered`: Promotion is 7711 // offered to a user. * `promotion-not-offered`: Promotion is not offered to a 7712 // user. * `purchase-complete`: User finishing a purchase. * `search`: Product 7713 // search. * `shopping-cart-page-view`: User viewing a shopping cart. 7714 EventType string `json:"eventType,omitempty"` 7715 // ExperimentIds: A list of identifiers for the independent experiment groups 7716 // this user event belongs to. This is used to distinguish between user events 7717 // associated with different experiment setups (e.g. using Retail API, using 7718 // different recommendation models). 7719 ExperimentIds []string `json:"experimentIds,omitempty"` 7720 // Filter: The filter syntax consists of an expression language for 7721 // constructing a predicate from one or more fields of the products being 7722 // filtered. See SearchRequest.filter for definition and syntax. The value must 7723 // be a UTF-8 encoded string with a length limit of 1,000 characters. 7724 // Otherwise, an INVALID_ARGUMENT error is returned. 7725 Filter string `json:"filter,omitempty"` 7726 // Offset: An integer that specifies the current offset for pagination (the 7727 // 0-indexed starting location, amongst the products deemed by the API as 7728 // relevant). See SearchRequest.offset for definition. If this field is 7729 // negative, an INVALID_ARGUMENT is returned. This can only be set for `search` 7730 // events. Other event types should not set this field. Otherwise, an 7731 // INVALID_ARGUMENT error is returned. 7732 Offset int64 `json:"offset,omitempty"` 7733 // OrderBy: The order in which products are returned. See 7734 // SearchRequest.order_by for definition and syntax. The value must be a UTF-8 7735 // encoded string with a length limit of 1,000 characters. Otherwise, an 7736 // INVALID_ARGUMENT error is returned. This can only be set for `search` 7737 // events. Other event types should not set this field. Otherwise, an 7738 // INVALID_ARGUMENT error is returned. 7739 OrderBy string `json:"orderBy,omitempty"` 7740 // PageCategories: The categories associated with a category page. To represent 7741 // full path of category, use '>' sign to separate different hierarchies. If 7742 // '>' is part of the category name, replace it with other character(s). 7743 // Category pages include special pages such as sales or promotions. For 7744 // instance, a special sale page may have the category hierarchy: 7745 // "pageCategories" : ["Sales > 2017 Black Friday Deals"]. Required for 7746 // `category-page-view` events. At least one of search_query or page_categories 7747 // is required for `search` events. Other event types should not set this 7748 // field. Otherwise, an INVALID_ARGUMENT error is returned. 7749 PageCategories []string `json:"pageCategories,omitempty"` 7750 // PageViewId: A unique ID of a web page view. This should be kept the same for 7751 // all user events triggered from the same pageview. For example, an item 7752 // detail page view could trigger multiple events as the user is browsing the 7753 // page. The `pageViewId` property should be kept the same for all these events 7754 // so that they can be grouped together properly. When using the client side 7755 // event reporting with JavaScript pixel and Google Tag Manager, this value is 7756 // filled in automatically. 7757 PageViewId string `json:"pageViewId,omitempty"` 7758 // ProductDetails: The main product details related to the event. This field is 7759 // optional except for the following event types: * `add-to-cart` * 7760 // `detail-page-view` * `purchase-complete` In a `search` event, this field 7761 // represents the products returned to the end user on the current page (the 7762 // end user may have not finished browsing the whole page yet). When a new page 7763 // is returned to the end user, after pagination/filtering/ordering even for 7764 // the same query, a new `search` event with different product_details is 7765 // desired. The end user may have not finished browsing the whole page yet. 7766 ProductDetails []*GoogleCloudRetailV2alphaProductDetail `json:"productDetails,omitempty"` 7767 // PurchaseTransaction: A transaction represents the entire purchase 7768 // transaction. Required for `purchase-complete` events. Other event types 7769 // should not set this field. Otherwise, an INVALID_ARGUMENT error is returned. 7770 PurchaseTransaction *GoogleCloudRetailV2alphaPurchaseTransaction `json:"purchaseTransaction,omitempty"` 7771 // ReferrerUri: The referrer URL of the current page. When using the client 7772 // side event reporting with JavaScript pixel and Google Tag Manager, this 7773 // value is filled in automatically. 7774 ReferrerUri string `json:"referrerUri,omitempty"` 7775 // SearchQuery: The user's search query. See SearchRequest.query for 7776 // definition. The value must be a UTF-8 encoded string with a length limit of 7777 // 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. At least 7778 // one of search_query or page_categories is required for `search` events. 7779 // Other event types should not set this field. Otherwise, an INVALID_ARGUMENT 7780 // error is returned. 7781 SearchQuery string `json:"searchQuery,omitempty"` 7782 // SessionId: A unique identifier for tracking a visitor session with a length 7783 // limit of 128 bytes. A session is an aggregation of an end user behavior in a 7784 // time span. A general guideline to populate the sesion_id: 1. If user has no 7785 // activity for 30 min, a new session_id should be assigned. 2. The session_id 7786 // should be unique across users, suggest use uuid or add visitor_id as prefix. 7787 SessionId string `json:"sessionId,omitempty"` 7788 // Uri: Complete URL (window.location.href) of the user's current page. When 7789 // using the client side event reporting with JavaScript pixel and Google Tag 7790 // Manager, this value is filled in automatically. Maximum length 5,000 7791 // characters. 7792 Uri string `json:"uri,omitempty"` 7793 // UserInfo: User information. 7794 UserInfo *GoogleCloudRetailV2alphaUserInfo `json:"userInfo,omitempty"` 7795 // VisitorId: Required. A unique identifier for tracking visitors. For example, 7796 // this could be implemented with an HTTP cookie, which should be able to 7797 // uniquely identify a visitor on a single device. This unique identifier 7798 // should not change if the visitor log in/out of the website. Don't set the 7799 // field to the same fixed ID for different users. This mixes the event history 7800 // of those users together, which results in degraded model quality. The field 7801 // must be a UTF-8 encoded string with a length limit of 128 characters. 7802 // Otherwise, an INVALID_ARGUMENT error is returned. The field should not 7803 // contain PII or user-data. We recommend to use Google Analytics Client ID 7804 // (https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId) 7805 // for this field. 7806 VisitorId string `json:"visitorId,omitempty"` 7807 7808 // ServerResponse contains the HTTP response code and headers from the server. 7809 googleapi.ServerResponse `json:"-"` 7810 // ForceSendFields is a list of field names (e.g. "Attributes") to 7811 // unconditionally include in API requests. By default, fields with empty or 7812 // default values are omitted from API requests. See 7813 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7814 // details. 7815 ForceSendFields []string `json:"-"` 7816 // NullFields is a list of field names (e.g. "Attributes") to include in API 7817 // requests with the JSON null value. By default, fields with empty values are 7818 // omitted from API requests. See 7819 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7820 NullFields []string `json:"-"` 7821 } 7822 7823 func (s *GoogleCloudRetailV2alphaUserEvent) MarshalJSON() ([]byte, error) { 7824 type NoMethod GoogleCloudRetailV2alphaUserEvent 7825 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7826 } 7827 7828 // GoogleCloudRetailV2alphaUserEventImportSummary: A summary of import result. 7829 // The UserEventImportSummary summarizes the import status for user events. 7830 type GoogleCloudRetailV2alphaUserEventImportSummary struct { 7831 // JoinedEventsCount: Count of user events imported with complete existing 7832 // catalog information. 7833 JoinedEventsCount int64 `json:"joinedEventsCount,omitempty,string"` 7834 // UnjoinedEventsCount: Count of user events imported, but with catalog 7835 // information not found in the imported catalog. 7836 UnjoinedEventsCount int64 `json:"unjoinedEventsCount,omitempty,string"` 7837 // ForceSendFields is a list of field names (e.g. "JoinedEventsCount") to 7838 // unconditionally include in API requests. By default, fields with empty or 7839 // default values are omitted from API requests. See 7840 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7841 // details. 7842 ForceSendFields []string `json:"-"` 7843 // NullFields is a list of field names (e.g. "JoinedEventsCount") to include in 7844 // API requests with the JSON null value. By default, fields with empty values 7845 // are omitted from API requests. See 7846 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7847 NullFields []string `json:"-"` 7848 } 7849 7850 func (s *GoogleCloudRetailV2alphaUserEventImportSummary) MarshalJSON() ([]byte, error) { 7851 type NoMethod GoogleCloudRetailV2alphaUserEventImportSummary 7852 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7853 } 7854 7855 // GoogleCloudRetailV2alphaUserEventInlineSource: The inline source for the 7856 // input config for ImportUserEvents method. 7857 type GoogleCloudRetailV2alphaUserEventInlineSource struct { 7858 // UserEvents: Required. A list of user events to import. Recommended max of 7859 // 10k items. 7860 UserEvents []*GoogleCloudRetailV2alphaUserEvent `json:"userEvents,omitempty"` 7861 // ForceSendFields is a list of field names (e.g. "UserEvents") to 7862 // unconditionally include in API requests. By default, fields with empty or 7863 // default values are omitted from API requests. See 7864 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7865 // details. 7866 ForceSendFields []string `json:"-"` 7867 // NullFields is a list of field names (e.g. "UserEvents") to include in API 7868 // requests with the JSON null value. By default, fields with empty values are 7869 // omitted from API requests. See 7870 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7871 NullFields []string `json:"-"` 7872 } 7873 7874 func (s *GoogleCloudRetailV2alphaUserEventInlineSource) MarshalJSON() ([]byte, error) { 7875 type NoMethod GoogleCloudRetailV2alphaUserEventInlineSource 7876 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7877 } 7878 7879 // GoogleCloudRetailV2alphaUserEventInputConfig: The input config source for 7880 // user events. 7881 type GoogleCloudRetailV2alphaUserEventInputConfig struct { 7882 // BigQuerySource: Required. BigQuery input source. 7883 BigQuerySource *GoogleCloudRetailV2alphaBigQuerySource `json:"bigQuerySource,omitempty"` 7884 // GcsSource: Required. Google Cloud Storage location for the input content. 7885 GcsSource *GoogleCloudRetailV2alphaGcsSource `json:"gcsSource,omitempty"` 7886 // UserEventInlineSource: Required. The Inline source for the input content for 7887 // UserEvents. 7888 UserEventInlineSource *GoogleCloudRetailV2alphaUserEventInlineSource `json:"userEventInlineSource,omitempty"` 7889 // ForceSendFields is a list of field names (e.g. "BigQuerySource") to 7890 // unconditionally include in API requests. By default, fields with empty or 7891 // default values are omitted from API requests. See 7892 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7893 // details. 7894 ForceSendFields []string `json:"-"` 7895 // NullFields is a list of field names (e.g. "BigQuerySource") to include in 7896 // API requests with the JSON null value. By default, fields with empty values 7897 // are omitted from API requests. See 7898 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7899 NullFields []string `json:"-"` 7900 } 7901 7902 func (s *GoogleCloudRetailV2alphaUserEventInputConfig) MarshalJSON() ([]byte, error) { 7903 type NoMethod GoogleCloudRetailV2alphaUserEventInputConfig 7904 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7905 } 7906 7907 // GoogleCloudRetailV2alphaUserInfo: Information of an end user. 7908 type GoogleCloudRetailV2alphaUserInfo struct { 7909 // DirectUserRequest: True if the request is made directly from the end user, 7910 // in which case the ip_address and user_agent can be populated from the HTTP 7911 // request. This flag should be set only if the API request is made directly 7912 // from the end user such as a mobile app (and not if a gateway or a server is 7913 // processing and pushing the user events). This should not be set when using 7914 // the JavaScript tag in UserEventService.CollectUserEvent. 7915 DirectUserRequest bool `json:"directUserRequest,omitempty"` 7916 // IpAddress: The end user's IP address. This field is used to extract location 7917 // information for personalization. This field must be either an IPv4 address 7918 // (e.g. "104.133.9.80") or an IPv6 address (e.g. 7919 // "2001:0db8:85a3:0000:0000:8a2e:0370:7334"). Otherwise, an INVALID_ARGUMENT 7920 // error is returned. This should not be set when: * setting 7921 // SearchRequest.user_info. * using the JavaScript tag in 7922 // UserEventService.CollectUserEvent or if direct_user_request is set. 7923 IpAddress string `json:"ipAddress,omitempty"` 7924 // UserAgent: User agent as included in the HTTP header. Required for getting 7925 // SearchResponse.sponsored_results. The field must be a UTF-8 encoded string 7926 // with a length limit of 1,000 characters. Otherwise, an INVALID_ARGUMENT 7927 // error is returned. This should not be set when using the client side event 7928 // reporting with GTM or JavaScript tag in UserEventService.CollectUserEvent or 7929 // if direct_user_request is set. 7930 UserAgent string `json:"userAgent,omitempty"` 7931 // UserId: Highly recommended for logged-in users. Unique identifier for 7932 // logged-in user, such as a user name. Don't set for anonymous users. Always 7933 // use a hashed value for this ID. Don't set the field to the same fixed ID for 7934 // different users. This mixes the event history of those users together, which 7935 // results in degraded model quality. The field must be a UTF-8 encoded string 7936 // with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error 7937 // is returned. 7938 UserId string `json:"userId,omitempty"` 7939 // ForceSendFields is a list of field names (e.g. "DirectUserRequest") to 7940 // unconditionally include in API requests. By default, fields with empty or 7941 // default values are omitted from API requests. See 7942 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7943 // details. 7944 ForceSendFields []string `json:"-"` 7945 // NullFields is a list of field names (e.g. "DirectUserRequest") to include in 7946 // API requests with the JSON null value. By default, fields with empty values 7947 // are omitted from API requests. See 7948 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 7949 NullFields []string `json:"-"` 7950 } 7951 7952 func (s *GoogleCloudRetailV2alphaUserInfo) MarshalJSON() ([]byte, error) { 7953 type NoMethod GoogleCloudRetailV2alphaUserInfo 7954 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 7955 } 7956 7957 // GoogleCloudRetailV2betaAddFulfillmentPlacesMetadata: Metadata related to the 7958 // progress of the AddFulfillmentPlaces operation. Currently empty because 7959 // there is no meaningful metadata populated from the 7960 // ProductService.AddFulfillmentPlaces method. 7961 type GoogleCloudRetailV2betaAddFulfillmentPlacesMetadata struct { 7962 } 7963 7964 // GoogleCloudRetailV2betaAddFulfillmentPlacesResponse: Response of the 7965 // AddFulfillmentPlacesRequest. Currently empty because there is no meaningful 7966 // response populated from the ProductService.AddFulfillmentPlaces method. 7967 type GoogleCloudRetailV2betaAddFulfillmentPlacesResponse struct { 7968 } 7969 7970 // GoogleCloudRetailV2betaAddLocalInventoriesMetadata: Metadata related to the 7971 // progress of the AddLocalInventories operation. Currently empty because there 7972 // is no meaningful metadata populated from the 7973 // ProductService.AddLocalInventories method. 7974 type GoogleCloudRetailV2betaAddLocalInventoriesMetadata struct { 7975 } 7976 7977 // GoogleCloudRetailV2betaAddLocalInventoriesResponse: Response of the 7978 // ProductService.AddLocalInventories API. Currently empty because there is no 7979 // meaningful response populated from the ProductService.AddLocalInventories 7980 // method. 7981 type GoogleCloudRetailV2betaAddLocalInventoriesResponse struct { 7982 } 7983 7984 // GoogleCloudRetailV2betaBigQueryOutputResult: A BigQuery output result. 7985 type GoogleCloudRetailV2betaBigQueryOutputResult struct { 7986 // DatasetId: The ID of a BigQuery Dataset. 7987 DatasetId string `json:"datasetId,omitempty"` 7988 // TableId: The ID of a BigQuery Table. 7989 TableId string `json:"tableId,omitempty"` 7990 // ForceSendFields is a list of field names (e.g. "DatasetId") to 7991 // unconditionally include in API requests. By default, fields with empty or 7992 // default values are omitted from API requests. See 7993 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 7994 // details. 7995 ForceSendFields []string `json:"-"` 7996 // NullFields is a list of field names (e.g. "DatasetId") to include in API 7997 // requests with the JSON null value. By default, fields with empty values are 7998 // omitted from API requests. See 7999 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8000 NullFields []string `json:"-"` 8001 } 8002 8003 func (s *GoogleCloudRetailV2betaBigQueryOutputResult) MarshalJSON() ([]byte, error) { 8004 type NoMethod GoogleCloudRetailV2betaBigQueryOutputResult 8005 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8006 } 8007 8008 // GoogleCloudRetailV2betaCreateMerchantCenterAccountLinkMetadata: Common 8009 // metadata related to the progress of the operations. 8010 type GoogleCloudRetailV2betaCreateMerchantCenterAccountLinkMetadata struct { 8011 // CreateTime: Operation create time. 8012 CreateTime string `json:"createTime,omitempty"` 8013 // UpdateTime: Operation last update time. If the operation is done, this is 8014 // also the finish time. 8015 UpdateTime string `json:"updateTime,omitempty"` 8016 // ForceSendFields is a list of field names (e.g. "CreateTime") to 8017 // unconditionally include in API requests. By default, fields with empty or 8018 // default values are omitted from API requests. See 8019 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8020 // details. 8021 ForceSendFields []string `json:"-"` 8022 // NullFields is a list of field names (e.g. "CreateTime") to include in API 8023 // requests with the JSON null value. By default, fields with empty values are 8024 // omitted from API requests. See 8025 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8026 NullFields []string `json:"-"` 8027 } 8028 8029 func (s *GoogleCloudRetailV2betaCreateMerchantCenterAccountLinkMetadata) MarshalJSON() ([]byte, error) { 8030 type NoMethod GoogleCloudRetailV2betaCreateMerchantCenterAccountLinkMetadata 8031 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8032 } 8033 8034 // GoogleCloudRetailV2betaCreateModelMetadata: Metadata associated with a 8035 // create operation. 8036 type GoogleCloudRetailV2betaCreateModelMetadata struct { 8037 // Model: The resource name of the model that this create applies to. Format: 8038 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/mode 8039 // ls/{model_id}` 8040 Model string `json:"model,omitempty"` 8041 // ForceSendFields is a list of field names (e.g. "Model") to unconditionally 8042 // include in API requests. By default, fields with empty or default values are 8043 // omitted from API requests. See 8044 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8045 // details. 8046 ForceSendFields []string `json:"-"` 8047 // NullFields is a list of field names (e.g. "Model") to include in API 8048 // requests with the JSON null value. By default, fields with empty values are 8049 // omitted from API requests. See 8050 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8051 NullFields []string `json:"-"` 8052 } 8053 8054 func (s *GoogleCloudRetailV2betaCreateModelMetadata) MarshalJSON() ([]byte, error) { 8055 type NoMethod GoogleCloudRetailV2betaCreateModelMetadata 8056 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8057 } 8058 8059 // GoogleCloudRetailV2betaExportAnalyticsMetricsResponse: Response of the 8060 // ExportAnalyticsMetricsRequest. If the long running operation was successful, 8061 // then this message is returned by the google.longrunning.Operations.response 8062 // field if the operation was successful. 8063 type GoogleCloudRetailV2betaExportAnalyticsMetricsResponse struct { 8064 // ErrorSamples: A sample of errors encountered while processing the request. 8065 ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` 8066 // ErrorsConfig: This field is never set. 8067 ErrorsConfig *GoogleCloudRetailV2betaExportErrorsConfig `json:"errorsConfig,omitempty"` 8068 // OutputResult: Output result indicating where the data were exported to. 8069 OutputResult *GoogleCloudRetailV2betaOutputResult `json:"outputResult,omitempty"` 8070 // ForceSendFields is a list of field names (e.g. "ErrorSamples") to 8071 // unconditionally include in API requests. By default, fields with empty or 8072 // default values are omitted from API requests. See 8073 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8074 // details. 8075 ForceSendFields []string `json:"-"` 8076 // NullFields is a list of field names (e.g. "ErrorSamples") to include in API 8077 // requests with the JSON null value. By default, fields with empty values are 8078 // omitted from API requests. See 8079 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8080 NullFields []string `json:"-"` 8081 } 8082 8083 func (s *GoogleCloudRetailV2betaExportAnalyticsMetricsResponse) MarshalJSON() ([]byte, error) { 8084 type NoMethod GoogleCloudRetailV2betaExportAnalyticsMetricsResponse 8085 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8086 } 8087 8088 // GoogleCloudRetailV2betaExportErrorsConfig: Configuration of destination for 8089 // Export related errors. 8090 type GoogleCloudRetailV2betaExportErrorsConfig struct { 8091 // GcsPrefix: Google Cloud Storage path for import errors. This must be an 8092 // empty, existing Cloud Storage bucket. Export errors will be written to a 8093 // file in this bucket, one per line, as a JSON-encoded `google.rpc.Status` 8094 // message. 8095 GcsPrefix string `json:"gcsPrefix,omitempty"` 8096 // ForceSendFields is a list of field names (e.g. "GcsPrefix") to 8097 // unconditionally include in API requests. By default, fields with empty or 8098 // default values are omitted from API requests. See 8099 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8100 // details. 8101 ForceSendFields []string `json:"-"` 8102 // NullFields is a list of field names (e.g. "GcsPrefix") to include in API 8103 // requests with the JSON null value. By default, fields with empty values are 8104 // omitted from API requests. See 8105 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8106 NullFields []string `json:"-"` 8107 } 8108 8109 func (s *GoogleCloudRetailV2betaExportErrorsConfig) MarshalJSON() ([]byte, error) { 8110 type NoMethod GoogleCloudRetailV2betaExportErrorsConfig 8111 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8112 } 8113 8114 // GoogleCloudRetailV2betaExportMetadata: Metadata related to the progress of 8115 // the Export operation. This is returned by the 8116 // google.longrunning.Operation.metadata field. 8117 type GoogleCloudRetailV2betaExportMetadata struct { 8118 // CreateTime: Operation create time. 8119 CreateTime string `json:"createTime,omitempty"` 8120 // UpdateTime: Operation last update time. If the operation is done, this is 8121 // also the finish time. 8122 UpdateTime string `json:"updateTime,omitempty"` 8123 // ForceSendFields is a list of field names (e.g. "CreateTime") to 8124 // unconditionally include in API requests. By default, fields with empty or 8125 // default values are omitted from API requests. See 8126 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8127 // details. 8128 ForceSendFields []string `json:"-"` 8129 // NullFields is a list of field names (e.g. "CreateTime") to include in API 8130 // requests with the JSON null value. By default, fields with empty values are 8131 // omitted from API requests. See 8132 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8133 NullFields []string `json:"-"` 8134 } 8135 8136 func (s *GoogleCloudRetailV2betaExportMetadata) MarshalJSON() ([]byte, error) { 8137 type NoMethod GoogleCloudRetailV2betaExportMetadata 8138 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8139 } 8140 8141 // GoogleCloudRetailV2betaExportProductsResponse: Response of the 8142 // ExportProductsRequest. If the long running operation is done, then this 8143 // message is returned by the google.longrunning.Operations.response field if 8144 // the operation was successful. 8145 type GoogleCloudRetailV2betaExportProductsResponse struct { 8146 // ErrorSamples: A sample of errors encountered while processing the request. 8147 ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` 8148 // ErrorsConfig: This field is never set. 8149 ErrorsConfig *GoogleCloudRetailV2betaExportErrorsConfig `json:"errorsConfig,omitempty"` 8150 // OutputResult: Output result indicating where the data were exported to. 8151 OutputResult *GoogleCloudRetailV2betaOutputResult `json:"outputResult,omitempty"` 8152 // ForceSendFields is a list of field names (e.g. "ErrorSamples") to 8153 // unconditionally include in API requests. By default, fields with empty or 8154 // default values are omitted from API requests. See 8155 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8156 // details. 8157 ForceSendFields []string `json:"-"` 8158 // NullFields is a list of field names (e.g. "ErrorSamples") to include in API 8159 // requests with the JSON null value. By default, fields with empty values are 8160 // omitted from API requests. See 8161 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8162 NullFields []string `json:"-"` 8163 } 8164 8165 func (s *GoogleCloudRetailV2betaExportProductsResponse) MarshalJSON() ([]byte, error) { 8166 type NoMethod GoogleCloudRetailV2betaExportProductsResponse 8167 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8168 } 8169 8170 // GoogleCloudRetailV2betaExportUserEventsResponse: Response of the 8171 // ExportUserEventsRequest. If the long running operation was successful, then 8172 // this message is returned by the google.longrunning.Operations.response field 8173 // if the operation was successful. 8174 type GoogleCloudRetailV2betaExportUserEventsResponse struct { 8175 // ErrorSamples: A sample of errors encountered while processing the request. 8176 ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` 8177 // ErrorsConfig: This field is never set. 8178 ErrorsConfig *GoogleCloudRetailV2betaExportErrorsConfig `json:"errorsConfig,omitempty"` 8179 // OutputResult: Output result indicating where the data were exported to. 8180 OutputResult *GoogleCloudRetailV2betaOutputResult `json:"outputResult,omitempty"` 8181 // ForceSendFields is a list of field names (e.g. "ErrorSamples") to 8182 // unconditionally include in API requests. By default, fields with empty or 8183 // default values are omitted from API requests. See 8184 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8185 // details. 8186 ForceSendFields []string `json:"-"` 8187 // NullFields is a list of field names (e.g. "ErrorSamples") to include in API 8188 // requests with the JSON null value. By default, fields with empty values are 8189 // omitted from API requests. See 8190 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8191 NullFields []string `json:"-"` 8192 } 8193 8194 func (s *GoogleCloudRetailV2betaExportUserEventsResponse) MarshalJSON() ([]byte, error) { 8195 type NoMethod GoogleCloudRetailV2betaExportUserEventsResponse 8196 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8197 } 8198 8199 // GoogleCloudRetailV2betaGcsOutputResult: A Gcs output result. 8200 type GoogleCloudRetailV2betaGcsOutputResult struct { 8201 // OutputUri: The uri of Gcs output 8202 OutputUri string `json:"outputUri,omitempty"` 8203 // ForceSendFields is a list of field names (e.g. "OutputUri") to 8204 // unconditionally include in API requests. By default, fields with empty or 8205 // default values are omitted from API requests. See 8206 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8207 // details. 8208 ForceSendFields []string `json:"-"` 8209 // NullFields is a list of field names (e.g. "OutputUri") to include in API 8210 // requests with the JSON null value. By default, fields with empty values are 8211 // omitted from API requests. See 8212 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8213 NullFields []string `json:"-"` 8214 } 8215 8216 func (s *GoogleCloudRetailV2betaGcsOutputResult) MarshalJSON() ([]byte, error) { 8217 type NoMethod GoogleCloudRetailV2betaGcsOutputResult 8218 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8219 } 8220 8221 // GoogleCloudRetailV2betaImportCompletionDataResponse: Response of the 8222 // ImportCompletionDataRequest. If the long running operation is done, this 8223 // message is returned by the google.longrunning.Operations.response field if 8224 // the operation is successful. 8225 type GoogleCloudRetailV2betaImportCompletionDataResponse struct { 8226 // ErrorSamples: A sample of errors encountered while processing the request. 8227 ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` 8228 // ForceSendFields is a list of field names (e.g. "ErrorSamples") to 8229 // unconditionally include in API requests. By default, fields with empty or 8230 // default values are omitted from API requests. See 8231 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8232 // details. 8233 ForceSendFields []string `json:"-"` 8234 // NullFields is a list of field names (e.g. "ErrorSamples") to include in API 8235 // requests with the JSON null value. By default, fields with empty values are 8236 // omitted from API requests. See 8237 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8238 NullFields []string `json:"-"` 8239 } 8240 8241 func (s *GoogleCloudRetailV2betaImportCompletionDataResponse) MarshalJSON() ([]byte, error) { 8242 type NoMethod GoogleCloudRetailV2betaImportCompletionDataResponse 8243 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8244 } 8245 8246 // GoogleCloudRetailV2betaImportErrorsConfig: Configuration of destination for 8247 // Import related errors. 8248 type GoogleCloudRetailV2betaImportErrorsConfig struct { 8249 // GcsPrefix: Google Cloud Storage prefix for import errors. This must be an 8250 // empty, existing Cloud Storage directory. Import errors are written to 8251 // sharded files in this directory, one per line, as a JSON-encoded 8252 // `google.rpc.Status` message. 8253 GcsPrefix string `json:"gcsPrefix,omitempty"` 8254 // ForceSendFields is a list of field names (e.g. "GcsPrefix") to 8255 // unconditionally include in API requests. By default, fields with empty or 8256 // default values are omitted from API requests. See 8257 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8258 // details. 8259 ForceSendFields []string `json:"-"` 8260 // NullFields is a list of field names (e.g. "GcsPrefix") to include in API 8261 // requests with the JSON null value. By default, fields with empty values are 8262 // omitted from API requests. See 8263 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8264 NullFields []string `json:"-"` 8265 } 8266 8267 func (s *GoogleCloudRetailV2betaImportErrorsConfig) MarshalJSON() ([]byte, error) { 8268 type NoMethod GoogleCloudRetailV2betaImportErrorsConfig 8269 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8270 } 8271 8272 // GoogleCloudRetailV2betaImportMetadata: Metadata related to the progress of 8273 // the Import operation. This is returned by the 8274 // google.longrunning.Operation.metadata field. 8275 type GoogleCloudRetailV2betaImportMetadata struct { 8276 // CreateTime: Operation create time. 8277 CreateTime string `json:"createTime,omitempty"` 8278 // FailureCount: Count of entries that encountered errors while processing. 8279 FailureCount int64 `json:"failureCount,omitempty,string"` 8280 // NotificationPubsubTopic: Pub/Sub topic for receiving notification. If this 8281 // field is set, when the import is finished, a notification is sent to 8282 // specified Pub/Sub topic. The message data is JSON string of a Operation. 8283 // Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. 8284 NotificationPubsubTopic string `json:"notificationPubsubTopic,omitempty"` 8285 // RequestId: Deprecated. This field is never set. 8286 RequestId string `json:"requestId,omitempty"` 8287 // SuccessCount: Count of entries that were processed successfully. 8288 SuccessCount int64 `json:"successCount,omitempty,string"` 8289 // UpdateTime: Operation last update time. If the operation is done, this is 8290 // also the finish time. 8291 UpdateTime string `json:"updateTime,omitempty"` 8292 // ForceSendFields is a list of field names (e.g. "CreateTime") to 8293 // unconditionally include in API requests. By default, fields with empty or 8294 // default values are omitted from API requests. See 8295 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8296 // details. 8297 ForceSendFields []string `json:"-"` 8298 // NullFields is a list of field names (e.g. "CreateTime") to include in API 8299 // requests with the JSON null value. By default, fields with empty values are 8300 // omitted from API requests. See 8301 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8302 NullFields []string `json:"-"` 8303 } 8304 8305 func (s *GoogleCloudRetailV2betaImportMetadata) MarshalJSON() ([]byte, error) { 8306 type NoMethod GoogleCloudRetailV2betaImportMetadata 8307 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8308 } 8309 8310 // GoogleCloudRetailV2betaImportProductsResponse: Response of the 8311 // ImportProductsRequest. If the long running operation is done, then this 8312 // message is returned by the google.longrunning.Operations.response field if 8313 // the operation was successful. 8314 type GoogleCloudRetailV2betaImportProductsResponse struct { 8315 // ErrorSamples: A sample of errors encountered while processing the request. 8316 ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` 8317 // ErrorsConfig: Echoes the destination for the complete errors in the request 8318 // if set. 8319 ErrorsConfig *GoogleCloudRetailV2betaImportErrorsConfig `json:"errorsConfig,omitempty"` 8320 // ForceSendFields is a list of field names (e.g. "ErrorSamples") to 8321 // unconditionally include in API requests. By default, fields with empty or 8322 // default values are omitted from API requests. See 8323 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8324 // details. 8325 ForceSendFields []string `json:"-"` 8326 // NullFields is a list of field names (e.g. "ErrorSamples") to include in API 8327 // requests with the JSON null value. By default, fields with empty values are 8328 // omitted from API requests. See 8329 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8330 NullFields []string `json:"-"` 8331 } 8332 8333 func (s *GoogleCloudRetailV2betaImportProductsResponse) MarshalJSON() ([]byte, error) { 8334 type NoMethod GoogleCloudRetailV2betaImportProductsResponse 8335 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8336 } 8337 8338 // GoogleCloudRetailV2betaImportUserEventsResponse: Response of the 8339 // ImportUserEventsRequest. If the long running operation was successful, then 8340 // this message is returned by the google.longrunning.Operations.response field 8341 // if the operation was successful. 8342 type GoogleCloudRetailV2betaImportUserEventsResponse struct { 8343 // ErrorSamples: A sample of errors encountered while processing the request. 8344 ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` 8345 // ErrorsConfig: Echoes the destination for the complete errors if this field 8346 // was set in the request. 8347 ErrorsConfig *GoogleCloudRetailV2betaImportErrorsConfig `json:"errorsConfig,omitempty"` 8348 // ImportSummary: Aggregated statistics of user event import status. 8349 ImportSummary *GoogleCloudRetailV2betaUserEventImportSummary `json:"importSummary,omitempty"` 8350 // ForceSendFields is a list of field names (e.g. "ErrorSamples") to 8351 // unconditionally include in API requests. By default, fields with empty or 8352 // default values are omitted from API requests. See 8353 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8354 // details. 8355 ForceSendFields []string `json:"-"` 8356 // NullFields is a list of field names (e.g. "ErrorSamples") to include in API 8357 // requests with the JSON null value. By default, fields with empty values are 8358 // omitted from API requests. See 8359 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8360 NullFields []string `json:"-"` 8361 } 8362 8363 func (s *GoogleCloudRetailV2betaImportUserEventsResponse) MarshalJSON() ([]byte, error) { 8364 type NoMethod GoogleCloudRetailV2betaImportUserEventsResponse 8365 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8366 } 8367 8368 // GoogleCloudRetailV2betaMerchantCenterAccountLink: Represents a link between 8369 // a Merchant Center account and a branch. After a link is established, 8370 // products from the linked Merchant Center account are streamed to the linked 8371 // branch. 8372 type GoogleCloudRetailV2betaMerchantCenterAccountLink struct { 8373 // BranchId: Required. The branch ID (e.g. 0/1/2) within the catalog that 8374 // products from merchant_center_account_id are streamed to. When updating this 8375 // field, an empty value will use the currently configured default branch. 8376 // However, changing the default branch later on won't change the linked branch 8377 // here. A single branch ID can only have one linked Merchant Center account 8378 // ID. 8379 BranchId string `json:"branchId,omitempty"` 8380 // FeedFilters: Criteria for the Merchant Center feeds to be ingested via the 8381 // link. All offers will be ingested if the list is empty. Otherwise the offers 8382 // will be ingested from selected feeds. 8383 FeedFilters []*GoogleCloudRetailV2betaMerchantCenterAccountLinkMerchantCenterFeedFilter `json:"feedFilters,omitempty"` 8384 // FeedLabel: The FeedLabel used to perform filtering. Note: this replaces 8385 // region_id 8386 // (https://developers.google.com/shopping-content/reference/rest/v2.1/products#Product.FIELDS.feed_label). 8387 // Example value: `US`. Example value: `FeedLabel1`. 8388 FeedLabel string `json:"feedLabel,omitempty"` 8389 // Id: Output only. Immutable. MerchantCenterAccountLink identifier, which is 8390 // the final component of name. This field is auto generated and follows the 8391 // convention: `BranchId_MerchantCenterAccountId`. 8392 // `projects/*/locations/global/catalogs/default_catalog/merchantCenterAccountLi 8393 // nks/id_1`. 8394 Id string `json:"id,omitempty"` 8395 // LanguageCode: Language of the title/description and other string attributes. 8396 // Use language tags defined by BCP 47 8397 // (https://www.rfc-editor.org/rfc/bcp/bcp47.txt). ISO 639-1. This specifies 8398 // the language of offers in Merchant Center that will be accepted. If empty, 8399 // no language filtering will be performed. Example value: `en`. 8400 LanguageCode string `json:"languageCode,omitempty"` 8401 // MerchantCenterAccountId: Required. The linked Merchant center account id 8402 // (https://developers.google.com/shopping-content/guides/accountstatuses). The 8403 // account must be a standalone account or a sub-account of a MCA. 8404 MerchantCenterAccountId int64 `json:"merchantCenterAccountId,omitempty,string"` 8405 // Name: Output only. Immutable. Full resource name of the Merchant Center 8406 // Account Link, such as 8407 // `projects/*/locations/global/catalogs/default_catalog/merchantCenterAccountLi 8408 // nks/merchant_center_account_link`. 8409 Name string `json:"name,omitempty"` 8410 // ProjectId: Output only. Google Cloud project ID. 8411 ProjectId string `json:"projectId,omitempty"` 8412 // Source: Optional. An optional arbitrary string that could be used as a tag 8413 // for tracking link source. 8414 Source string `json:"source,omitempty"` 8415 // State: Output only. Represents the state of the link. 8416 // 8417 // Possible values: 8418 // "STATE_UNSPECIFIED" - Default value. 8419 // "PENDING" - Link is created and LRO is not complete. 8420 // "ACTIVE" - Link is active. 8421 // "FAILED" - Link creation failed. 8422 State string `json:"state,omitempty"` 8423 // ForceSendFields is a list of field names (e.g. "BranchId") to 8424 // unconditionally include in API requests. By default, fields with empty or 8425 // default values are omitted from API requests. See 8426 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8427 // details. 8428 ForceSendFields []string `json:"-"` 8429 // NullFields is a list of field names (e.g. "BranchId") to include in API 8430 // requests with the JSON null value. By default, fields with empty values are 8431 // omitted from API requests. See 8432 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8433 NullFields []string `json:"-"` 8434 } 8435 8436 func (s *GoogleCloudRetailV2betaMerchantCenterAccountLink) MarshalJSON() ([]byte, error) { 8437 type NoMethod GoogleCloudRetailV2betaMerchantCenterAccountLink 8438 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8439 } 8440 8441 // GoogleCloudRetailV2betaMerchantCenterAccountLinkMerchantCenterFeedFilter: 8442 // Merchant Center Feed filter criterion. 8443 type GoogleCloudRetailV2betaMerchantCenterAccountLinkMerchantCenterFeedFilter struct { 8444 // PrimaryFeedId: Merchant Center primary feed ID. 8445 PrimaryFeedId int64 `json:"primaryFeedId,omitempty,string"` 8446 // PrimaryFeedName: Merchant Center primary feed name. The name is used for the 8447 // display purposes only. 8448 PrimaryFeedName string `json:"primaryFeedName,omitempty"` 8449 // ForceSendFields is a list of field names (e.g. "PrimaryFeedId") to 8450 // unconditionally include in API requests. By default, fields with empty or 8451 // default values are omitted from API requests. See 8452 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8453 // details. 8454 ForceSendFields []string `json:"-"` 8455 // NullFields is a list of field names (e.g. "PrimaryFeedId") to include in API 8456 // requests with the JSON null value. By default, fields with empty values are 8457 // omitted from API requests. See 8458 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8459 NullFields []string `json:"-"` 8460 } 8461 8462 func (s *GoogleCloudRetailV2betaMerchantCenterAccountLinkMerchantCenterFeedFilter) MarshalJSON() ([]byte, error) { 8463 type NoMethod GoogleCloudRetailV2betaMerchantCenterAccountLinkMerchantCenterFeedFilter 8464 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8465 } 8466 8467 // GoogleCloudRetailV2betaModel: Metadata that describes the training and 8468 // serving parameters of a Model. A Model can be associated with a 8469 // ServingConfig and then queried through the Predict API. 8470 type GoogleCloudRetailV2betaModel struct { 8471 // CreateTime: Output only. Timestamp the Recommendation Model was created at. 8472 CreateTime string `json:"createTime,omitempty"` 8473 // DataState: Output only. The state of data requirements for this model: 8474 // `DATA_OK` and `DATA_ERROR`. Recommendation model cannot be trained if the 8475 // data is in `DATA_ERROR` state. Recommendation model can have `DATA_ERROR` 8476 // state even if serving state is `ACTIVE`: models were trained successfully 8477 // before, but cannot be refreshed because model no longer has sufficient data 8478 // for training. 8479 // 8480 // Possible values: 8481 // "DATA_STATE_UNSPECIFIED" - Unspecified default value, should never be 8482 // explicitly set. 8483 // "DATA_OK" - The model has sufficient training data. 8484 // "DATA_ERROR" - The model does not have sufficient training data. Error 8485 // messages can be queried via Stackdriver. 8486 DataState string `json:"dataState,omitempty"` 8487 // DisplayName: Required. The display name of the model. Should be human 8488 // readable, used to display Recommendation Models in the Retail Cloud Console 8489 // Dashboard. UTF-8 encoded string with limit of 1024 characters. 8490 DisplayName string `json:"displayName,omitempty"` 8491 // FilteringOption: Optional. If `RECOMMENDATIONS_FILTERING_ENABLED`, 8492 // recommendation filtering by attributes is enabled for the model. 8493 // 8494 // Possible values: 8495 // "RECOMMENDATIONS_FILTERING_OPTION_UNSPECIFIED" - Value used when unset. In 8496 // this case, server behavior defaults to RECOMMENDATIONS_FILTERING_DISABLED. 8497 // "RECOMMENDATIONS_FILTERING_DISABLED" - Recommendation filtering is 8498 // disabled. 8499 // "RECOMMENDATIONS_FILTERING_ENABLED" - Recommendation filtering is enabled. 8500 FilteringOption string `json:"filteringOption,omitempty"` 8501 // LastTuneTime: Output only. The timestamp when the latest successful tune 8502 // finished. 8503 LastTuneTime string `json:"lastTuneTime,omitempty"` 8504 // ModelFeaturesConfig: Optional. Additional model features config. 8505 ModelFeaturesConfig *GoogleCloudRetailV2betaModelModelFeaturesConfig `json:"modelFeaturesConfig,omitempty"` 8506 // Name: Required. The fully qualified resource name of the model. Format: 8507 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/mode 8508 // ls/{model_id}` catalog_id has char limit of 50. recommendation_model_id has 8509 // char limit of 40. 8510 Name string `json:"name,omitempty"` 8511 // OptimizationObjective: Optional. The optimization objective e.g. `cvr`. 8512 // Currently supported values: `ctr`, `cvr`, `revenue-per-order`. If not 8513 // specified, we choose default based on model type. Default depends on type of 8514 // recommendation: `recommended-for-you` => `ctr` `others-you-may-like` => 8515 // `ctr` `frequently-bought-together` => `revenue_per_order` This field 8516 // together with optimization_objective describe model metadata to use to 8517 // control model training and serving. See 8518 // https://cloud.google.com/retail/docs/models for more details on what the 8519 // model metadata control and which combination of parameters are valid. For 8520 // invalid combinations of parameters (e.g. type = `frequently-bought-together` 8521 // and optimization_objective = `ctr`), you receive an error 400 if you try to 8522 // create/update a recommendation with this set of knobs. 8523 OptimizationObjective string `json:"optimizationObjective,omitempty"` 8524 // PeriodicTuningState: Optional. The state of periodic tuning. The period we 8525 // use is 3 months - to do a one-off tune earlier use the `TuneModel` method. 8526 // Default value is `PERIODIC_TUNING_ENABLED`. 8527 // 8528 // Possible values: 8529 // "PERIODIC_TUNING_STATE_UNSPECIFIED" - Unspecified default value, should 8530 // never be explicitly set. 8531 // "PERIODIC_TUNING_DISABLED" - The model has periodic tuning disabled. 8532 // Tuning can be reenabled by calling the `EnableModelPeriodicTuning` method or 8533 // by calling the `TuneModel` method. 8534 // "ALL_TUNING_DISABLED" - The model cannot be tuned with periodic tuning OR 8535 // the `TuneModel` method. Hide the options in customer UI and reject any 8536 // requests through the backend self serve API. 8537 // "PERIODIC_TUNING_ENABLED" - The model has periodic tuning enabled. Tuning 8538 // can be disabled by calling the `DisableModelPeriodicTuning` method. 8539 PeriodicTuningState string `json:"periodicTuningState,omitempty"` 8540 // ServingConfigLists: Output only. The list of valid serving configs 8541 // associated with the PageOptimizationConfig. 8542 ServingConfigLists []*GoogleCloudRetailV2betaModelServingConfigList `json:"servingConfigLists,omitempty"` 8543 // ServingState: Output only. The serving state of the model: `ACTIVE`, 8544 // `NOT_ACTIVE`. 8545 // 8546 // Possible values: 8547 // "SERVING_STATE_UNSPECIFIED" - Unspecified serving state. 8548 // "INACTIVE" - The model is not serving. 8549 // "ACTIVE" - The model is serving and can be queried. 8550 // "TUNED" - The model is trained on tuned hyperparameters and can be 8551 // queried. 8552 ServingState string `json:"servingState,omitempty"` 8553 // TrainingState: Optional. The training state that the model is in (e.g. 8554 // `TRAINING` or `PAUSED`). Since part of the cost of running the service is 8555 // frequency of training - this can be used to determine when to train model in 8556 // order to control cost. If not specified: the default value for `CreateModel` 8557 // method is `TRAINING`. The default value for `UpdateModel` method is to keep 8558 // the state the same as before. 8559 // 8560 // Possible values: 8561 // "TRAINING_STATE_UNSPECIFIED" - Unspecified training state. 8562 // "PAUSED" - The model training is paused. 8563 // "TRAINING" - The model is training. 8564 TrainingState string `json:"trainingState,omitempty"` 8565 // TuningOperation: Output only. The tune operation associated with the model. 8566 // Can be used to determine if there is an ongoing tune for this 8567 // recommendation. Empty field implies no tune is goig on. 8568 TuningOperation string `json:"tuningOperation,omitempty"` 8569 // Type: Required. The type of model e.g. `home-page`. Currently supported 8570 // values: `recommended-for-you`, `others-you-may-like`, 8571 // `frequently-bought-together`, `page-optimization`, `similar-items`, 8572 // `buy-it-again`, `on-sale-items`, and `recently-viewed`(readonly value). This 8573 // field together with optimization_objective describe model metadata to use to 8574 // control model training and serving. See 8575 // https://cloud.google.com/retail/docs/models for more details on what the 8576 // model metadata control and which combination of parameters are valid. For 8577 // invalid combinations of parameters (e.g. type = `frequently-bought-together` 8578 // and optimization_objective = `ctr`), you receive an error 400 if you try to 8579 // create/update a recommendation with this set of knobs. 8580 Type string `json:"type,omitempty"` 8581 // UpdateTime: Output only. Timestamp the Recommendation Model was last 8582 // updated. E.g. if a Recommendation Model was paused - this would be the time 8583 // the pause was initiated. 8584 UpdateTime string `json:"updateTime,omitempty"` 8585 // ForceSendFields is a list of field names (e.g. "CreateTime") to 8586 // unconditionally include in API requests. By default, fields with empty or 8587 // default values are omitted from API requests. See 8588 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8589 // details. 8590 ForceSendFields []string `json:"-"` 8591 // NullFields is a list of field names (e.g. "CreateTime") to include in API 8592 // requests with the JSON null value. By default, fields with empty values are 8593 // omitted from API requests. See 8594 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8595 NullFields []string `json:"-"` 8596 } 8597 8598 func (s *GoogleCloudRetailV2betaModel) MarshalJSON() ([]byte, error) { 8599 type NoMethod GoogleCloudRetailV2betaModel 8600 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8601 } 8602 8603 // GoogleCloudRetailV2betaModelFrequentlyBoughtTogetherFeaturesConfig: 8604 // Additional configs for the frequently-bought-together model type. 8605 type GoogleCloudRetailV2betaModelFrequentlyBoughtTogetherFeaturesConfig struct { 8606 // ContextProductsType: Optional. Specifies the context of the model when it is 8607 // used in predict requests. Can only be set for the 8608 // `frequently-bought-together` type. If it isn't specified, it defaults to 8609 // MULTIPLE_CONTEXT_PRODUCTS. 8610 // 8611 // Possible values: 8612 // "CONTEXT_PRODUCTS_TYPE_UNSPECIFIED" - Unspecified default value, should 8613 // never be explicitly set. Defaults to MULTIPLE_CONTEXT_PRODUCTS. 8614 // "SINGLE_CONTEXT_PRODUCT" - Use only a single product as context for the 8615 // recommendation. Typically used on pages like add-to-cart or product details. 8616 // "MULTIPLE_CONTEXT_PRODUCTS" - Use one or multiple products as context for 8617 // the recommendation. Typically used on shopping cart pages. 8618 ContextProductsType string `json:"contextProductsType,omitempty"` 8619 // ForceSendFields is a list of field names (e.g. "ContextProductsType") to 8620 // unconditionally include in API requests. By default, fields with empty or 8621 // default values are omitted from API requests. See 8622 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8623 // details. 8624 ForceSendFields []string `json:"-"` 8625 // NullFields is a list of field names (e.g. "ContextProductsType") to include 8626 // in API requests with the JSON null value. By default, fields with empty 8627 // values are omitted from API requests. See 8628 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8629 NullFields []string `json:"-"` 8630 } 8631 8632 func (s *GoogleCloudRetailV2betaModelFrequentlyBoughtTogetherFeaturesConfig) MarshalJSON() ([]byte, error) { 8633 type NoMethod GoogleCloudRetailV2betaModelFrequentlyBoughtTogetherFeaturesConfig 8634 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8635 } 8636 8637 // GoogleCloudRetailV2betaModelModelFeaturesConfig: Additional model features 8638 // config. 8639 type GoogleCloudRetailV2betaModelModelFeaturesConfig struct { 8640 // FrequentlyBoughtTogetherConfig: Additional configs for 8641 // frequently-bought-together models. 8642 FrequentlyBoughtTogetherConfig *GoogleCloudRetailV2betaModelFrequentlyBoughtTogetherFeaturesConfig `json:"frequentlyBoughtTogetherConfig,omitempty"` 8643 // ForceSendFields is a list of field names (e.g. 8644 // "FrequentlyBoughtTogetherConfig") to unconditionally include in API 8645 // requests. By default, fields with empty or default values are omitted from 8646 // API requests. See 8647 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8648 // details. 8649 ForceSendFields []string `json:"-"` 8650 // NullFields is a list of field names (e.g. "FrequentlyBoughtTogetherConfig") 8651 // to include in API requests with the JSON null value. By default, fields with 8652 // empty values are omitted from API requests. See 8653 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8654 NullFields []string `json:"-"` 8655 } 8656 8657 func (s *GoogleCloudRetailV2betaModelModelFeaturesConfig) MarshalJSON() ([]byte, error) { 8658 type NoMethod GoogleCloudRetailV2betaModelModelFeaturesConfig 8659 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8660 } 8661 8662 // GoogleCloudRetailV2betaModelServingConfigList: Represents an ordered 8663 // combination of valid serving configs, which can be used for 8664 // `PAGE_OPTIMIZATION` recommendations. 8665 type GoogleCloudRetailV2betaModelServingConfigList struct { 8666 // ServingConfigIds: Optional. A set of valid serving configs that may be used 8667 // for `PAGE_OPTIMIZATION`. 8668 ServingConfigIds []string `json:"servingConfigIds,omitempty"` 8669 // ForceSendFields is a list of field names (e.g. "ServingConfigIds") to 8670 // unconditionally include in API requests. By default, fields with empty or 8671 // default values are omitted from API requests. See 8672 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8673 // details. 8674 ForceSendFields []string `json:"-"` 8675 // NullFields is a list of field names (e.g. "ServingConfigIds") to include in 8676 // API requests with the JSON null value. By default, fields with empty values 8677 // are omitted from API requests. See 8678 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8679 NullFields []string `json:"-"` 8680 } 8681 8682 func (s *GoogleCloudRetailV2betaModelServingConfigList) MarshalJSON() ([]byte, error) { 8683 type NoMethod GoogleCloudRetailV2betaModelServingConfigList 8684 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8685 } 8686 8687 // GoogleCloudRetailV2betaOutputResult: Output result that stores the 8688 // information about where the exported data is stored. 8689 type GoogleCloudRetailV2betaOutputResult struct { 8690 // BigqueryResult: The BigQuery location where the result is stored. 8691 BigqueryResult []*GoogleCloudRetailV2betaBigQueryOutputResult `json:"bigqueryResult,omitempty"` 8692 // GcsResult: The Google Cloud Storage location where the result is stored. 8693 GcsResult []*GoogleCloudRetailV2betaGcsOutputResult `json:"gcsResult,omitempty"` 8694 // ForceSendFields is a list of field names (e.g. "BigqueryResult") to 8695 // unconditionally include in API requests. By default, fields with empty or 8696 // default values are omitted from API requests. See 8697 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8698 // details. 8699 ForceSendFields []string `json:"-"` 8700 // NullFields is a list of field names (e.g. "BigqueryResult") to include in 8701 // API requests with the JSON null value. By default, fields with empty values 8702 // are omitted from API requests. See 8703 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8704 NullFields []string `json:"-"` 8705 } 8706 8707 func (s *GoogleCloudRetailV2betaOutputResult) MarshalJSON() ([]byte, error) { 8708 type NoMethod GoogleCloudRetailV2betaOutputResult 8709 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8710 } 8711 8712 // GoogleCloudRetailV2betaPurgeMetadata: Metadata related to the progress of 8713 // the Purge operation. This will be returned by the 8714 // google.longrunning.Operation.metadata field. 8715 type GoogleCloudRetailV2betaPurgeMetadata struct { 8716 } 8717 8718 // GoogleCloudRetailV2betaPurgeProductsMetadata: Metadata related to the 8719 // progress of the PurgeProducts operation. This will be returned by the 8720 // google.longrunning.Operation.metadata field. 8721 type GoogleCloudRetailV2betaPurgeProductsMetadata struct { 8722 // CreateTime: Operation create time. 8723 CreateTime string `json:"createTime,omitempty"` 8724 // FailureCount: Count of entries that encountered errors while processing. 8725 FailureCount int64 `json:"failureCount,omitempty,string"` 8726 // SuccessCount: Count of entries that were deleted successfully. 8727 SuccessCount int64 `json:"successCount,omitempty,string"` 8728 // UpdateTime: Operation last update time. If the operation is done, this is 8729 // also the finish time. 8730 UpdateTime string `json:"updateTime,omitempty"` 8731 // ForceSendFields is a list of field names (e.g. "CreateTime") to 8732 // unconditionally include in API requests. By default, fields with empty or 8733 // default values are omitted from API requests. See 8734 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8735 // details. 8736 ForceSendFields []string `json:"-"` 8737 // NullFields is a list of field names (e.g. "CreateTime") to include in API 8738 // requests with the JSON null value. By default, fields with empty values are 8739 // omitted from API requests. See 8740 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8741 NullFields []string `json:"-"` 8742 } 8743 8744 func (s *GoogleCloudRetailV2betaPurgeProductsMetadata) MarshalJSON() ([]byte, error) { 8745 type NoMethod GoogleCloudRetailV2betaPurgeProductsMetadata 8746 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8747 } 8748 8749 // GoogleCloudRetailV2betaPurgeProductsResponse: Response of the 8750 // PurgeProductsRequest. If the long running operation is successfully done, 8751 // then this message is returned by the google.longrunning.Operations.response 8752 // field. 8753 type GoogleCloudRetailV2betaPurgeProductsResponse struct { 8754 // PurgeCount: The total count of products purged as a result of the operation. 8755 PurgeCount int64 `json:"purgeCount,omitempty,string"` 8756 // PurgeSample: A sample of the product names that will be deleted. Only 8757 // populated if `force` is set to false. A max of 100 names will be returned 8758 // and the names are chosen at random. 8759 PurgeSample []string `json:"purgeSample,omitempty"` 8760 // ForceSendFields is a list of field names (e.g. "PurgeCount") to 8761 // unconditionally include in API requests. By default, fields with empty or 8762 // default values are omitted from API requests. See 8763 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8764 // details. 8765 ForceSendFields []string `json:"-"` 8766 // NullFields is a list of field names (e.g. "PurgeCount") to include in API 8767 // requests with the JSON null value. By default, fields with empty values are 8768 // omitted from API requests. See 8769 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8770 NullFields []string `json:"-"` 8771 } 8772 8773 func (s *GoogleCloudRetailV2betaPurgeProductsResponse) MarshalJSON() ([]byte, error) { 8774 type NoMethod GoogleCloudRetailV2betaPurgeProductsResponse 8775 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8776 } 8777 8778 // GoogleCloudRetailV2betaPurgeUserEventsResponse: Response of the 8779 // PurgeUserEventsRequest. If the long running operation is successfully done, 8780 // then this message is returned by the google.longrunning.Operations.response 8781 // field. 8782 type GoogleCloudRetailV2betaPurgeUserEventsResponse struct { 8783 // PurgedEventsCount: The total count of events purged as a result of the 8784 // operation. 8785 PurgedEventsCount int64 `json:"purgedEventsCount,omitempty,string"` 8786 // ForceSendFields is a list of field names (e.g. "PurgedEventsCount") to 8787 // unconditionally include in API requests. By default, fields with empty or 8788 // default values are omitted from API requests. See 8789 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8790 // details. 8791 ForceSendFields []string `json:"-"` 8792 // NullFields is a list of field names (e.g. "PurgedEventsCount") to include in 8793 // API requests with the JSON null value. By default, fields with empty values 8794 // are omitted from API requests. See 8795 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8796 NullFields []string `json:"-"` 8797 } 8798 8799 func (s *GoogleCloudRetailV2betaPurgeUserEventsResponse) MarshalJSON() ([]byte, error) { 8800 type NoMethod GoogleCloudRetailV2betaPurgeUserEventsResponse 8801 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8802 } 8803 8804 // GoogleCloudRetailV2betaRejoinUserEventsMetadata: Metadata for 8805 // `RejoinUserEvents` method. 8806 type GoogleCloudRetailV2betaRejoinUserEventsMetadata struct { 8807 } 8808 8809 // GoogleCloudRetailV2betaRejoinUserEventsResponse: Response message for 8810 // `RejoinUserEvents` method. 8811 type GoogleCloudRetailV2betaRejoinUserEventsResponse struct { 8812 // RejoinedUserEventsCount: Number of user events that were joined with latest 8813 // product catalog. 8814 RejoinedUserEventsCount int64 `json:"rejoinedUserEventsCount,omitempty,string"` 8815 // ForceSendFields is a list of field names (e.g. "RejoinedUserEventsCount") to 8816 // unconditionally include in API requests. By default, fields with empty or 8817 // default values are omitted from API requests. See 8818 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8819 // details. 8820 ForceSendFields []string `json:"-"` 8821 // NullFields is a list of field names (e.g. "RejoinedUserEventsCount") to 8822 // include in API requests with the JSON null value. By default, fields with 8823 // empty values are omitted from API requests. See 8824 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8825 NullFields []string `json:"-"` 8826 } 8827 8828 func (s *GoogleCloudRetailV2betaRejoinUserEventsResponse) MarshalJSON() ([]byte, error) { 8829 type NoMethod GoogleCloudRetailV2betaRejoinUserEventsResponse 8830 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8831 } 8832 8833 // GoogleCloudRetailV2betaRemoveFulfillmentPlacesMetadata: Metadata related to 8834 // the progress of the RemoveFulfillmentPlaces operation. Currently empty 8835 // because there is no meaningful metadata populated from the 8836 // ProductService.RemoveFulfillmentPlaces method. 8837 type GoogleCloudRetailV2betaRemoveFulfillmentPlacesMetadata struct { 8838 } 8839 8840 // GoogleCloudRetailV2betaRemoveFulfillmentPlacesResponse: Response of the 8841 // RemoveFulfillmentPlacesRequest. Currently empty because there is no 8842 // meaningful response populated from the 8843 // ProductService.RemoveFulfillmentPlaces method. 8844 type GoogleCloudRetailV2betaRemoveFulfillmentPlacesResponse struct { 8845 } 8846 8847 // GoogleCloudRetailV2betaRemoveLocalInventoriesMetadata: Metadata related to 8848 // the progress of the RemoveLocalInventories operation. Currently empty 8849 // because there is no meaningful metadata populated from the 8850 // ProductService.RemoveLocalInventories method. 8851 type GoogleCloudRetailV2betaRemoveLocalInventoriesMetadata struct { 8852 } 8853 8854 // GoogleCloudRetailV2betaRemoveLocalInventoriesResponse: Response of the 8855 // ProductService.RemoveLocalInventories API. Currently empty because there is 8856 // no meaningful response populated from the 8857 // ProductService.RemoveLocalInventories method. 8858 type GoogleCloudRetailV2betaRemoveLocalInventoriesResponse struct { 8859 } 8860 8861 // GoogleCloudRetailV2betaSetInventoryMetadata: Metadata related to the 8862 // progress of the SetInventory operation. Currently empty because there is no 8863 // meaningful metadata populated from the ProductService.SetInventory method. 8864 type GoogleCloudRetailV2betaSetInventoryMetadata struct { 8865 } 8866 8867 // GoogleCloudRetailV2betaSetInventoryResponse: Response of the 8868 // SetInventoryRequest. Currently empty because there is no meaningful response 8869 // populated from the ProductService.SetInventory method. 8870 type GoogleCloudRetailV2betaSetInventoryResponse struct { 8871 } 8872 8873 // GoogleCloudRetailV2betaTuneModelMetadata: Metadata associated with a tune 8874 // operation. 8875 type GoogleCloudRetailV2betaTuneModelMetadata struct { 8876 // Model: The resource name of the model that this tune applies to. Format: 8877 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/mode 8878 // ls/{model_id}` 8879 Model string `json:"model,omitempty"` 8880 // ForceSendFields is a list of field names (e.g. "Model") to unconditionally 8881 // include in API requests. By default, fields with empty or default values are 8882 // omitted from API requests. See 8883 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8884 // details. 8885 ForceSendFields []string `json:"-"` 8886 // NullFields is a list of field names (e.g. "Model") to include in API 8887 // requests with the JSON null value. By default, fields with empty values are 8888 // omitted from API requests. See 8889 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8890 NullFields []string `json:"-"` 8891 } 8892 8893 func (s *GoogleCloudRetailV2betaTuneModelMetadata) MarshalJSON() ([]byte, error) { 8894 type NoMethod GoogleCloudRetailV2betaTuneModelMetadata 8895 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8896 } 8897 8898 // GoogleCloudRetailV2betaTuneModelResponse: Response associated with a tune 8899 // operation. 8900 type GoogleCloudRetailV2betaTuneModelResponse struct { 8901 } 8902 8903 // GoogleCloudRetailV2betaUserEventImportSummary: A summary of import result. 8904 // The UserEventImportSummary summarizes the import status for user events. 8905 type GoogleCloudRetailV2betaUserEventImportSummary struct { 8906 // JoinedEventsCount: Count of user events imported with complete existing 8907 // catalog information. 8908 JoinedEventsCount int64 `json:"joinedEventsCount,omitempty,string"` 8909 // UnjoinedEventsCount: Count of user events imported, but with catalog 8910 // information not found in the imported catalog. 8911 UnjoinedEventsCount int64 `json:"unjoinedEventsCount,omitempty,string"` 8912 // ForceSendFields is a list of field names (e.g. "JoinedEventsCount") to 8913 // unconditionally include in API requests. By default, fields with empty or 8914 // default values are omitted from API requests. See 8915 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8916 // details. 8917 ForceSendFields []string `json:"-"` 8918 // NullFields is a list of field names (e.g. "JoinedEventsCount") to include in 8919 // API requests with the JSON null value. By default, fields with empty values 8920 // are omitted from API requests. See 8921 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8922 NullFields []string `json:"-"` 8923 } 8924 8925 func (s *GoogleCloudRetailV2betaUserEventImportSummary) MarshalJSON() ([]byte, error) { 8926 type NoMethod GoogleCloudRetailV2betaUserEventImportSummary 8927 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8928 } 8929 8930 // GoogleLongrunningListOperationsResponse: The response message for 8931 // Operations.ListOperations. 8932 type GoogleLongrunningListOperationsResponse struct { 8933 // NextPageToken: The standard List next-page token. 8934 NextPageToken string `json:"nextPageToken,omitempty"` 8935 // Operations: A list of operations that matches the specified filter in the 8936 // request. 8937 Operations []*GoogleLongrunningOperation `json:"operations,omitempty"` 8938 8939 // ServerResponse contains the HTTP response code and headers from the server. 8940 googleapi.ServerResponse `json:"-"` 8941 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 8942 // unconditionally include in API requests. By default, fields with empty or 8943 // default values are omitted from API requests. See 8944 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8945 // details. 8946 ForceSendFields []string `json:"-"` 8947 // NullFields is a list of field names (e.g. "NextPageToken") to include in API 8948 // requests with the JSON null value. By default, fields with empty values are 8949 // omitted from API requests. See 8950 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8951 NullFields []string `json:"-"` 8952 } 8953 8954 func (s *GoogleLongrunningListOperationsResponse) MarshalJSON() ([]byte, error) { 8955 type NoMethod GoogleLongrunningListOperationsResponse 8956 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 8957 } 8958 8959 // GoogleLongrunningOperation: This resource represents a long-running 8960 // operation that is the result of a network API call. 8961 type GoogleLongrunningOperation struct { 8962 // Done: If the value is `false`, it means the operation is still in progress. 8963 // If `true`, the operation is completed, and either `error` or `response` is 8964 // available. 8965 Done bool `json:"done,omitempty"` 8966 // Error: The error result of the operation in case of failure or cancellation. 8967 Error *GoogleRpcStatus `json:"error,omitempty"` 8968 // Metadata: Service-specific metadata associated with the operation. It 8969 // typically contains progress information and common metadata such as create 8970 // time. Some services might not provide such metadata. Any method that returns 8971 // a long-running operation should document the metadata type, if any. 8972 Metadata googleapi.RawMessage `json:"metadata,omitempty"` 8973 // Name: The server-assigned name, which is only unique within the same service 8974 // that originally returns it. If you use the default HTTP mapping, the `name` 8975 // should be a resource name ending with `operations/{unique_id}`. 8976 Name string `json:"name,omitempty"` 8977 // Response: The normal, successful response of the operation. If the original 8978 // method returns no data on success, such as `Delete`, the response is 8979 // `google.protobuf.Empty`. If the original method is standard 8980 // `Get`/`Create`/`Update`, the response should be the resource. For other 8981 // methods, the response should have the type `XxxResponse`, where `Xxx` is the 8982 // original method name. For example, if the original method name is 8983 // `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. 8984 Response googleapi.RawMessage `json:"response,omitempty"` 8985 8986 // ServerResponse contains the HTTP response code and headers from the server. 8987 googleapi.ServerResponse `json:"-"` 8988 // ForceSendFields is a list of field names (e.g. "Done") to unconditionally 8989 // include in API requests. By default, fields with empty or default values are 8990 // omitted from API requests. See 8991 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 8992 // details. 8993 ForceSendFields []string `json:"-"` 8994 // NullFields is a list of field names (e.g. "Done") to include in API requests 8995 // with the JSON null value. By default, fields with empty values are omitted 8996 // from API requests. See 8997 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 8998 NullFields []string `json:"-"` 8999 } 9000 9001 func (s *GoogleLongrunningOperation) MarshalJSON() ([]byte, error) { 9002 type NoMethod GoogleLongrunningOperation 9003 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 9004 } 9005 9006 // GoogleProtobufEmpty: A generic empty message that you can re-use to avoid 9007 // defining duplicated empty messages in your APIs. A typical example is to use 9008 // it as the request or the response type of an API method. For instance: 9009 // service Foo { rpc Bar(google.protobuf.Empty) returns 9010 // (google.protobuf.Empty); } 9011 type GoogleProtobufEmpty struct { 9012 // ServerResponse contains the HTTP response code and headers from the server. 9013 googleapi.ServerResponse `json:"-"` 9014 } 9015 9016 // GoogleRpcStatus: The `Status` type defines a logical error model that is 9017 // suitable for different programming environments, including REST APIs and RPC 9018 // APIs. It is used by gRPC (https://github.com/grpc). Each `Status` message 9019 // contains three pieces of data: error code, error message, and error details. 9020 // You can find out more about this error model and how to work with it in the 9021 // API Design Guide (https://cloud.google.com/apis/design/errors). 9022 type GoogleRpcStatus struct { 9023 // Code: The status code, which should be an enum value of google.rpc.Code. 9024 Code int64 `json:"code,omitempty"` 9025 // Details: A list of messages that carry the error details. There is a common 9026 // set of message types for APIs to use. 9027 Details []googleapi.RawMessage `json:"details,omitempty"` 9028 // Message: A developer-facing error message, which should be in English. Any 9029 // user-facing error message should be localized and sent in the 9030 // google.rpc.Status.details field, or localized by the client. 9031 Message string `json:"message,omitempty"` 9032 // ForceSendFields is a list of field names (e.g. "Code") to unconditionally 9033 // include in API requests. By default, fields with empty or default values are 9034 // omitted from API requests. See 9035 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 9036 // details. 9037 ForceSendFields []string `json:"-"` 9038 // NullFields is a list of field names (e.g. "Code") to include in API requests 9039 // with the JSON null value. By default, fields with empty values are omitted 9040 // from API requests. See 9041 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 9042 NullFields []string `json:"-"` 9043 } 9044 9045 func (s *GoogleRpcStatus) MarshalJSON() ([]byte, error) { 9046 type NoMethod GoogleRpcStatus 9047 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 9048 } 9049 9050 // GoogleTypeDate: Represents a whole or partial calendar date, such as a 9051 // birthday. The time of day and time zone are either specified elsewhere or 9052 // are insignificant. The date is relative to the Gregorian Calendar. This can 9053 // represent one of the following: * A full date, with non-zero year, month, 9054 // and day values. * A month and day, with a zero year (for example, an 9055 // anniversary). * A year on its own, with a zero month and a zero day. * A 9056 // year and month, with a zero day (for example, a credit card expiration 9057 // date). Related types: * google.type.TimeOfDay * google.type.DateTime * 9058 // google.protobuf.Timestamp 9059 type GoogleTypeDate struct { 9060 // Day: Day of a month. Must be from 1 to 31 and valid for the year and month, 9061 // or 0 to specify a year by itself or a year and month where the day isn't 9062 // significant. 9063 Day int64 `json:"day,omitempty"` 9064 // Month: Month of a year. Must be from 1 to 12, or 0 to specify a year without 9065 // a month and day. 9066 Month int64 `json:"month,omitempty"` 9067 // Year: Year of the date. Must be from 1 to 9999, or 0 to specify a date 9068 // without a year. 9069 Year int64 `json:"year,omitempty"` 9070 // ForceSendFields is a list of field names (e.g. "Day") to unconditionally 9071 // include in API requests. By default, fields with empty or default values are 9072 // omitted from API requests. See 9073 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 9074 // details. 9075 ForceSendFields []string `json:"-"` 9076 // NullFields is a list of field names (e.g. "Day") to include in API requests 9077 // with the JSON null value. By default, fields with empty values are omitted 9078 // from API requests. See 9079 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 9080 NullFields []string `json:"-"` 9081 } 9082 9083 func (s *GoogleTypeDate) MarshalJSON() ([]byte, error) { 9084 type NoMethod GoogleTypeDate 9085 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 9086 } 9087 9088 type ProjectsEnrollSolutionCall struct { 9089 s *Service 9090 project string 9091 googlecloudretailv2alphaenrollsolutionrequest *GoogleCloudRetailV2alphaEnrollSolutionRequest 9092 urlParams_ gensupport.URLParams 9093 ctx_ context.Context 9094 header_ http.Header 9095 } 9096 9097 // EnrollSolution: The method enrolls a solution of type Retail Search into a 9098 // project. The Recommendations AI solution type is enrolled by default when 9099 // your project enables Retail API, so you don't need to call the 9100 // enrollSolution method for recommendations. 9101 // 9102 // - project: Full resource name of parent. Format: 9103 // `projects/{project_number_or_id}`. 9104 func (r *ProjectsService) EnrollSolution(project string, googlecloudretailv2alphaenrollsolutionrequest *GoogleCloudRetailV2alphaEnrollSolutionRequest) *ProjectsEnrollSolutionCall { 9105 c := &ProjectsEnrollSolutionCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9106 c.project = project 9107 c.googlecloudretailv2alphaenrollsolutionrequest = googlecloudretailv2alphaenrollsolutionrequest 9108 return c 9109 } 9110 9111 // Fields allows partial responses to be retrieved. See 9112 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 9113 // details. 9114 func (c *ProjectsEnrollSolutionCall) Fields(s ...googleapi.Field) *ProjectsEnrollSolutionCall { 9115 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9116 return c 9117 } 9118 9119 // Context sets the context to be used in this call's Do method. 9120 func (c *ProjectsEnrollSolutionCall) Context(ctx context.Context) *ProjectsEnrollSolutionCall { 9121 c.ctx_ = ctx 9122 return c 9123 } 9124 9125 // Header returns a http.Header that can be modified by the caller to add 9126 // headers to the request. 9127 func (c *ProjectsEnrollSolutionCall) Header() http.Header { 9128 if c.header_ == nil { 9129 c.header_ = make(http.Header) 9130 } 9131 return c.header_ 9132 } 9133 9134 func (c *ProjectsEnrollSolutionCall) doRequest(alt string) (*http.Response, error) { 9135 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 9136 var body io.Reader = nil 9137 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphaenrollsolutionrequest) 9138 if err != nil { 9139 return nil, err 9140 } 9141 c.urlParams_.Set("alt", alt) 9142 c.urlParams_.Set("prettyPrint", "false") 9143 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+project}:enrollSolution") 9144 urls += "?" + c.urlParams_.Encode() 9145 req, err := http.NewRequest("POST", urls, body) 9146 if err != nil { 9147 return nil, err 9148 } 9149 req.Header = reqHeaders 9150 googleapi.Expand(req.URL, map[string]string{ 9151 "project": c.project, 9152 }) 9153 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9154 } 9155 9156 // Do executes the "retail.projects.enrollSolution" call. 9157 // Any non-2xx status code is an error. Response headers are in either 9158 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was 9159 // returned at all) in error.(*googleapi.Error).Header. Use 9160 // googleapi.IsNotModified to check whether the returned error was because 9161 // http.StatusNotModified was returned. 9162 func (c *ProjectsEnrollSolutionCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 9163 gensupport.SetOptions(c.urlParams_, opts...) 9164 res, err := c.doRequest("json") 9165 if res != nil && res.StatusCode == http.StatusNotModified { 9166 if res.Body != nil { 9167 res.Body.Close() 9168 } 9169 return nil, gensupport.WrapError(&googleapi.Error{ 9170 Code: res.StatusCode, 9171 Header: res.Header, 9172 }) 9173 } 9174 if err != nil { 9175 return nil, err 9176 } 9177 defer googleapi.CloseBody(res) 9178 if err := googleapi.CheckResponse(res); err != nil { 9179 return nil, gensupport.WrapError(err) 9180 } 9181 ret := &GoogleLongrunningOperation{ 9182 ServerResponse: googleapi.ServerResponse{ 9183 Header: res.Header, 9184 HTTPStatusCode: res.StatusCode, 9185 }, 9186 } 9187 target := &ret 9188 if err := gensupport.DecodeResponse(target, res); err != nil { 9189 return nil, err 9190 } 9191 return ret, nil 9192 } 9193 9194 type ProjectsGetAlertConfigCall struct { 9195 s *Service 9196 name string 9197 urlParams_ gensupport.URLParams 9198 ifNoneMatch_ string 9199 ctx_ context.Context 9200 header_ http.Header 9201 } 9202 9203 // GetAlertConfig: Get the AlertConfig of the requested project. 9204 // 9205 // - name: Full AlertConfig resource name. Format: 9206 // projects/{project_number}/alertConfig. 9207 func (r *ProjectsService) GetAlertConfig(name string) *ProjectsGetAlertConfigCall { 9208 c := &ProjectsGetAlertConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9209 c.name = name 9210 return c 9211 } 9212 9213 // Fields allows partial responses to be retrieved. See 9214 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 9215 // details. 9216 func (c *ProjectsGetAlertConfigCall) Fields(s ...googleapi.Field) *ProjectsGetAlertConfigCall { 9217 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9218 return c 9219 } 9220 9221 // IfNoneMatch sets an optional parameter which makes the operation fail if the 9222 // object's ETag matches the given value. This is useful for getting updates 9223 // only after the object has changed since the last request. 9224 func (c *ProjectsGetAlertConfigCall) IfNoneMatch(entityTag string) *ProjectsGetAlertConfigCall { 9225 c.ifNoneMatch_ = entityTag 9226 return c 9227 } 9228 9229 // Context sets the context to be used in this call's Do method. 9230 func (c *ProjectsGetAlertConfigCall) Context(ctx context.Context) *ProjectsGetAlertConfigCall { 9231 c.ctx_ = ctx 9232 return c 9233 } 9234 9235 // Header returns a http.Header that can be modified by the caller to add 9236 // headers to the request. 9237 func (c *ProjectsGetAlertConfigCall) Header() http.Header { 9238 if c.header_ == nil { 9239 c.header_ = make(http.Header) 9240 } 9241 return c.header_ 9242 } 9243 9244 func (c *ProjectsGetAlertConfigCall) doRequest(alt string) (*http.Response, error) { 9245 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 9246 if c.ifNoneMatch_ != "" { 9247 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9248 } 9249 var body io.Reader = nil 9250 c.urlParams_.Set("alt", alt) 9251 c.urlParams_.Set("prettyPrint", "false") 9252 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") 9253 urls += "?" + c.urlParams_.Encode() 9254 req, err := http.NewRequest("GET", urls, body) 9255 if err != nil { 9256 return nil, err 9257 } 9258 req.Header = reqHeaders 9259 googleapi.Expand(req.URL, map[string]string{ 9260 "name": c.name, 9261 }) 9262 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9263 } 9264 9265 // Do executes the "retail.projects.getAlertConfig" call. 9266 // Any non-2xx status code is an error. Response headers are in either 9267 // *GoogleCloudRetailV2alphaAlertConfig.ServerResponse.Header or (if a response 9268 // was returned at all) in error.(*googleapi.Error).Header. Use 9269 // googleapi.IsNotModified to check whether the returned error was because 9270 // http.StatusNotModified was returned. 9271 func (c *ProjectsGetAlertConfigCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2alphaAlertConfig, error) { 9272 gensupport.SetOptions(c.urlParams_, opts...) 9273 res, err := c.doRequest("json") 9274 if res != nil && res.StatusCode == http.StatusNotModified { 9275 if res.Body != nil { 9276 res.Body.Close() 9277 } 9278 return nil, gensupport.WrapError(&googleapi.Error{ 9279 Code: res.StatusCode, 9280 Header: res.Header, 9281 }) 9282 } 9283 if err != nil { 9284 return nil, err 9285 } 9286 defer googleapi.CloseBody(res) 9287 if err := googleapi.CheckResponse(res); err != nil { 9288 return nil, gensupport.WrapError(err) 9289 } 9290 ret := &GoogleCloudRetailV2alphaAlertConfig{ 9291 ServerResponse: googleapi.ServerResponse{ 9292 Header: res.Header, 9293 HTTPStatusCode: res.StatusCode, 9294 }, 9295 } 9296 target := &ret 9297 if err := gensupport.DecodeResponse(target, res); err != nil { 9298 return nil, err 9299 } 9300 return ret, nil 9301 } 9302 9303 type ProjectsGetLoggingConfigCall struct { 9304 s *Service 9305 name string 9306 urlParams_ gensupport.URLParams 9307 ifNoneMatch_ string 9308 ctx_ context.Context 9309 header_ http.Header 9310 } 9311 9312 // GetLoggingConfig: Gets the LoggingConfig of the requested project. 9313 // 9314 // - name: Full LoggingConfig resource name. Format: 9315 // projects/{project_number}/loggingConfig. 9316 func (r *ProjectsService) GetLoggingConfig(name string) *ProjectsGetLoggingConfigCall { 9317 c := &ProjectsGetLoggingConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9318 c.name = name 9319 return c 9320 } 9321 9322 // Fields allows partial responses to be retrieved. See 9323 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 9324 // details. 9325 func (c *ProjectsGetLoggingConfigCall) Fields(s ...googleapi.Field) *ProjectsGetLoggingConfigCall { 9326 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9327 return c 9328 } 9329 9330 // IfNoneMatch sets an optional parameter which makes the operation fail if the 9331 // object's ETag matches the given value. This is useful for getting updates 9332 // only after the object has changed since the last request. 9333 func (c *ProjectsGetLoggingConfigCall) IfNoneMatch(entityTag string) *ProjectsGetLoggingConfigCall { 9334 c.ifNoneMatch_ = entityTag 9335 return c 9336 } 9337 9338 // Context sets the context to be used in this call's Do method. 9339 func (c *ProjectsGetLoggingConfigCall) Context(ctx context.Context) *ProjectsGetLoggingConfigCall { 9340 c.ctx_ = ctx 9341 return c 9342 } 9343 9344 // Header returns a http.Header that can be modified by the caller to add 9345 // headers to the request. 9346 func (c *ProjectsGetLoggingConfigCall) Header() http.Header { 9347 if c.header_ == nil { 9348 c.header_ = make(http.Header) 9349 } 9350 return c.header_ 9351 } 9352 9353 func (c *ProjectsGetLoggingConfigCall) doRequest(alt string) (*http.Response, error) { 9354 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 9355 if c.ifNoneMatch_ != "" { 9356 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9357 } 9358 var body io.Reader = nil 9359 c.urlParams_.Set("alt", alt) 9360 c.urlParams_.Set("prettyPrint", "false") 9361 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") 9362 urls += "?" + c.urlParams_.Encode() 9363 req, err := http.NewRequest("GET", urls, body) 9364 if err != nil { 9365 return nil, err 9366 } 9367 req.Header = reqHeaders 9368 googleapi.Expand(req.URL, map[string]string{ 9369 "name": c.name, 9370 }) 9371 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9372 } 9373 9374 // Do executes the "retail.projects.getLoggingConfig" call. 9375 // Any non-2xx status code is an error. Response headers are in either 9376 // *GoogleCloudRetailV2alphaLoggingConfig.ServerResponse.Header or (if a 9377 // response was returned at all) in error.(*googleapi.Error).Header. Use 9378 // googleapi.IsNotModified to check whether the returned error was because 9379 // http.StatusNotModified was returned. 9380 func (c *ProjectsGetLoggingConfigCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2alphaLoggingConfig, error) { 9381 gensupport.SetOptions(c.urlParams_, opts...) 9382 res, err := c.doRequest("json") 9383 if res != nil && res.StatusCode == http.StatusNotModified { 9384 if res.Body != nil { 9385 res.Body.Close() 9386 } 9387 return nil, gensupport.WrapError(&googleapi.Error{ 9388 Code: res.StatusCode, 9389 Header: res.Header, 9390 }) 9391 } 9392 if err != nil { 9393 return nil, err 9394 } 9395 defer googleapi.CloseBody(res) 9396 if err := googleapi.CheckResponse(res); err != nil { 9397 return nil, gensupport.WrapError(err) 9398 } 9399 ret := &GoogleCloudRetailV2alphaLoggingConfig{ 9400 ServerResponse: googleapi.ServerResponse{ 9401 Header: res.Header, 9402 HTTPStatusCode: res.StatusCode, 9403 }, 9404 } 9405 target := &ret 9406 if err := gensupport.DecodeResponse(target, res); err != nil { 9407 return nil, err 9408 } 9409 return ret, nil 9410 } 9411 9412 type ProjectsGetRetailProjectCall struct { 9413 s *Service 9414 name string 9415 urlParams_ gensupport.URLParams 9416 ifNoneMatch_ string 9417 ctx_ context.Context 9418 header_ http.Header 9419 } 9420 9421 // GetRetailProject: Gets the project. Throws `NOT_FOUND` if the project wasn't 9422 // initialized for the Retail API service. 9423 // 9424 // - name: Full resource name of the project. Format: 9425 // `projects/{project_number_or_id}/retailProject`. 9426 func (r *ProjectsService) GetRetailProject(name string) *ProjectsGetRetailProjectCall { 9427 c := &ProjectsGetRetailProjectCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9428 c.name = name 9429 return c 9430 } 9431 9432 // Fields allows partial responses to be retrieved. See 9433 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 9434 // details. 9435 func (c *ProjectsGetRetailProjectCall) Fields(s ...googleapi.Field) *ProjectsGetRetailProjectCall { 9436 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9437 return c 9438 } 9439 9440 // IfNoneMatch sets an optional parameter which makes the operation fail if the 9441 // object's ETag matches the given value. This is useful for getting updates 9442 // only after the object has changed since the last request. 9443 func (c *ProjectsGetRetailProjectCall) IfNoneMatch(entityTag string) *ProjectsGetRetailProjectCall { 9444 c.ifNoneMatch_ = entityTag 9445 return c 9446 } 9447 9448 // Context sets the context to be used in this call's Do method. 9449 func (c *ProjectsGetRetailProjectCall) Context(ctx context.Context) *ProjectsGetRetailProjectCall { 9450 c.ctx_ = ctx 9451 return c 9452 } 9453 9454 // Header returns a http.Header that can be modified by the caller to add 9455 // headers to the request. 9456 func (c *ProjectsGetRetailProjectCall) Header() http.Header { 9457 if c.header_ == nil { 9458 c.header_ = make(http.Header) 9459 } 9460 return c.header_ 9461 } 9462 9463 func (c *ProjectsGetRetailProjectCall) doRequest(alt string) (*http.Response, error) { 9464 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 9465 if c.ifNoneMatch_ != "" { 9466 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9467 } 9468 var body io.Reader = nil 9469 c.urlParams_.Set("alt", alt) 9470 c.urlParams_.Set("prettyPrint", "false") 9471 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") 9472 urls += "?" + c.urlParams_.Encode() 9473 req, err := http.NewRequest("GET", urls, body) 9474 if err != nil { 9475 return nil, err 9476 } 9477 req.Header = reqHeaders 9478 googleapi.Expand(req.URL, map[string]string{ 9479 "name": c.name, 9480 }) 9481 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9482 } 9483 9484 // Do executes the "retail.projects.getRetailProject" call. 9485 // Any non-2xx status code is an error. Response headers are in either 9486 // *GoogleCloudRetailV2alphaProject.ServerResponse.Header or (if a response was 9487 // returned at all) in error.(*googleapi.Error).Header. Use 9488 // googleapi.IsNotModified to check whether the returned error was because 9489 // http.StatusNotModified was returned. 9490 func (c *ProjectsGetRetailProjectCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2alphaProject, error) { 9491 gensupport.SetOptions(c.urlParams_, opts...) 9492 res, err := c.doRequest("json") 9493 if res != nil && res.StatusCode == http.StatusNotModified { 9494 if res.Body != nil { 9495 res.Body.Close() 9496 } 9497 return nil, gensupport.WrapError(&googleapi.Error{ 9498 Code: res.StatusCode, 9499 Header: res.Header, 9500 }) 9501 } 9502 if err != nil { 9503 return nil, err 9504 } 9505 defer googleapi.CloseBody(res) 9506 if err := googleapi.CheckResponse(res); err != nil { 9507 return nil, gensupport.WrapError(err) 9508 } 9509 ret := &GoogleCloudRetailV2alphaProject{ 9510 ServerResponse: googleapi.ServerResponse{ 9511 Header: res.Header, 9512 HTTPStatusCode: res.StatusCode, 9513 }, 9514 } 9515 target := &ret 9516 if err := gensupport.DecodeResponse(target, res); err != nil { 9517 return nil, err 9518 } 9519 return ret, nil 9520 } 9521 9522 type ProjectsListEnrolledSolutionsCall struct { 9523 s *Service 9524 parent string 9525 urlParams_ gensupport.URLParams 9526 ifNoneMatch_ string 9527 ctx_ context.Context 9528 header_ http.Header 9529 } 9530 9531 // ListEnrolledSolutions: Lists all the retail API solutions the project has 9532 // enrolled. 9533 // 9534 // - parent: Full resource name of parent. Format: 9535 // `projects/{project_number_or_id}`. 9536 func (r *ProjectsService) ListEnrolledSolutions(parent string) *ProjectsListEnrolledSolutionsCall { 9537 c := &ProjectsListEnrolledSolutionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9538 c.parent = parent 9539 return c 9540 } 9541 9542 // Fields allows partial responses to be retrieved. See 9543 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 9544 // details. 9545 func (c *ProjectsListEnrolledSolutionsCall) Fields(s ...googleapi.Field) *ProjectsListEnrolledSolutionsCall { 9546 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9547 return c 9548 } 9549 9550 // IfNoneMatch sets an optional parameter which makes the operation fail if the 9551 // object's ETag matches the given value. This is useful for getting updates 9552 // only after the object has changed since the last request. 9553 func (c *ProjectsListEnrolledSolutionsCall) IfNoneMatch(entityTag string) *ProjectsListEnrolledSolutionsCall { 9554 c.ifNoneMatch_ = entityTag 9555 return c 9556 } 9557 9558 // Context sets the context to be used in this call's Do method. 9559 func (c *ProjectsListEnrolledSolutionsCall) Context(ctx context.Context) *ProjectsListEnrolledSolutionsCall { 9560 c.ctx_ = ctx 9561 return c 9562 } 9563 9564 // Header returns a http.Header that can be modified by the caller to add 9565 // headers to the request. 9566 func (c *ProjectsListEnrolledSolutionsCall) Header() http.Header { 9567 if c.header_ == nil { 9568 c.header_ = make(http.Header) 9569 } 9570 return c.header_ 9571 } 9572 9573 func (c *ProjectsListEnrolledSolutionsCall) doRequest(alt string) (*http.Response, error) { 9574 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 9575 if c.ifNoneMatch_ != "" { 9576 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9577 } 9578 var body io.Reader = nil 9579 c.urlParams_.Set("alt", alt) 9580 c.urlParams_.Set("prettyPrint", "false") 9581 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+parent}:enrolledSolutions") 9582 urls += "?" + c.urlParams_.Encode() 9583 req, err := http.NewRequest("GET", urls, body) 9584 if err != nil { 9585 return nil, err 9586 } 9587 req.Header = reqHeaders 9588 googleapi.Expand(req.URL, map[string]string{ 9589 "parent": c.parent, 9590 }) 9591 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9592 } 9593 9594 // Do executes the "retail.projects.listEnrolledSolutions" call. 9595 // Any non-2xx status code is an error. Response headers are in either 9596 // *GoogleCloudRetailV2alphaListEnrolledSolutionsResponse.ServerResponse.Header 9597 // or (if a response was returned at all) in error.(*googleapi.Error).Header. 9598 // Use googleapi.IsNotModified to check whether the returned error was because 9599 // http.StatusNotModified was returned. 9600 func (c *ProjectsListEnrolledSolutionsCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2alphaListEnrolledSolutionsResponse, error) { 9601 gensupport.SetOptions(c.urlParams_, opts...) 9602 res, err := c.doRequest("json") 9603 if res != nil && res.StatusCode == http.StatusNotModified { 9604 if res.Body != nil { 9605 res.Body.Close() 9606 } 9607 return nil, gensupport.WrapError(&googleapi.Error{ 9608 Code: res.StatusCode, 9609 Header: res.Header, 9610 }) 9611 } 9612 if err != nil { 9613 return nil, err 9614 } 9615 defer googleapi.CloseBody(res) 9616 if err := googleapi.CheckResponse(res); err != nil { 9617 return nil, gensupport.WrapError(err) 9618 } 9619 ret := &GoogleCloudRetailV2alphaListEnrolledSolutionsResponse{ 9620 ServerResponse: googleapi.ServerResponse{ 9621 Header: res.Header, 9622 HTTPStatusCode: res.StatusCode, 9623 }, 9624 } 9625 target := &ret 9626 if err := gensupport.DecodeResponse(target, res); err != nil { 9627 return nil, err 9628 } 9629 return ret, nil 9630 } 9631 9632 type ProjectsUpdateAlertConfigCall struct { 9633 s *Service 9634 name string 9635 googlecloudretailv2alphaalertconfig *GoogleCloudRetailV2alphaAlertConfig 9636 urlParams_ gensupport.URLParams 9637 ctx_ context.Context 9638 header_ http.Header 9639 } 9640 9641 // UpdateAlertConfig: Update the alert config of the requested project. 9642 // 9643 // - name: Immutable. The name of the AlertConfig singleton resource. Format: 9644 // projects/*/alertConfig. 9645 func (r *ProjectsService) UpdateAlertConfig(name string, googlecloudretailv2alphaalertconfig *GoogleCloudRetailV2alphaAlertConfig) *ProjectsUpdateAlertConfigCall { 9646 c := &ProjectsUpdateAlertConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9647 c.name = name 9648 c.googlecloudretailv2alphaalertconfig = googlecloudretailv2alphaalertconfig 9649 return c 9650 } 9651 9652 // UpdateMask sets the optional parameter "updateMask": Indicates which fields 9653 // in the provided AlertConfig to update. If not set, all supported fields are 9654 // updated. 9655 func (c *ProjectsUpdateAlertConfigCall) UpdateMask(updateMask string) *ProjectsUpdateAlertConfigCall { 9656 c.urlParams_.Set("updateMask", updateMask) 9657 return c 9658 } 9659 9660 // Fields allows partial responses to be retrieved. See 9661 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 9662 // details. 9663 func (c *ProjectsUpdateAlertConfigCall) Fields(s ...googleapi.Field) *ProjectsUpdateAlertConfigCall { 9664 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9665 return c 9666 } 9667 9668 // Context sets the context to be used in this call's Do method. 9669 func (c *ProjectsUpdateAlertConfigCall) Context(ctx context.Context) *ProjectsUpdateAlertConfigCall { 9670 c.ctx_ = ctx 9671 return c 9672 } 9673 9674 // Header returns a http.Header that can be modified by the caller to add 9675 // headers to the request. 9676 func (c *ProjectsUpdateAlertConfigCall) Header() http.Header { 9677 if c.header_ == nil { 9678 c.header_ = make(http.Header) 9679 } 9680 return c.header_ 9681 } 9682 9683 func (c *ProjectsUpdateAlertConfigCall) doRequest(alt string) (*http.Response, error) { 9684 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 9685 var body io.Reader = nil 9686 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphaalertconfig) 9687 if err != nil { 9688 return nil, err 9689 } 9690 c.urlParams_.Set("alt", alt) 9691 c.urlParams_.Set("prettyPrint", "false") 9692 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") 9693 urls += "?" + c.urlParams_.Encode() 9694 req, err := http.NewRequest("PATCH", urls, body) 9695 if err != nil { 9696 return nil, err 9697 } 9698 req.Header = reqHeaders 9699 googleapi.Expand(req.URL, map[string]string{ 9700 "name": c.name, 9701 }) 9702 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9703 } 9704 9705 // Do executes the "retail.projects.updateAlertConfig" call. 9706 // Any non-2xx status code is an error. Response headers are in either 9707 // *GoogleCloudRetailV2alphaAlertConfig.ServerResponse.Header or (if a response 9708 // was returned at all) in error.(*googleapi.Error).Header. Use 9709 // googleapi.IsNotModified to check whether the returned error was because 9710 // http.StatusNotModified was returned. 9711 func (c *ProjectsUpdateAlertConfigCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2alphaAlertConfig, error) { 9712 gensupport.SetOptions(c.urlParams_, opts...) 9713 res, err := c.doRequest("json") 9714 if res != nil && res.StatusCode == http.StatusNotModified { 9715 if res.Body != nil { 9716 res.Body.Close() 9717 } 9718 return nil, gensupport.WrapError(&googleapi.Error{ 9719 Code: res.StatusCode, 9720 Header: res.Header, 9721 }) 9722 } 9723 if err != nil { 9724 return nil, err 9725 } 9726 defer googleapi.CloseBody(res) 9727 if err := googleapi.CheckResponse(res); err != nil { 9728 return nil, gensupport.WrapError(err) 9729 } 9730 ret := &GoogleCloudRetailV2alphaAlertConfig{ 9731 ServerResponse: googleapi.ServerResponse{ 9732 Header: res.Header, 9733 HTTPStatusCode: res.StatusCode, 9734 }, 9735 } 9736 target := &ret 9737 if err := gensupport.DecodeResponse(target, res); err != nil { 9738 return nil, err 9739 } 9740 return ret, nil 9741 } 9742 9743 type ProjectsUpdateLoggingConfigCall struct { 9744 s *Service 9745 name string 9746 googlecloudretailv2alphaloggingconfig *GoogleCloudRetailV2alphaLoggingConfig 9747 urlParams_ gensupport.URLParams 9748 ctx_ context.Context 9749 header_ http.Header 9750 } 9751 9752 // UpdateLoggingConfig: Updates the LoggingConfig of the requested project. 9753 // 9754 // - name: Immutable. The name of the LoggingConfig singleton resource. Format: 9755 // projects/*/loggingConfig. 9756 func (r *ProjectsService) UpdateLoggingConfig(name string, googlecloudretailv2alphaloggingconfig *GoogleCloudRetailV2alphaLoggingConfig) *ProjectsUpdateLoggingConfigCall { 9757 c := &ProjectsUpdateLoggingConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9758 c.name = name 9759 c.googlecloudretailv2alphaloggingconfig = googlecloudretailv2alphaloggingconfig 9760 return c 9761 } 9762 9763 // UpdateMask sets the optional parameter "updateMask": Indicates which fields 9764 // in the provided LoggingConfig to update. The following are the only 9765 // supported fields: * LoggingConfig.default_log_generation_rule * 9766 // LoggingConfig.per_service_log_generation_rules If not set, all supported 9767 // fields are updated. 9768 func (c *ProjectsUpdateLoggingConfigCall) UpdateMask(updateMask string) *ProjectsUpdateLoggingConfigCall { 9769 c.urlParams_.Set("updateMask", updateMask) 9770 return c 9771 } 9772 9773 // Fields allows partial responses to be retrieved. See 9774 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 9775 // details. 9776 func (c *ProjectsUpdateLoggingConfigCall) Fields(s ...googleapi.Field) *ProjectsUpdateLoggingConfigCall { 9777 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9778 return c 9779 } 9780 9781 // Context sets the context to be used in this call's Do method. 9782 func (c *ProjectsUpdateLoggingConfigCall) Context(ctx context.Context) *ProjectsUpdateLoggingConfigCall { 9783 c.ctx_ = ctx 9784 return c 9785 } 9786 9787 // Header returns a http.Header that can be modified by the caller to add 9788 // headers to the request. 9789 func (c *ProjectsUpdateLoggingConfigCall) Header() http.Header { 9790 if c.header_ == nil { 9791 c.header_ = make(http.Header) 9792 } 9793 return c.header_ 9794 } 9795 9796 func (c *ProjectsUpdateLoggingConfigCall) doRequest(alt string) (*http.Response, error) { 9797 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 9798 var body io.Reader = nil 9799 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphaloggingconfig) 9800 if err != nil { 9801 return nil, err 9802 } 9803 c.urlParams_.Set("alt", alt) 9804 c.urlParams_.Set("prettyPrint", "false") 9805 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") 9806 urls += "?" + c.urlParams_.Encode() 9807 req, err := http.NewRequest("PATCH", urls, body) 9808 if err != nil { 9809 return nil, err 9810 } 9811 req.Header = reqHeaders 9812 googleapi.Expand(req.URL, map[string]string{ 9813 "name": c.name, 9814 }) 9815 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9816 } 9817 9818 // Do executes the "retail.projects.updateLoggingConfig" call. 9819 // Any non-2xx status code is an error. Response headers are in either 9820 // *GoogleCloudRetailV2alphaLoggingConfig.ServerResponse.Header or (if a 9821 // response was returned at all) in error.(*googleapi.Error).Header. Use 9822 // googleapi.IsNotModified to check whether the returned error was because 9823 // http.StatusNotModified was returned. 9824 func (c *ProjectsUpdateLoggingConfigCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2alphaLoggingConfig, error) { 9825 gensupport.SetOptions(c.urlParams_, opts...) 9826 res, err := c.doRequest("json") 9827 if res != nil && res.StatusCode == http.StatusNotModified { 9828 if res.Body != nil { 9829 res.Body.Close() 9830 } 9831 return nil, gensupport.WrapError(&googleapi.Error{ 9832 Code: res.StatusCode, 9833 Header: res.Header, 9834 }) 9835 } 9836 if err != nil { 9837 return nil, err 9838 } 9839 defer googleapi.CloseBody(res) 9840 if err := googleapi.CheckResponse(res); err != nil { 9841 return nil, gensupport.WrapError(err) 9842 } 9843 ret := &GoogleCloudRetailV2alphaLoggingConfig{ 9844 ServerResponse: googleapi.ServerResponse{ 9845 Header: res.Header, 9846 HTTPStatusCode: res.StatusCode, 9847 }, 9848 } 9849 target := &ret 9850 if err := gensupport.DecodeResponse(target, res); err != nil { 9851 return nil, err 9852 } 9853 return ret, nil 9854 } 9855 9856 type ProjectsLocationsCatalogsCompleteQueryCall struct { 9857 s *Service 9858 catalog string 9859 urlParams_ gensupport.URLParams 9860 ifNoneMatch_ string 9861 ctx_ context.Context 9862 header_ http.Header 9863 } 9864 9865 // CompleteQuery: Completes the specified prefix with keyword suggestions. This 9866 // feature is only available for users who have Retail Search enabled. Enable 9867 // Retail Search on Cloud Console before using this feature. 9868 // 9869 // - catalog: Catalog for which the completion is performed. Full resource name 9870 // of catalog, such as 9871 // `projects/*/locations/global/catalogs/default_catalog`. 9872 func (r *ProjectsLocationsCatalogsService) CompleteQuery(catalog string) *ProjectsLocationsCatalogsCompleteQueryCall { 9873 c := &ProjectsLocationsCatalogsCompleteQueryCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9874 c.catalog = catalog 9875 return c 9876 } 9877 9878 // Dataset sets the optional parameter "dataset": Determines which dataset to 9879 // use for fetching completion. "user-data" will use the imported dataset 9880 // through CompletionService.ImportCompletionData. "cloud-retail" will use the 9881 // dataset generated by cloud retail based on user events. If leave empty, it 9882 // will use the "user-data". Current supported values: * user-data * 9883 // cloud-retail: This option requires enabling auto-learning function first. 9884 // See guidelines 9885 // (https://cloud.google.com/retail/docs/completion-overview#generated-completion-dataset). 9886 func (c *ProjectsLocationsCatalogsCompleteQueryCall) Dataset(dataset string) *ProjectsLocationsCatalogsCompleteQueryCall { 9887 c.urlParams_.Set("dataset", dataset) 9888 return c 9889 } 9890 9891 // DeviceType sets the optional parameter "deviceType": The device type context 9892 // for completion suggestions. We recommend that you leave this field empty. It 9893 // can apply different suggestions on different device types, e.g. `DESKTOP`, 9894 // `MOBILE`. If it is empty, the suggestions are across all device types. 9895 // Supported formats: * `UNKNOWN_DEVICE_TYPE` * `DESKTOP` * `MOBILE` * A 9896 // customized string starts with `OTHER_`, e.g. `OTHER_IPHONE`. 9897 func (c *ProjectsLocationsCatalogsCompleteQueryCall) DeviceType(deviceType string) *ProjectsLocationsCatalogsCompleteQueryCall { 9898 c.urlParams_.Set("deviceType", deviceType) 9899 return c 9900 } 9901 9902 // EnableAttributeSuggestions sets the optional parameter 9903 // "enableAttributeSuggestions": If true, attribute suggestions are enabled and 9904 // provided in response. This field is only available for "cloud-retail" 9905 // dataset. 9906 func (c *ProjectsLocationsCatalogsCompleteQueryCall) EnableAttributeSuggestions(enableAttributeSuggestions bool) *ProjectsLocationsCatalogsCompleteQueryCall { 9907 c.urlParams_.Set("enableAttributeSuggestions", fmt.Sprint(enableAttributeSuggestions)) 9908 return c 9909 } 9910 9911 // Entity sets the optional parameter "entity": The entity for customers who 9912 // run multiple entities, domains, sites, or regions, for example, `Google US`, 9913 // `Google Ads`, `Waymo`, `google.com`, `youtube.com`, etc. If this is set, it 9914 // must be an exact match with UserEvent.entity to get per-entity autocomplete 9915 // results. 9916 func (c *ProjectsLocationsCatalogsCompleteQueryCall) Entity(entity string) *ProjectsLocationsCatalogsCompleteQueryCall { 9917 c.urlParams_.Set("entity", entity) 9918 return c 9919 } 9920 9921 // LanguageCodes sets the optional parameter "languageCodes": Note that this 9922 // field applies for `user-data` dataset only. For requests with `cloud-retail` 9923 // dataset, setting this field has no effect. The language filters applied to 9924 // the output suggestions. If set, it should contain the language of the query. 9925 // If not set, suggestions are returned without considering language 9926 // restrictions. This is the BCP-47 language code, such as "en-US" or 9927 // "sr-Latn". For more information, see Tags for Identifying Languages 9928 // (https://tools.ietf.org/html/bcp47). The maximum number of language codes is 9929 // 3. 9930 func (c *ProjectsLocationsCatalogsCompleteQueryCall) LanguageCodes(languageCodes ...string) *ProjectsLocationsCatalogsCompleteQueryCall { 9931 c.urlParams_.SetMulti("languageCodes", append([]string{}, languageCodes...)) 9932 return c 9933 } 9934 9935 // MaxSuggestions sets the optional parameter "maxSuggestions": Completion max 9936 // suggestions. If left unset or set to 0, then will fallback to the configured 9937 // value CompletionConfig.max_suggestions. The maximum allowed max suggestions 9938 // is 20. If it is set higher, it will be capped by 20. 9939 func (c *ProjectsLocationsCatalogsCompleteQueryCall) MaxSuggestions(maxSuggestions int64) *ProjectsLocationsCatalogsCompleteQueryCall { 9940 c.urlParams_.Set("maxSuggestions", fmt.Sprint(maxSuggestions)) 9941 return c 9942 } 9943 9944 // Query sets the optional parameter "query": Required. The query used to 9945 // generate suggestions. The maximum number of allowed characters is 255. 9946 func (c *ProjectsLocationsCatalogsCompleteQueryCall) Query(query string) *ProjectsLocationsCatalogsCompleteQueryCall { 9947 c.urlParams_.Set("query", query) 9948 return c 9949 } 9950 9951 // VisitorId sets the optional parameter "visitorId": Required field. A unique 9952 // identifier for tracking visitors. For example, this could be implemented 9953 // with an HTTP cookie, which should be able to uniquely identify a visitor on 9954 // a single device. This unique identifier should not change if the visitor 9955 // logs in or out of the website. The field must be a UTF-8 encoded string with 9956 // a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is 9957 // returned. 9958 func (c *ProjectsLocationsCatalogsCompleteQueryCall) VisitorId(visitorId string) *ProjectsLocationsCatalogsCompleteQueryCall { 9959 c.urlParams_.Set("visitorId", visitorId) 9960 return c 9961 } 9962 9963 // Fields allows partial responses to be retrieved. See 9964 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 9965 // details. 9966 func (c *ProjectsLocationsCatalogsCompleteQueryCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsCompleteQueryCall { 9967 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9968 return c 9969 } 9970 9971 // IfNoneMatch sets an optional parameter which makes the operation fail if the 9972 // object's ETag matches the given value. This is useful for getting updates 9973 // only after the object has changed since the last request. 9974 func (c *ProjectsLocationsCatalogsCompleteQueryCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsCompleteQueryCall { 9975 c.ifNoneMatch_ = entityTag 9976 return c 9977 } 9978 9979 // Context sets the context to be used in this call's Do method. 9980 func (c *ProjectsLocationsCatalogsCompleteQueryCall) Context(ctx context.Context) *ProjectsLocationsCatalogsCompleteQueryCall { 9981 c.ctx_ = ctx 9982 return c 9983 } 9984 9985 // Header returns a http.Header that can be modified by the caller to add 9986 // headers to the request. 9987 func (c *ProjectsLocationsCatalogsCompleteQueryCall) Header() http.Header { 9988 if c.header_ == nil { 9989 c.header_ = make(http.Header) 9990 } 9991 return c.header_ 9992 } 9993 9994 func (c *ProjectsLocationsCatalogsCompleteQueryCall) doRequest(alt string) (*http.Response, error) { 9995 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 9996 if c.ifNoneMatch_ != "" { 9997 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9998 } 9999 var body io.Reader = nil 10000 c.urlParams_.Set("alt", alt) 10001 c.urlParams_.Set("prettyPrint", "false") 10002 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+catalog}:completeQuery") 10003 urls += "?" + c.urlParams_.Encode() 10004 req, err := http.NewRequest("GET", urls, body) 10005 if err != nil { 10006 return nil, err 10007 } 10008 req.Header = reqHeaders 10009 googleapi.Expand(req.URL, map[string]string{ 10010 "catalog": c.catalog, 10011 }) 10012 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10013 } 10014 10015 // Do executes the "retail.projects.locations.catalogs.completeQuery" call. 10016 // Any non-2xx status code is an error. Response headers are in either 10017 // *GoogleCloudRetailV2alphaCompleteQueryResponse.ServerResponse.Header or (if 10018 // a response was returned at all) in error.(*googleapi.Error).Header. Use 10019 // googleapi.IsNotModified to check whether the returned error was because 10020 // http.StatusNotModified was returned. 10021 func (c *ProjectsLocationsCatalogsCompleteQueryCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2alphaCompleteQueryResponse, error) { 10022 gensupport.SetOptions(c.urlParams_, opts...) 10023 res, err := c.doRequest("json") 10024 if res != nil && res.StatusCode == http.StatusNotModified { 10025 if res.Body != nil { 10026 res.Body.Close() 10027 } 10028 return nil, gensupport.WrapError(&googleapi.Error{ 10029 Code: res.StatusCode, 10030 Header: res.Header, 10031 }) 10032 } 10033 if err != nil { 10034 return nil, err 10035 } 10036 defer googleapi.CloseBody(res) 10037 if err := googleapi.CheckResponse(res); err != nil { 10038 return nil, gensupport.WrapError(err) 10039 } 10040 ret := &GoogleCloudRetailV2alphaCompleteQueryResponse{ 10041 ServerResponse: googleapi.ServerResponse{ 10042 Header: res.Header, 10043 HTTPStatusCode: res.StatusCode, 10044 }, 10045 } 10046 target := &ret 10047 if err := gensupport.DecodeResponse(target, res); err != nil { 10048 return nil, err 10049 } 10050 return ret, nil 10051 } 10052 10053 type ProjectsLocationsCatalogsExportAnalyticsMetricsCall struct { 10054 s *Service 10055 catalog string 10056 googlecloudretailv2alphaexportanalyticsmetricsrequest *GoogleCloudRetailV2alphaExportAnalyticsMetricsRequest 10057 urlParams_ gensupport.URLParams 10058 ctx_ context.Context 10059 header_ http.Header 10060 } 10061 10062 // ExportAnalyticsMetrics: Exports analytics metrics. `Operation.response` is 10063 // of type `ExportAnalyticsMetricsResponse`. `Operation.metadata` is of type 10064 // `ExportMetadata`. 10065 // 10066 // - catalog: Full resource name of the parent catalog. Expected format: 10067 // `projects/*/locations/*/catalogs/*`. 10068 func (r *ProjectsLocationsCatalogsService) ExportAnalyticsMetrics(catalog string, googlecloudretailv2alphaexportanalyticsmetricsrequest *GoogleCloudRetailV2alphaExportAnalyticsMetricsRequest) *ProjectsLocationsCatalogsExportAnalyticsMetricsCall { 10069 c := &ProjectsLocationsCatalogsExportAnalyticsMetricsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10070 c.catalog = catalog 10071 c.googlecloudretailv2alphaexportanalyticsmetricsrequest = googlecloudretailv2alphaexportanalyticsmetricsrequest 10072 return c 10073 } 10074 10075 // Fields allows partial responses to be retrieved. See 10076 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 10077 // details. 10078 func (c *ProjectsLocationsCatalogsExportAnalyticsMetricsCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsExportAnalyticsMetricsCall { 10079 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10080 return c 10081 } 10082 10083 // Context sets the context to be used in this call's Do method. 10084 func (c *ProjectsLocationsCatalogsExportAnalyticsMetricsCall) Context(ctx context.Context) *ProjectsLocationsCatalogsExportAnalyticsMetricsCall { 10085 c.ctx_ = ctx 10086 return c 10087 } 10088 10089 // Header returns a http.Header that can be modified by the caller to add 10090 // headers to the request. 10091 func (c *ProjectsLocationsCatalogsExportAnalyticsMetricsCall) Header() http.Header { 10092 if c.header_ == nil { 10093 c.header_ = make(http.Header) 10094 } 10095 return c.header_ 10096 } 10097 10098 func (c *ProjectsLocationsCatalogsExportAnalyticsMetricsCall) doRequest(alt string) (*http.Response, error) { 10099 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 10100 var body io.Reader = nil 10101 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphaexportanalyticsmetricsrequest) 10102 if err != nil { 10103 return nil, err 10104 } 10105 c.urlParams_.Set("alt", alt) 10106 c.urlParams_.Set("prettyPrint", "false") 10107 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+catalog}:exportAnalyticsMetrics") 10108 urls += "?" + c.urlParams_.Encode() 10109 req, err := http.NewRequest("POST", urls, body) 10110 if err != nil { 10111 return nil, err 10112 } 10113 req.Header = reqHeaders 10114 googleapi.Expand(req.URL, map[string]string{ 10115 "catalog": c.catalog, 10116 }) 10117 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10118 } 10119 10120 // Do executes the "retail.projects.locations.catalogs.exportAnalyticsMetrics" call. 10121 // Any non-2xx status code is an error. Response headers are in either 10122 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was 10123 // returned at all) in error.(*googleapi.Error).Header. Use 10124 // googleapi.IsNotModified to check whether the returned error was because 10125 // http.StatusNotModified was returned. 10126 func (c *ProjectsLocationsCatalogsExportAnalyticsMetricsCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 10127 gensupport.SetOptions(c.urlParams_, opts...) 10128 res, err := c.doRequest("json") 10129 if res != nil && res.StatusCode == http.StatusNotModified { 10130 if res.Body != nil { 10131 res.Body.Close() 10132 } 10133 return nil, gensupport.WrapError(&googleapi.Error{ 10134 Code: res.StatusCode, 10135 Header: res.Header, 10136 }) 10137 } 10138 if err != nil { 10139 return nil, err 10140 } 10141 defer googleapi.CloseBody(res) 10142 if err := googleapi.CheckResponse(res); err != nil { 10143 return nil, gensupport.WrapError(err) 10144 } 10145 ret := &GoogleLongrunningOperation{ 10146 ServerResponse: googleapi.ServerResponse{ 10147 Header: res.Header, 10148 HTTPStatusCode: res.StatusCode, 10149 }, 10150 } 10151 target := &ret 10152 if err := gensupport.DecodeResponse(target, res); err != nil { 10153 return nil, err 10154 } 10155 return ret, nil 10156 } 10157 10158 type ProjectsLocationsCatalogsGetAttributesConfigCall struct { 10159 s *Service 10160 name string 10161 urlParams_ gensupport.URLParams 10162 ifNoneMatch_ string 10163 ctx_ context.Context 10164 header_ http.Header 10165 } 10166 10167 // GetAttributesConfig: Gets an AttributesConfig. 10168 // 10169 // - name: Full AttributesConfig resource name. Format: 10170 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/at 10171 // tributesConfig`. 10172 func (r *ProjectsLocationsCatalogsService) GetAttributesConfig(name string) *ProjectsLocationsCatalogsGetAttributesConfigCall { 10173 c := &ProjectsLocationsCatalogsGetAttributesConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10174 c.name = name 10175 return c 10176 } 10177 10178 // Fields allows partial responses to be retrieved. See 10179 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 10180 // details. 10181 func (c *ProjectsLocationsCatalogsGetAttributesConfigCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsGetAttributesConfigCall { 10182 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10183 return c 10184 } 10185 10186 // IfNoneMatch sets an optional parameter which makes the operation fail if the 10187 // object's ETag matches the given value. This is useful for getting updates 10188 // only after the object has changed since the last request. 10189 func (c *ProjectsLocationsCatalogsGetAttributesConfigCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsGetAttributesConfigCall { 10190 c.ifNoneMatch_ = entityTag 10191 return c 10192 } 10193 10194 // Context sets the context to be used in this call's Do method. 10195 func (c *ProjectsLocationsCatalogsGetAttributesConfigCall) Context(ctx context.Context) *ProjectsLocationsCatalogsGetAttributesConfigCall { 10196 c.ctx_ = ctx 10197 return c 10198 } 10199 10200 // Header returns a http.Header that can be modified by the caller to add 10201 // headers to the request. 10202 func (c *ProjectsLocationsCatalogsGetAttributesConfigCall) Header() http.Header { 10203 if c.header_ == nil { 10204 c.header_ = make(http.Header) 10205 } 10206 return c.header_ 10207 } 10208 10209 func (c *ProjectsLocationsCatalogsGetAttributesConfigCall) doRequest(alt string) (*http.Response, error) { 10210 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 10211 if c.ifNoneMatch_ != "" { 10212 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 10213 } 10214 var body io.Reader = nil 10215 c.urlParams_.Set("alt", alt) 10216 c.urlParams_.Set("prettyPrint", "false") 10217 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") 10218 urls += "?" + c.urlParams_.Encode() 10219 req, err := http.NewRequest("GET", urls, body) 10220 if err != nil { 10221 return nil, err 10222 } 10223 req.Header = reqHeaders 10224 googleapi.Expand(req.URL, map[string]string{ 10225 "name": c.name, 10226 }) 10227 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10228 } 10229 10230 // Do executes the "retail.projects.locations.catalogs.getAttributesConfig" call. 10231 // Any non-2xx status code is an error. Response headers are in either 10232 // *GoogleCloudRetailV2alphaAttributesConfig.ServerResponse.Header or (if a 10233 // response was returned at all) in error.(*googleapi.Error).Header. Use 10234 // googleapi.IsNotModified to check whether the returned error was because 10235 // http.StatusNotModified was returned. 10236 func (c *ProjectsLocationsCatalogsGetAttributesConfigCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2alphaAttributesConfig, error) { 10237 gensupport.SetOptions(c.urlParams_, opts...) 10238 res, err := c.doRequest("json") 10239 if res != nil && res.StatusCode == http.StatusNotModified { 10240 if res.Body != nil { 10241 res.Body.Close() 10242 } 10243 return nil, gensupport.WrapError(&googleapi.Error{ 10244 Code: res.StatusCode, 10245 Header: res.Header, 10246 }) 10247 } 10248 if err != nil { 10249 return nil, err 10250 } 10251 defer googleapi.CloseBody(res) 10252 if err := googleapi.CheckResponse(res); err != nil { 10253 return nil, gensupport.WrapError(err) 10254 } 10255 ret := &GoogleCloudRetailV2alphaAttributesConfig{ 10256 ServerResponse: googleapi.ServerResponse{ 10257 Header: res.Header, 10258 HTTPStatusCode: res.StatusCode, 10259 }, 10260 } 10261 target := &ret 10262 if err := gensupport.DecodeResponse(target, res); err != nil { 10263 return nil, err 10264 } 10265 return ret, nil 10266 } 10267 10268 type ProjectsLocationsCatalogsGetCompletionConfigCall struct { 10269 s *Service 10270 name string 10271 urlParams_ gensupport.URLParams 10272 ifNoneMatch_ string 10273 ctx_ context.Context 10274 header_ http.Header 10275 } 10276 10277 // GetCompletionConfig: Gets a CompletionConfig. 10278 // 10279 // - name: Full CompletionConfig resource name. Format: 10280 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/co 10281 // mpletionConfig`. 10282 func (r *ProjectsLocationsCatalogsService) GetCompletionConfig(name string) *ProjectsLocationsCatalogsGetCompletionConfigCall { 10283 c := &ProjectsLocationsCatalogsGetCompletionConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10284 c.name = name 10285 return c 10286 } 10287 10288 // Fields allows partial responses to be retrieved. See 10289 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 10290 // details. 10291 func (c *ProjectsLocationsCatalogsGetCompletionConfigCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsGetCompletionConfigCall { 10292 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10293 return c 10294 } 10295 10296 // IfNoneMatch sets an optional parameter which makes the operation fail if the 10297 // object's ETag matches the given value. This is useful for getting updates 10298 // only after the object has changed since the last request. 10299 func (c *ProjectsLocationsCatalogsGetCompletionConfigCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsGetCompletionConfigCall { 10300 c.ifNoneMatch_ = entityTag 10301 return c 10302 } 10303 10304 // Context sets the context to be used in this call's Do method. 10305 func (c *ProjectsLocationsCatalogsGetCompletionConfigCall) Context(ctx context.Context) *ProjectsLocationsCatalogsGetCompletionConfigCall { 10306 c.ctx_ = ctx 10307 return c 10308 } 10309 10310 // Header returns a http.Header that can be modified by the caller to add 10311 // headers to the request. 10312 func (c *ProjectsLocationsCatalogsGetCompletionConfigCall) Header() http.Header { 10313 if c.header_ == nil { 10314 c.header_ = make(http.Header) 10315 } 10316 return c.header_ 10317 } 10318 10319 func (c *ProjectsLocationsCatalogsGetCompletionConfigCall) doRequest(alt string) (*http.Response, error) { 10320 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 10321 if c.ifNoneMatch_ != "" { 10322 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 10323 } 10324 var body io.Reader = nil 10325 c.urlParams_.Set("alt", alt) 10326 c.urlParams_.Set("prettyPrint", "false") 10327 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") 10328 urls += "?" + c.urlParams_.Encode() 10329 req, err := http.NewRequest("GET", urls, body) 10330 if err != nil { 10331 return nil, err 10332 } 10333 req.Header = reqHeaders 10334 googleapi.Expand(req.URL, map[string]string{ 10335 "name": c.name, 10336 }) 10337 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10338 } 10339 10340 // Do executes the "retail.projects.locations.catalogs.getCompletionConfig" call. 10341 // Any non-2xx status code is an error. Response headers are in either 10342 // *GoogleCloudRetailV2alphaCompletionConfig.ServerResponse.Header or (if a 10343 // response was returned at all) in error.(*googleapi.Error).Header. Use 10344 // googleapi.IsNotModified to check whether the returned error was because 10345 // http.StatusNotModified was returned. 10346 func (c *ProjectsLocationsCatalogsGetCompletionConfigCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2alphaCompletionConfig, error) { 10347 gensupport.SetOptions(c.urlParams_, opts...) 10348 res, err := c.doRequest("json") 10349 if res != nil && res.StatusCode == http.StatusNotModified { 10350 if res.Body != nil { 10351 res.Body.Close() 10352 } 10353 return nil, gensupport.WrapError(&googleapi.Error{ 10354 Code: res.StatusCode, 10355 Header: res.Header, 10356 }) 10357 } 10358 if err != nil { 10359 return nil, err 10360 } 10361 defer googleapi.CloseBody(res) 10362 if err := googleapi.CheckResponse(res); err != nil { 10363 return nil, gensupport.WrapError(err) 10364 } 10365 ret := &GoogleCloudRetailV2alphaCompletionConfig{ 10366 ServerResponse: googleapi.ServerResponse{ 10367 Header: res.Header, 10368 HTTPStatusCode: res.StatusCode, 10369 }, 10370 } 10371 target := &ret 10372 if err := gensupport.DecodeResponse(target, res); err != nil { 10373 return nil, err 10374 } 10375 return ret, nil 10376 } 10377 10378 type ProjectsLocationsCatalogsGetDefaultBranchCall struct { 10379 s *Service 10380 catalog string 10381 urlParams_ gensupport.URLParams 10382 ifNoneMatch_ string 10383 ctx_ context.Context 10384 header_ http.Header 10385 } 10386 10387 // GetDefaultBranch: Get which branch is currently default branch set by 10388 // CatalogService.SetDefaultBranch method under a specified parent catalog. 10389 // 10390 // - catalog: The parent catalog resource name, such as 10391 // `projects/*/locations/global/catalogs/default_catalog`. 10392 func (r *ProjectsLocationsCatalogsService) GetDefaultBranch(catalog string) *ProjectsLocationsCatalogsGetDefaultBranchCall { 10393 c := &ProjectsLocationsCatalogsGetDefaultBranchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10394 c.catalog = catalog 10395 return c 10396 } 10397 10398 // Fields allows partial responses to be retrieved. See 10399 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 10400 // details. 10401 func (c *ProjectsLocationsCatalogsGetDefaultBranchCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsGetDefaultBranchCall { 10402 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10403 return c 10404 } 10405 10406 // IfNoneMatch sets an optional parameter which makes the operation fail if the 10407 // object's ETag matches the given value. This is useful for getting updates 10408 // only after the object has changed since the last request. 10409 func (c *ProjectsLocationsCatalogsGetDefaultBranchCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsGetDefaultBranchCall { 10410 c.ifNoneMatch_ = entityTag 10411 return c 10412 } 10413 10414 // Context sets the context to be used in this call's Do method. 10415 func (c *ProjectsLocationsCatalogsGetDefaultBranchCall) Context(ctx context.Context) *ProjectsLocationsCatalogsGetDefaultBranchCall { 10416 c.ctx_ = ctx 10417 return c 10418 } 10419 10420 // Header returns a http.Header that can be modified by the caller to add 10421 // headers to the request. 10422 func (c *ProjectsLocationsCatalogsGetDefaultBranchCall) Header() http.Header { 10423 if c.header_ == nil { 10424 c.header_ = make(http.Header) 10425 } 10426 return c.header_ 10427 } 10428 10429 func (c *ProjectsLocationsCatalogsGetDefaultBranchCall) doRequest(alt string) (*http.Response, error) { 10430 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 10431 if c.ifNoneMatch_ != "" { 10432 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 10433 } 10434 var body io.Reader = nil 10435 c.urlParams_.Set("alt", alt) 10436 c.urlParams_.Set("prettyPrint", "false") 10437 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+catalog}:getDefaultBranch") 10438 urls += "?" + c.urlParams_.Encode() 10439 req, err := http.NewRequest("GET", urls, body) 10440 if err != nil { 10441 return nil, err 10442 } 10443 req.Header = reqHeaders 10444 googleapi.Expand(req.URL, map[string]string{ 10445 "catalog": c.catalog, 10446 }) 10447 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10448 } 10449 10450 // Do executes the "retail.projects.locations.catalogs.getDefaultBranch" call. 10451 // Any non-2xx status code is an error. Response headers are in either 10452 // *GoogleCloudRetailV2alphaGetDefaultBranchResponse.ServerResponse.Header or 10453 // (if a response was returned at all) in error.(*googleapi.Error).Header. Use 10454 // googleapi.IsNotModified to check whether the returned error was because 10455 // http.StatusNotModified was returned. 10456 func (c *ProjectsLocationsCatalogsGetDefaultBranchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2alphaGetDefaultBranchResponse, error) { 10457 gensupport.SetOptions(c.urlParams_, opts...) 10458 res, err := c.doRequest("json") 10459 if res != nil && res.StatusCode == http.StatusNotModified { 10460 if res.Body != nil { 10461 res.Body.Close() 10462 } 10463 return nil, gensupport.WrapError(&googleapi.Error{ 10464 Code: res.StatusCode, 10465 Header: res.Header, 10466 }) 10467 } 10468 if err != nil { 10469 return nil, err 10470 } 10471 defer googleapi.CloseBody(res) 10472 if err := googleapi.CheckResponse(res); err != nil { 10473 return nil, gensupport.WrapError(err) 10474 } 10475 ret := &GoogleCloudRetailV2alphaGetDefaultBranchResponse{ 10476 ServerResponse: googleapi.ServerResponse{ 10477 Header: res.Header, 10478 HTTPStatusCode: res.StatusCode, 10479 }, 10480 } 10481 target := &ret 10482 if err := gensupport.DecodeResponse(target, res); err != nil { 10483 return nil, err 10484 } 10485 return ret, nil 10486 } 10487 10488 type ProjectsLocationsCatalogsListCall struct { 10489 s *Service 10490 parent string 10491 urlParams_ gensupport.URLParams 10492 ifNoneMatch_ string 10493 ctx_ context.Context 10494 header_ http.Header 10495 } 10496 10497 // List: Lists all the Catalogs associated with the project. 10498 // 10499 // - parent: The account resource name with an associated location. If the 10500 // caller does not have permission to list Catalogs under this location, 10501 // regardless of whether or not this location exists, a PERMISSION_DENIED 10502 // error is returned. 10503 func (r *ProjectsLocationsCatalogsService) List(parent string) *ProjectsLocationsCatalogsListCall { 10504 c := &ProjectsLocationsCatalogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10505 c.parent = parent 10506 return c 10507 } 10508 10509 // PageSize sets the optional parameter "pageSize": Maximum number of Catalogs 10510 // to return. If unspecified, defaults to 50. The maximum allowed value is 10511 // 1000. Values above 1000 will be coerced to 1000. If this field is negative, 10512 // an INVALID_ARGUMENT is returned. 10513 func (c *ProjectsLocationsCatalogsListCall) PageSize(pageSize int64) *ProjectsLocationsCatalogsListCall { 10514 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 10515 return c 10516 } 10517 10518 // PageToken sets the optional parameter "pageToken": A page token 10519 // ListCatalogsResponse.next_page_token, received from a previous 10520 // CatalogService.ListCatalogs call. Provide this to retrieve the subsequent 10521 // page. When paginating, all other parameters provided to 10522 // CatalogService.ListCatalogs must match the call that provided the page 10523 // token. Otherwise, an INVALID_ARGUMENT error is returned. 10524 func (c *ProjectsLocationsCatalogsListCall) PageToken(pageToken string) *ProjectsLocationsCatalogsListCall { 10525 c.urlParams_.Set("pageToken", pageToken) 10526 return c 10527 } 10528 10529 // Fields allows partial responses to be retrieved. See 10530 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 10531 // details. 10532 func (c *ProjectsLocationsCatalogsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsListCall { 10533 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10534 return c 10535 } 10536 10537 // IfNoneMatch sets an optional parameter which makes the operation fail if the 10538 // object's ETag matches the given value. This is useful for getting updates 10539 // only after the object has changed since the last request. 10540 func (c *ProjectsLocationsCatalogsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsListCall { 10541 c.ifNoneMatch_ = entityTag 10542 return c 10543 } 10544 10545 // Context sets the context to be used in this call's Do method. 10546 func (c *ProjectsLocationsCatalogsListCall) Context(ctx context.Context) *ProjectsLocationsCatalogsListCall { 10547 c.ctx_ = ctx 10548 return c 10549 } 10550 10551 // Header returns a http.Header that can be modified by the caller to add 10552 // headers to the request. 10553 func (c *ProjectsLocationsCatalogsListCall) Header() http.Header { 10554 if c.header_ == nil { 10555 c.header_ = make(http.Header) 10556 } 10557 return c.header_ 10558 } 10559 10560 func (c *ProjectsLocationsCatalogsListCall) doRequest(alt string) (*http.Response, error) { 10561 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 10562 if c.ifNoneMatch_ != "" { 10563 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 10564 } 10565 var body io.Reader = nil 10566 c.urlParams_.Set("alt", alt) 10567 c.urlParams_.Set("prettyPrint", "false") 10568 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+parent}/catalogs") 10569 urls += "?" + c.urlParams_.Encode() 10570 req, err := http.NewRequest("GET", urls, body) 10571 if err != nil { 10572 return nil, err 10573 } 10574 req.Header = reqHeaders 10575 googleapi.Expand(req.URL, map[string]string{ 10576 "parent": c.parent, 10577 }) 10578 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10579 } 10580 10581 // Do executes the "retail.projects.locations.catalogs.list" call. 10582 // Any non-2xx status code is an error. Response headers are in either 10583 // *GoogleCloudRetailV2alphaListCatalogsResponse.ServerResponse.Header or (if a 10584 // response was returned at all) in error.(*googleapi.Error).Header. Use 10585 // googleapi.IsNotModified to check whether the returned error was because 10586 // http.StatusNotModified was returned. 10587 func (c *ProjectsLocationsCatalogsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2alphaListCatalogsResponse, error) { 10588 gensupport.SetOptions(c.urlParams_, opts...) 10589 res, err := c.doRequest("json") 10590 if res != nil && res.StatusCode == http.StatusNotModified { 10591 if res.Body != nil { 10592 res.Body.Close() 10593 } 10594 return nil, gensupport.WrapError(&googleapi.Error{ 10595 Code: res.StatusCode, 10596 Header: res.Header, 10597 }) 10598 } 10599 if err != nil { 10600 return nil, err 10601 } 10602 defer googleapi.CloseBody(res) 10603 if err := googleapi.CheckResponse(res); err != nil { 10604 return nil, gensupport.WrapError(err) 10605 } 10606 ret := &GoogleCloudRetailV2alphaListCatalogsResponse{ 10607 ServerResponse: googleapi.ServerResponse{ 10608 Header: res.Header, 10609 HTTPStatusCode: res.StatusCode, 10610 }, 10611 } 10612 target := &ret 10613 if err := gensupport.DecodeResponse(target, res); err != nil { 10614 return nil, err 10615 } 10616 return ret, nil 10617 } 10618 10619 // Pages invokes f for each page of results. 10620 // A non-nil error returned from f will halt the iteration. 10621 // The provided context supersedes any context provided to the Context method. 10622 func (c *ProjectsLocationsCatalogsListCall) Pages(ctx context.Context, f func(*GoogleCloudRetailV2alphaListCatalogsResponse) error) error { 10623 c.ctx_ = ctx 10624 defer c.PageToken(c.urlParams_.Get("pageToken")) 10625 for { 10626 x, err := c.Do() 10627 if err != nil { 10628 return err 10629 } 10630 if err := f(x); err != nil { 10631 return err 10632 } 10633 if x.NextPageToken == "" { 10634 return nil 10635 } 10636 c.PageToken(x.NextPageToken) 10637 } 10638 } 10639 10640 type ProjectsLocationsCatalogsPatchCall struct { 10641 s *Service 10642 name string 10643 googlecloudretailv2alphacatalog *GoogleCloudRetailV2alphaCatalog 10644 urlParams_ gensupport.URLParams 10645 ctx_ context.Context 10646 header_ http.Header 10647 } 10648 10649 // Patch: Updates the Catalogs. 10650 // 10651 // - name: Immutable. The fully qualified resource name of the catalog. 10652 func (r *ProjectsLocationsCatalogsService) Patch(name string, googlecloudretailv2alphacatalog *GoogleCloudRetailV2alphaCatalog) *ProjectsLocationsCatalogsPatchCall { 10653 c := &ProjectsLocationsCatalogsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10654 c.name = name 10655 c.googlecloudretailv2alphacatalog = googlecloudretailv2alphacatalog 10656 return c 10657 } 10658 10659 // UpdateMask sets the optional parameter "updateMask": Indicates which fields 10660 // in the provided Catalog to update. If an unsupported or unknown field is 10661 // provided, an INVALID_ARGUMENT error is returned. 10662 func (c *ProjectsLocationsCatalogsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsCatalogsPatchCall { 10663 c.urlParams_.Set("updateMask", updateMask) 10664 return c 10665 } 10666 10667 // Fields allows partial responses to be retrieved. See 10668 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 10669 // details. 10670 func (c *ProjectsLocationsCatalogsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsPatchCall { 10671 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10672 return c 10673 } 10674 10675 // Context sets the context to be used in this call's Do method. 10676 func (c *ProjectsLocationsCatalogsPatchCall) Context(ctx context.Context) *ProjectsLocationsCatalogsPatchCall { 10677 c.ctx_ = ctx 10678 return c 10679 } 10680 10681 // Header returns a http.Header that can be modified by the caller to add 10682 // headers to the request. 10683 func (c *ProjectsLocationsCatalogsPatchCall) Header() http.Header { 10684 if c.header_ == nil { 10685 c.header_ = make(http.Header) 10686 } 10687 return c.header_ 10688 } 10689 10690 func (c *ProjectsLocationsCatalogsPatchCall) doRequest(alt string) (*http.Response, error) { 10691 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 10692 var body io.Reader = nil 10693 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphacatalog) 10694 if err != nil { 10695 return nil, err 10696 } 10697 c.urlParams_.Set("alt", alt) 10698 c.urlParams_.Set("prettyPrint", "false") 10699 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") 10700 urls += "?" + c.urlParams_.Encode() 10701 req, err := http.NewRequest("PATCH", urls, body) 10702 if err != nil { 10703 return nil, err 10704 } 10705 req.Header = reqHeaders 10706 googleapi.Expand(req.URL, map[string]string{ 10707 "name": c.name, 10708 }) 10709 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10710 } 10711 10712 // Do executes the "retail.projects.locations.catalogs.patch" call. 10713 // Any non-2xx status code is an error. Response headers are in either 10714 // *GoogleCloudRetailV2alphaCatalog.ServerResponse.Header or (if a response was 10715 // returned at all) in error.(*googleapi.Error).Header. Use 10716 // googleapi.IsNotModified to check whether the returned error was because 10717 // http.StatusNotModified was returned. 10718 func (c *ProjectsLocationsCatalogsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2alphaCatalog, error) { 10719 gensupport.SetOptions(c.urlParams_, opts...) 10720 res, err := c.doRequest("json") 10721 if res != nil && res.StatusCode == http.StatusNotModified { 10722 if res.Body != nil { 10723 res.Body.Close() 10724 } 10725 return nil, gensupport.WrapError(&googleapi.Error{ 10726 Code: res.StatusCode, 10727 Header: res.Header, 10728 }) 10729 } 10730 if err != nil { 10731 return nil, err 10732 } 10733 defer googleapi.CloseBody(res) 10734 if err := googleapi.CheckResponse(res); err != nil { 10735 return nil, gensupport.WrapError(err) 10736 } 10737 ret := &GoogleCloudRetailV2alphaCatalog{ 10738 ServerResponse: googleapi.ServerResponse{ 10739 Header: res.Header, 10740 HTTPStatusCode: res.StatusCode, 10741 }, 10742 } 10743 target := &ret 10744 if err := gensupport.DecodeResponse(target, res); err != nil { 10745 return nil, err 10746 } 10747 return ret, nil 10748 } 10749 10750 type ProjectsLocationsCatalogsSetDefaultBranchCall struct { 10751 s *Service 10752 catalog string 10753 googlecloudretailv2alphasetdefaultbranchrequest *GoogleCloudRetailV2alphaSetDefaultBranchRequest 10754 urlParams_ gensupport.URLParams 10755 ctx_ context.Context 10756 header_ http.Header 10757 } 10758 10759 // SetDefaultBranch: Set a specified branch id as default branch. API methods 10760 // such as SearchService.Search, ProductService.GetProduct, 10761 // ProductService.ListProducts will treat requests using "default_branch" to 10762 // the actual branch id set as default. For example, if 10763 // `projects/*/locations/*/catalogs/*/branches/1` is set as default, setting 10764 // SearchRequest.branch to 10765 // `projects/*/locations/*/catalogs/*/branches/default_branch` is equivalent to 10766 // setting SearchRequest.branch to 10767 // `projects/*/locations/*/catalogs/*/branches/1`. Using multiple branches can 10768 // be useful when developers would like to have a staging branch to test and 10769 // verify for future usage. When it becomes ready, developers switch on the 10770 // staging branch using this API while keeping using 10771 // `projects/*/locations/*/catalogs/*/branches/default_branch` as 10772 // SearchRequest.branch to route the traffic to this staging branch. CAUTION: 10773 // If you have live predict/search traffic, switching the default branch could 10774 // potentially cause outages if the ID space of the new branch is very 10775 // different from the old one. More specifically: * PredictionService will only 10776 // return product IDs from branch {newBranch}. * SearchService will only return 10777 // product IDs from branch {newBranch} (if branch is not explicitly set). * 10778 // UserEventService will only join events with products from branch 10779 // {newBranch}. 10780 // 10781 // - catalog: Full resource name of the catalog, such as 10782 // `projects/*/locations/global/catalogs/default_catalog`. 10783 func (r *ProjectsLocationsCatalogsService) SetDefaultBranch(catalog string, googlecloudretailv2alphasetdefaultbranchrequest *GoogleCloudRetailV2alphaSetDefaultBranchRequest) *ProjectsLocationsCatalogsSetDefaultBranchCall { 10784 c := &ProjectsLocationsCatalogsSetDefaultBranchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10785 c.catalog = catalog 10786 c.googlecloudretailv2alphasetdefaultbranchrequest = googlecloudretailv2alphasetdefaultbranchrequest 10787 return c 10788 } 10789 10790 // Fields allows partial responses to be retrieved. See 10791 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 10792 // details. 10793 func (c *ProjectsLocationsCatalogsSetDefaultBranchCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsSetDefaultBranchCall { 10794 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10795 return c 10796 } 10797 10798 // Context sets the context to be used in this call's Do method. 10799 func (c *ProjectsLocationsCatalogsSetDefaultBranchCall) Context(ctx context.Context) *ProjectsLocationsCatalogsSetDefaultBranchCall { 10800 c.ctx_ = ctx 10801 return c 10802 } 10803 10804 // Header returns a http.Header that can be modified by the caller to add 10805 // headers to the request. 10806 func (c *ProjectsLocationsCatalogsSetDefaultBranchCall) Header() http.Header { 10807 if c.header_ == nil { 10808 c.header_ = make(http.Header) 10809 } 10810 return c.header_ 10811 } 10812 10813 func (c *ProjectsLocationsCatalogsSetDefaultBranchCall) doRequest(alt string) (*http.Response, error) { 10814 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 10815 var body io.Reader = nil 10816 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphasetdefaultbranchrequest) 10817 if err != nil { 10818 return nil, err 10819 } 10820 c.urlParams_.Set("alt", alt) 10821 c.urlParams_.Set("prettyPrint", "false") 10822 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+catalog}:setDefaultBranch") 10823 urls += "?" + c.urlParams_.Encode() 10824 req, err := http.NewRequest("POST", urls, body) 10825 if err != nil { 10826 return nil, err 10827 } 10828 req.Header = reqHeaders 10829 googleapi.Expand(req.URL, map[string]string{ 10830 "catalog": c.catalog, 10831 }) 10832 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10833 } 10834 10835 // Do executes the "retail.projects.locations.catalogs.setDefaultBranch" call. 10836 // Any non-2xx status code is an error. Response headers are in either 10837 // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at 10838 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 10839 // check whether the returned error was because http.StatusNotModified was 10840 // returned. 10841 func (c *ProjectsLocationsCatalogsSetDefaultBranchCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { 10842 gensupport.SetOptions(c.urlParams_, opts...) 10843 res, err := c.doRequest("json") 10844 if res != nil && res.StatusCode == http.StatusNotModified { 10845 if res.Body != nil { 10846 res.Body.Close() 10847 } 10848 return nil, gensupport.WrapError(&googleapi.Error{ 10849 Code: res.StatusCode, 10850 Header: res.Header, 10851 }) 10852 } 10853 if err != nil { 10854 return nil, err 10855 } 10856 defer googleapi.CloseBody(res) 10857 if err := googleapi.CheckResponse(res); err != nil { 10858 return nil, gensupport.WrapError(err) 10859 } 10860 ret := &GoogleProtobufEmpty{ 10861 ServerResponse: googleapi.ServerResponse{ 10862 Header: res.Header, 10863 HTTPStatusCode: res.StatusCode, 10864 }, 10865 } 10866 target := &ret 10867 if err := gensupport.DecodeResponse(target, res); err != nil { 10868 return nil, err 10869 } 10870 return ret, nil 10871 } 10872 10873 type ProjectsLocationsCatalogsUpdateAttributesConfigCall struct { 10874 s *Service 10875 name string 10876 googlecloudretailv2alphaattributesconfig *GoogleCloudRetailV2alphaAttributesConfig 10877 urlParams_ gensupport.URLParams 10878 ctx_ context.Context 10879 header_ http.Header 10880 } 10881 10882 // UpdateAttributesConfig: Updates the AttributesConfig. The catalog attributes 10883 // in the request will be updated in the catalog, or inserted if they do not 10884 // exist. Existing catalog attributes not included in the request will remain 10885 // unchanged. Attributes that are assigned to products, but do not exist at the 10886 // catalog level, are always included in the response. The product attribute is 10887 // assigned default values for missing catalog attribute fields, e.g., 10888 // searchable and dynamic facetable options. 10889 // 10890 // - name: Immutable. The fully qualified resource name of the attribute 10891 // config. Format: `projects/*/locations/*/catalogs/*/attributesConfig`. 10892 func (r *ProjectsLocationsCatalogsService) UpdateAttributesConfig(name string, googlecloudretailv2alphaattributesconfig *GoogleCloudRetailV2alphaAttributesConfig) *ProjectsLocationsCatalogsUpdateAttributesConfigCall { 10893 c := &ProjectsLocationsCatalogsUpdateAttributesConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10894 c.name = name 10895 c.googlecloudretailv2alphaattributesconfig = googlecloudretailv2alphaattributesconfig 10896 return c 10897 } 10898 10899 // UpdateMask sets the optional parameter "updateMask": Indicates which fields 10900 // in the provided AttributesConfig to update. The following is the only 10901 // supported field: * AttributesConfig.catalog_attributes If not set, all 10902 // supported fields are updated. 10903 func (c *ProjectsLocationsCatalogsUpdateAttributesConfigCall) UpdateMask(updateMask string) *ProjectsLocationsCatalogsUpdateAttributesConfigCall { 10904 c.urlParams_.Set("updateMask", updateMask) 10905 return c 10906 } 10907 10908 // Fields allows partial responses to be retrieved. See 10909 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 10910 // details. 10911 func (c *ProjectsLocationsCatalogsUpdateAttributesConfigCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsUpdateAttributesConfigCall { 10912 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10913 return c 10914 } 10915 10916 // Context sets the context to be used in this call's Do method. 10917 func (c *ProjectsLocationsCatalogsUpdateAttributesConfigCall) Context(ctx context.Context) *ProjectsLocationsCatalogsUpdateAttributesConfigCall { 10918 c.ctx_ = ctx 10919 return c 10920 } 10921 10922 // Header returns a http.Header that can be modified by the caller to add 10923 // headers to the request. 10924 func (c *ProjectsLocationsCatalogsUpdateAttributesConfigCall) Header() http.Header { 10925 if c.header_ == nil { 10926 c.header_ = make(http.Header) 10927 } 10928 return c.header_ 10929 } 10930 10931 func (c *ProjectsLocationsCatalogsUpdateAttributesConfigCall) doRequest(alt string) (*http.Response, error) { 10932 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 10933 var body io.Reader = nil 10934 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphaattributesconfig) 10935 if err != nil { 10936 return nil, err 10937 } 10938 c.urlParams_.Set("alt", alt) 10939 c.urlParams_.Set("prettyPrint", "false") 10940 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") 10941 urls += "?" + c.urlParams_.Encode() 10942 req, err := http.NewRequest("PATCH", urls, body) 10943 if err != nil { 10944 return nil, err 10945 } 10946 req.Header = reqHeaders 10947 googleapi.Expand(req.URL, map[string]string{ 10948 "name": c.name, 10949 }) 10950 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10951 } 10952 10953 // Do executes the "retail.projects.locations.catalogs.updateAttributesConfig" call. 10954 // Any non-2xx status code is an error. Response headers are in either 10955 // *GoogleCloudRetailV2alphaAttributesConfig.ServerResponse.Header or (if a 10956 // response was returned at all) in error.(*googleapi.Error).Header. Use 10957 // googleapi.IsNotModified to check whether the returned error was because 10958 // http.StatusNotModified was returned. 10959 func (c *ProjectsLocationsCatalogsUpdateAttributesConfigCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2alphaAttributesConfig, error) { 10960 gensupport.SetOptions(c.urlParams_, opts...) 10961 res, err := c.doRequest("json") 10962 if res != nil && res.StatusCode == http.StatusNotModified { 10963 if res.Body != nil { 10964 res.Body.Close() 10965 } 10966 return nil, gensupport.WrapError(&googleapi.Error{ 10967 Code: res.StatusCode, 10968 Header: res.Header, 10969 }) 10970 } 10971 if err != nil { 10972 return nil, err 10973 } 10974 defer googleapi.CloseBody(res) 10975 if err := googleapi.CheckResponse(res); err != nil { 10976 return nil, gensupport.WrapError(err) 10977 } 10978 ret := &GoogleCloudRetailV2alphaAttributesConfig{ 10979 ServerResponse: googleapi.ServerResponse{ 10980 Header: res.Header, 10981 HTTPStatusCode: res.StatusCode, 10982 }, 10983 } 10984 target := &ret 10985 if err := gensupport.DecodeResponse(target, res); err != nil { 10986 return nil, err 10987 } 10988 return ret, nil 10989 } 10990 10991 type ProjectsLocationsCatalogsUpdateCompletionConfigCall struct { 10992 s *Service 10993 name string 10994 googlecloudretailv2alphacompletionconfig *GoogleCloudRetailV2alphaCompletionConfig 10995 urlParams_ gensupport.URLParams 10996 ctx_ context.Context 10997 header_ http.Header 10998 } 10999 11000 // UpdateCompletionConfig: Updates the CompletionConfigs. 11001 // 11002 // - name: Immutable. Fully qualified name 11003 // `projects/*/locations/*/catalogs/*/completionConfig`. 11004 func (r *ProjectsLocationsCatalogsService) UpdateCompletionConfig(name string, googlecloudretailv2alphacompletionconfig *GoogleCloudRetailV2alphaCompletionConfig) *ProjectsLocationsCatalogsUpdateCompletionConfigCall { 11005 c := &ProjectsLocationsCatalogsUpdateCompletionConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11006 c.name = name 11007 c.googlecloudretailv2alphacompletionconfig = googlecloudretailv2alphacompletionconfig 11008 return c 11009 } 11010 11011 // UpdateMask sets the optional parameter "updateMask": Indicates which fields 11012 // in the provided CompletionConfig to update. The following are the only 11013 // supported fields: * CompletionConfig.matching_order * 11014 // CompletionConfig.max_suggestions * CompletionConfig.min_prefix_length * 11015 // CompletionConfig.auto_learning If not set, all supported fields are updated. 11016 func (c *ProjectsLocationsCatalogsUpdateCompletionConfigCall) UpdateMask(updateMask string) *ProjectsLocationsCatalogsUpdateCompletionConfigCall { 11017 c.urlParams_.Set("updateMask", updateMask) 11018 return c 11019 } 11020 11021 // Fields allows partial responses to be retrieved. See 11022 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 11023 // details. 11024 func (c *ProjectsLocationsCatalogsUpdateCompletionConfigCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsUpdateCompletionConfigCall { 11025 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11026 return c 11027 } 11028 11029 // Context sets the context to be used in this call's Do method. 11030 func (c *ProjectsLocationsCatalogsUpdateCompletionConfigCall) Context(ctx context.Context) *ProjectsLocationsCatalogsUpdateCompletionConfigCall { 11031 c.ctx_ = ctx 11032 return c 11033 } 11034 11035 // Header returns a http.Header that can be modified by the caller to add 11036 // headers to the request. 11037 func (c *ProjectsLocationsCatalogsUpdateCompletionConfigCall) Header() http.Header { 11038 if c.header_ == nil { 11039 c.header_ = make(http.Header) 11040 } 11041 return c.header_ 11042 } 11043 11044 func (c *ProjectsLocationsCatalogsUpdateCompletionConfigCall) doRequest(alt string) (*http.Response, error) { 11045 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 11046 var body io.Reader = nil 11047 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphacompletionconfig) 11048 if err != nil { 11049 return nil, err 11050 } 11051 c.urlParams_.Set("alt", alt) 11052 c.urlParams_.Set("prettyPrint", "false") 11053 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") 11054 urls += "?" + c.urlParams_.Encode() 11055 req, err := http.NewRequest("PATCH", urls, body) 11056 if err != nil { 11057 return nil, err 11058 } 11059 req.Header = reqHeaders 11060 googleapi.Expand(req.URL, map[string]string{ 11061 "name": c.name, 11062 }) 11063 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11064 } 11065 11066 // Do executes the "retail.projects.locations.catalogs.updateCompletionConfig" call. 11067 // Any non-2xx status code is an error. Response headers are in either 11068 // *GoogleCloudRetailV2alphaCompletionConfig.ServerResponse.Header or (if a 11069 // response was returned at all) in error.(*googleapi.Error).Header. Use 11070 // googleapi.IsNotModified to check whether the returned error was because 11071 // http.StatusNotModified was returned. 11072 func (c *ProjectsLocationsCatalogsUpdateCompletionConfigCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2alphaCompletionConfig, error) { 11073 gensupport.SetOptions(c.urlParams_, opts...) 11074 res, err := c.doRequest("json") 11075 if res != nil && res.StatusCode == http.StatusNotModified { 11076 if res.Body != nil { 11077 res.Body.Close() 11078 } 11079 return nil, gensupport.WrapError(&googleapi.Error{ 11080 Code: res.StatusCode, 11081 Header: res.Header, 11082 }) 11083 } 11084 if err != nil { 11085 return nil, err 11086 } 11087 defer googleapi.CloseBody(res) 11088 if err := googleapi.CheckResponse(res); err != nil { 11089 return nil, gensupport.WrapError(err) 11090 } 11091 ret := &GoogleCloudRetailV2alphaCompletionConfig{ 11092 ServerResponse: googleapi.ServerResponse{ 11093 Header: res.Header, 11094 HTTPStatusCode: res.StatusCode, 11095 }, 11096 } 11097 target := &ret 11098 if err := gensupport.DecodeResponse(target, res); err != nil { 11099 return nil, err 11100 } 11101 return ret, nil 11102 } 11103 11104 type ProjectsLocationsCatalogsAttributesConfigAddCatalogAttributeCall struct { 11105 s *Service 11106 attributesConfig string 11107 googlecloudretailv2alphaaddcatalogattributerequest *GoogleCloudRetailV2alphaAddCatalogAttributeRequest 11108 urlParams_ gensupport.URLParams 11109 ctx_ context.Context 11110 header_ http.Header 11111 } 11112 11113 // AddCatalogAttribute: Adds the specified CatalogAttribute to the 11114 // AttributesConfig. If the CatalogAttribute to add already exists, an 11115 // ALREADY_EXISTS error is returned. 11116 // 11117 // - attributesConfig: Full AttributesConfig resource name. Format: 11118 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/at 11119 // tributesConfig`. 11120 func (r *ProjectsLocationsCatalogsAttributesConfigService) AddCatalogAttribute(attributesConfig string, googlecloudretailv2alphaaddcatalogattributerequest *GoogleCloudRetailV2alphaAddCatalogAttributeRequest) *ProjectsLocationsCatalogsAttributesConfigAddCatalogAttributeCall { 11121 c := &ProjectsLocationsCatalogsAttributesConfigAddCatalogAttributeCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11122 c.attributesConfig = attributesConfig 11123 c.googlecloudretailv2alphaaddcatalogattributerequest = googlecloudretailv2alphaaddcatalogattributerequest 11124 return c 11125 } 11126 11127 // Fields allows partial responses to be retrieved. See 11128 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 11129 // details. 11130 func (c *ProjectsLocationsCatalogsAttributesConfigAddCatalogAttributeCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsAttributesConfigAddCatalogAttributeCall { 11131 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11132 return c 11133 } 11134 11135 // Context sets the context to be used in this call's Do method. 11136 func (c *ProjectsLocationsCatalogsAttributesConfigAddCatalogAttributeCall) Context(ctx context.Context) *ProjectsLocationsCatalogsAttributesConfigAddCatalogAttributeCall { 11137 c.ctx_ = ctx 11138 return c 11139 } 11140 11141 // Header returns a http.Header that can be modified by the caller to add 11142 // headers to the request. 11143 func (c *ProjectsLocationsCatalogsAttributesConfigAddCatalogAttributeCall) Header() http.Header { 11144 if c.header_ == nil { 11145 c.header_ = make(http.Header) 11146 } 11147 return c.header_ 11148 } 11149 11150 func (c *ProjectsLocationsCatalogsAttributesConfigAddCatalogAttributeCall) doRequest(alt string) (*http.Response, error) { 11151 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 11152 var body io.Reader = nil 11153 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphaaddcatalogattributerequest) 11154 if err != nil { 11155 return nil, err 11156 } 11157 c.urlParams_.Set("alt", alt) 11158 c.urlParams_.Set("prettyPrint", "false") 11159 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+attributesConfig}:addCatalogAttribute") 11160 urls += "?" + c.urlParams_.Encode() 11161 req, err := http.NewRequest("POST", urls, body) 11162 if err != nil { 11163 return nil, err 11164 } 11165 req.Header = reqHeaders 11166 googleapi.Expand(req.URL, map[string]string{ 11167 "attributesConfig": c.attributesConfig, 11168 }) 11169 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11170 } 11171 11172 // Do executes the "retail.projects.locations.catalogs.attributesConfig.addCatalogAttribute" call. 11173 // Any non-2xx status code is an error. Response headers are in either 11174 // *GoogleCloudRetailV2alphaAttributesConfig.ServerResponse.Header or (if a 11175 // response was returned at all) in error.(*googleapi.Error).Header. Use 11176 // googleapi.IsNotModified to check whether the returned error was because 11177 // http.StatusNotModified was returned. 11178 func (c *ProjectsLocationsCatalogsAttributesConfigAddCatalogAttributeCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2alphaAttributesConfig, error) { 11179 gensupport.SetOptions(c.urlParams_, opts...) 11180 res, err := c.doRequest("json") 11181 if res != nil && res.StatusCode == http.StatusNotModified { 11182 if res.Body != nil { 11183 res.Body.Close() 11184 } 11185 return nil, gensupport.WrapError(&googleapi.Error{ 11186 Code: res.StatusCode, 11187 Header: res.Header, 11188 }) 11189 } 11190 if err != nil { 11191 return nil, err 11192 } 11193 defer googleapi.CloseBody(res) 11194 if err := googleapi.CheckResponse(res); err != nil { 11195 return nil, gensupport.WrapError(err) 11196 } 11197 ret := &GoogleCloudRetailV2alphaAttributesConfig{ 11198 ServerResponse: googleapi.ServerResponse{ 11199 Header: res.Header, 11200 HTTPStatusCode: res.StatusCode, 11201 }, 11202 } 11203 target := &ret 11204 if err := gensupport.DecodeResponse(target, res); err != nil { 11205 return nil, err 11206 } 11207 return ret, nil 11208 } 11209 11210 type ProjectsLocationsCatalogsAttributesConfigBatchRemoveCatalogAttributesCall struct { 11211 s *Service 11212 attributesConfig string 11213 googlecloudretailv2alphabatchremovecatalogattributesrequest *GoogleCloudRetailV2alphaBatchRemoveCatalogAttributesRequest 11214 urlParams_ gensupport.URLParams 11215 ctx_ context.Context 11216 header_ http.Header 11217 } 11218 11219 // BatchRemoveCatalogAttributes: Removes all specified CatalogAttributes from 11220 // the AttributesConfig. 11221 // 11222 // - attributesConfig: The attributes config resource shared by all catalog 11223 // attributes being deleted. Format: 11224 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/at 11225 // tributesConfig`. 11226 func (r *ProjectsLocationsCatalogsAttributesConfigService) BatchRemoveCatalogAttributes(attributesConfig string, googlecloudretailv2alphabatchremovecatalogattributesrequest *GoogleCloudRetailV2alphaBatchRemoveCatalogAttributesRequest) *ProjectsLocationsCatalogsAttributesConfigBatchRemoveCatalogAttributesCall { 11227 c := &ProjectsLocationsCatalogsAttributesConfigBatchRemoveCatalogAttributesCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11228 c.attributesConfig = attributesConfig 11229 c.googlecloudretailv2alphabatchremovecatalogattributesrequest = googlecloudretailv2alphabatchremovecatalogattributesrequest 11230 return c 11231 } 11232 11233 // Fields allows partial responses to be retrieved. See 11234 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 11235 // details. 11236 func (c *ProjectsLocationsCatalogsAttributesConfigBatchRemoveCatalogAttributesCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsAttributesConfigBatchRemoveCatalogAttributesCall { 11237 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11238 return c 11239 } 11240 11241 // Context sets the context to be used in this call's Do method. 11242 func (c *ProjectsLocationsCatalogsAttributesConfigBatchRemoveCatalogAttributesCall) Context(ctx context.Context) *ProjectsLocationsCatalogsAttributesConfigBatchRemoveCatalogAttributesCall { 11243 c.ctx_ = ctx 11244 return c 11245 } 11246 11247 // Header returns a http.Header that can be modified by the caller to add 11248 // headers to the request. 11249 func (c *ProjectsLocationsCatalogsAttributesConfigBatchRemoveCatalogAttributesCall) Header() http.Header { 11250 if c.header_ == nil { 11251 c.header_ = make(http.Header) 11252 } 11253 return c.header_ 11254 } 11255 11256 func (c *ProjectsLocationsCatalogsAttributesConfigBatchRemoveCatalogAttributesCall) doRequest(alt string) (*http.Response, error) { 11257 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 11258 var body io.Reader = nil 11259 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphabatchremovecatalogattributesrequest) 11260 if err != nil { 11261 return nil, err 11262 } 11263 c.urlParams_.Set("alt", alt) 11264 c.urlParams_.Set("prettyPrint", "false") 11265 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+attributesConfig}:batchRemoveCatalogAttributes") 11266 urls += "?" + c.urlParams_.Encode() 11267 req, err := http.NewRequest("POST", urls, body) 11268 if err != nil { 11269 return nil, err 11270 } 11271 req.Header = reqHeaders 11272 googleapi.Expand(req.URL, map[string]string{ 11273 "attributesConfig": c.attributesConfig, 11274 }) 11275 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11276 } 11277 11278 // Do executes the "retail.projects.locations.catalogs.attributesConfig.batchRemoveCatalogAttributes" call. 11279 // Any non-2xx status code is an error. Response headers are in either 11280 // *GoogleCloudRetailV2alphaBatchRemoveCatalogAttributesResponse.ServerResponse. 11281 // Header or (if a response was returned at all) in 11282 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 11283 // whether the returned error was because http.StatusNotModified was returned. 11284 func (c *ProjectsLocationsCatalogsAttributesConfigBatchRemoveCatalogAttributesCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2alphaBatchRemoveCatalogAttributesResponse, error) { 11285 gensupport.SetOptions(c.urlParams_, opts...) 11286 res, err := c.doRequest("json") 11287 if res != nil && res.StatusCode == http.StatusNotModified { 11288 if res.Body != nil { 11289 res.Body.Close() 11290 } 11291 return nil, gensupport.WrapError(&googleapi.Error{ 11292 Code: res.StatusCode, 11293 Header: res.Header, 11294 }) 11295 } 11296 if err != nil { 11297 return nil, err 11298 } 11299 defer googleapi.CloseBody(res) 11300 if err := googleapi.CheckResponse(res); err != nil { 11301 return nil, gensupport.WrapError(err) 11302 } 11303 ret := &GoogleCloudRetailV2alphaBatchRemoveCatalogAttributesResponse{ 11304 ServerResponse: googleapi.ServerResponse{ 11305 Header: res.Header, 11306 HTTPStatusCode: res.StatusCode, 11307 }, 11308 } 11309 target := &ret 11310 if err := gensupport.DecodeResponse(target, res); err != nil { 11311 return nil, err 11312 } 11313 return ret, nil 11314 } 11315 11316 type ProjectsLocationsCatalogsAttributesConfigRemoveCatalogAttributeCall struct { 11317 s *Service 11318 attributesConfig string 11319 googlecloudretailv2alpharemovecatalogattributerequest *GoogleCloudRetailV2alphaRemoveCatalogAttributeRequest 11320 urlParams_ gensupport.URLParams 11321 ctx_ context.Context 11322 header_ http.Header 11323 } 11324 11325 // RemoveCatalogAttribute: Removes the specified CatalogAttribute from the 11326 // AttributesConfig. If the CatalogAttribute to remove does not exist, a 11327 // NOT_FOUND error is returned. 11328 // 11329 // - attributesConfig: Full AttributesConfig resource name. Format: 11330 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/at 11331 // tributesConfig`. 11332 func (r *ProjectsLocationsCatalogsAttributesConfigService) RemoveCatalogAttribute(attributesConfig string, googlecloudretailv2alpharemovecatalogattributerequest *GoogleCloudRetailV2alphaRemoveCatalogAttributeRequest) *ProjectsLocationsCatalogsAttributesConfigRemoveCatalogAttributeCall { 11333 c := &ProjectsLocationsCatalogsAttributesConfigRemoveCatalogAttributeCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11334 c.attributesConfig = attributesConfig 11335 c.googlecloudretailv2alpharemovecatalogattributerequest = googlecloudretailv2alpharemovecatalogattributerequest 11336 return c 11337 } 11338 11339 // Fields allows partial responses to be retrieved. See 11340 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 11341 // details. 11342 func (c *ProjectsLocationsCatalogsAttributesConfigRemoveCatalogAttributeCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsAttributesConfigRemoveCatalogAttributeCall { 11343 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11344 return c 11345 } 11346 11347 // Context sets the context to be used in this call's Do method. 11348 func (c *ProjectsLocationsCatalogsAttributesConfigRemoveCatalogAttributeCall) Context(ctx context.Context) *ProjectsLocationsCatalogsAttributesConfigRemoveCatalogAttributeCall { 11349 c.ctx_ = ctx 11350 return c 11351 } 11352 11353 // Header returns a http.Header that can be modified by the caller to add 11354 // headers to the request. 11355 func (c *ProjectsLocationsCatalogsAttributesConfigRemoveCatalogAttributeCall) Header() http.Header { 11356 if c.header_ == nil { 11357 c.header_ = make(http.Header) 11358 } 11359 return c.header_ 11360 } 11361 11362 func (c *ProjectsLocationsCatalogsAttributesConfigRemoveCatalogAttributeCall) doRequest(alt string) (*http.Response, error) { 11363 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 11364 var body io.Reader = nil 11365 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alpharemovecatalogattributerequest) 11366 if err != nil { 11367 return nil, err 11368 } 11369 c.urlParams_.Set("alt", alt) 11370 c.urlParams_.Set("prettyPrint", "false") 11371 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+attributesConfig}:removeCatalogAttribute") 11372 urls += "?" + c.urlParams_.Encode() 11373 req, err := http.NewRequest("POST", urls, body) 11374 if err != nil { 11375 return nil, err 11376 } 11377 req.Header = reqHeaders 11378 googleapi.Expand(req.URL, map[string]string{ 11379 "attributesConfig": c.attributesConfig, 11380 }) 11381 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11382 } 11383 11384 // Do executes the "retail.projects.locations.catalogs.attributesConfig.removeCatalogAttribute" call. 11385 // Any non-2xx status code is an error. Response headers are in either 11386 // *GoogleCloudRetailV2alphaAttributesConfig.ServerResponse.Header or (if a 11387 // response was returned at all) in error.(*googleapi.Error).Header. Use 11388 // googleapi.IsNotModified to check whether the returned error was because 11389 // http.StatusNotModified was returned. 11390 func (c *ProjectsLocationsCatalogsAttributesConfigRemoveCatalogAttributeCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2alphaAttributesConfig, error) { 11391 gensupport.SetOptions(c.urlParams_, opts...) 11392 res, err := c.doRequest("json") 11393 if res != nil && res.StatusCode == http.StatusNotModified { 11394 if res.Body != nil { 11395 res.Body.Close() 11396 } 11397 return nil, gensupport.WrapError(&googleapi.Error{ 11398 Code: res.StatusCode, 11399 Header: res.Header, 11400 }) 11401 } 11402 if err != nil { 11403 return nil, err 11404 } 11405 defer googleapi.CloseBody(res) 11406 if err := googleapi.CheckResponse(res); err != nil { 11407 return nil, gensupport.WrapError(err) 11408 } 11409 ret := &GoogleCloudRetailV2alphaAttributesConfig{ 11410 ServerResponse: googleapi.ServerResponse{ 11411 Header: res.Header, 11412 HTTPStatusCode: res.StatusCode, 11413 }, 11414 } 11415 target := &ret 11416 if err := gensupport.DecodeResponse(target, res); err != nil { 11417 return nil, err 11418 } 11419 return ret, nil 11420 } 11421 11422 type ProjectsLocationsCatalogsAttributesConfigReplaceCatalogAttributeCall struct { 11423 s *Service 11424 attributesConfig string 11425 googlecloudretailv2alphareplacecatalogattributerequest *GoogleCloudRetailV2alphaReplaceCatalogAttributeRequest 11426 urlParams_ gensupport.URLParams 11427 ctx_ context.Context 11428 header_ http.Header 11429 } 11430 11431 // ReplaceCatalogAttribute: Replaces the specified CatalogAttribute in the 11432 // AttributesConfig by updating the catalog attribute with the same 11433 // CatalogAttribute.key. If the CatalogAttribute to replace does not exist, a 11434 // NOT_FOUND error is returned. 11435 // 11436 // - attributesConfig: Full AttributesConfig resource name. Format: 11437 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/at 11438 // tributesConfig`. 11439 func (r *ProjectsLocationsCatalogsAttributesConfigService) ReplaceCatalogAttribute(attributesConfig string, googlecloudretailv2alphareplacecatalogattributerequest *GoogleCloudRetailV2alphaReplaceCatalogAttributeRequest) *ProjectsLocationsCatalogsAttributesConfigReplaceCatalogAttributeCall { 11440 c := &ProjectsLocationsCatalogsAttributesConfigReplaceCatalogAttributeCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11441 c.attributesConfig = attributesConfig 11442 c.googlecloudretailv2alphareplacecatalogattributerequest = googlecloudretailv2alphareplacecatalogattributerequest 11443 return c 11444 } 11445 11446 // Fields allows partial responses to be retrieved. See 11447 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 11448 // details. 11449 func (c *ProjectsLocationsCatalogsAttributesConfigReplaceCatalogAttributeCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsAttributesConfigReplaceCatalogAttributeCall { 11450 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11451 return c 11452 } 11453 11454 // Context sets the context to be used in this call's Do method. 11455 func (c *ProjectsLocationsCatalogsAttributesConfigReplaceCatalogAttributeCall) Context(ctx context.Context) *ProjectsLocationsCatalogsAttributesConfigReplaceCatalogAttributeCall { 11456 c.ctx_ = ctx 11457 return c 11458 } 11459 11460 // Header returns a http.Header that can be modified by the caller to add 11461 // headers to the request. 11462 func (c *ProjectsLocationsCatalogsAttributesConfigReplaceCatalogAttributeCall) Header() http.Header { 11463 if c.header_ == nil { 11464 c.header_ = make(http.Header) 11465 } 11466 return c.header_ 11467 } 11468 11469 func (c *ProjectsLocationsCatalogsAttributesConfigReplaceCatalogAttributeCall) doRequest(alt string) (*http.Response, error) { 11470 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 11471 var body io.Reader = nil 11472 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphareplacecatalogattributerequest) 11473 if err != nil { 11474 return nil, err 11475 } 11476 c.urlParams_.Set("alt", alt) 11477 c.urlParams_.Set("prettyPrint", "false") 11478 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+attributesConfig}:replaceCatalogAttribute") 11479 urls += "?" + c.urlParams_.Encode() 11480 req, err := http.NewRequest("POST", urls, body) 11481 if err != nil { 11482 return nil, err 11483 } 11484 req.Header = reqHeaders 11485 googleapi.Expand(req.URL, map[string]string{ 11486 "attributesConfig": c.attributesConfig, 11487 }) 11488 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11489 } 11490 11491 // Do executes the "retail.projects.locations.catalogs.attributesConfig.replaceCatalogAttribute" call. 11492 // Any non-2xx status code is an error. Response headers are in either 11493 // *GoogleCloudRetailV2alphaAttributesConfig.ServerResponse.Header or (if a 11494 // response was returned at all) in error.(*googleapi.Error).Header. Use 11495 // googleapi.IsNotModified to check whether the returned error was because 11496 // http.StatusNotModified was returned. 11497 func (c *ProjectsLocationsCatalogsAttributesConfigReplaceCatalogAttributeCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2alphaAttributesConfig, error) { 11498 gensupport.SetOptions(c.urlParams_, opts...) 11499 res, err := c.doRequest("json") 11500 if res != nil && res.StatusCode == http.StatusNotModified { 11501 if res.Body != nil { 11502 res.Body.Close() 11503 } 11504 return nil, gensupport.WrapError(&googleapi.Error{ 11505 Code: res.StatusCode, 11506 Header: res.Header, 11507 }) 11508 } 11509 if err != nil { 11510 return nil, err 11511 } 11512 defer googleapi.CloseBody(res) 11513 if err := googleapi.CheckResponse(res); err != nil { 11514 return nil, gensupport.WrapError(err) 11515 } 11516 ret := &GoogleCloudRetailV2alphaAttributesConfig{ 11517 ServerResponse: googleapi.ServerResponse{ 11518 Header: res.Header, 11519 HTTPStatusCode: res.StatusCode, 11520 }, 11521 } 11522 target := &ret 11523 if err := gensupport.DecodeResponse(target, res); err != nil { 11524 return nil, err 11525 } 11526 return ret, nil 11527 } 11528 11529 type ProjectsLocationsCatalogsBranchesGetCall struct { 11530 s *Service 11531 name string 11532 urlParams_ gensupport.URLParams 11533 ifNoneMatch_ string 11534 ctx_ context.Context 11535 header_ http.Header 11536 } 11537 11538 // Get: Retrieves a Branch. 11539 // 11540 // - name: The name of the branch to retrieve. Format: 11541 // `projects/*/locations/global/catalogs/default_catalog/branches/some_branch_ 11542 // id`. "default_branch" can be used as a special branch_id, it returns the 11543 // default branch that has been set for the catalog. 11544 func (r *ProjectsLocationsCatalogsBranchesService) Get(name string) *ProjectsLocationsCatalogsBranchesGetCall { 11545 c := &ProjectsLocationsCatalogsBranchesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11546 c.name = name 11547 return c 11548 } 11549 11550 // View sets the optional parameter "view": The view to apply to the returned 11551 // Branch. Defaults to [Branch.BranchView.BASIC] if unspecified. See 11552 // documentation of fields of Branch to find what fields are excluded from 11553 // BASIC view. 11554 // 11555 // Possible values: 11556 // 11557 // "BRANCH_VIEW_UNSPECIFIED" - The value when it's unspecified. This defaults 11558 // 11559 // to the BASIC view. 11560 // 11561 // "BRANCH_VIEW_BASIC" - Includes basic metadata about the branch, but not 11562 // 11563 // statistical fields. See documentation of fields of Branch to find what 11564 // fields are excluded from BASIC view. 11565 // 11566 // "BRANCH_VIEW_FULL" - Includes all fields of a Branch. 11567 func (c *ProjectsLocationsCatalogsBranchesGetCall) View(view string) *ProjectsLocationsCatalogsBranchesGetCall { 11568 c.urlParams_.Set("view", view) 11569 return c 11570 } 11571 11572 // Fields allows partial responses to be retrieved. See 11573 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 11574 // details. 11575 func (c *ProjectsLocationsCatalogsBranchesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesGetCall { 11576 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11577 return c 11578 } 11579 11580 // IfNoneMatch sets an optional parameter which makes the operation fail if the 11581 // object's ETag matches the given value. This is useful for getting updates 11582 // only after the object has changed since the last request. 11583 func (c *ProjectsLocationsCatalogsBranchesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsBranchesGetCall { 11584 c.ifNoneMatch_ = entityTag 11585 return c 11586 } 11587 11588 // Context sets the context to be used in this call's Do method. 11589 func (c *ProjectsLocationsCatalogsBranchesGetCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesGetCall { 11590 c.ctx_ = ctx 11591 return c 11592 } 11593 11594 // Header returns a http.Header that can be modified by the caller to add 11595 // headers to the request. 11596 func (c *ProjectsLocationsCatalogsBranchesGetCall) Header() http.Header { 11597 if c.header_ == nil { 11598 c.header_ = make(http.Header) 11599 } 11600 return c.header_ 11601 } 11602 11603 func (c *ProjectsLocationsCatalogsBranchesGetCall) doRequest(alt string) (*http.Response, error) { 11604 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 11605 if c.ifNoneMatch_ != "" { 11606 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 11607 } 11608 var body io.Reader = nil 11609 c.urlParams_.Set("alt", alt) 11610 c.urlParams_.Set("prettyPrint", "false") 11611 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") 11612 urls += "?" + c.urlParams_.Encode() 11613 req, err := http.NewRequest("GET", urls, body) 11614 if err != nil { 11615 return nil, err 11616 } 11617 req.Header = reqHeaders 11618 googleapi.Expand(req.URL, map[string]string{ 11619 "name": c.name, 11620 }) 11621 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11622 } 11623 11624 // Do executes the "retail.projects.locations.catalogs.branches.get" call. 11625 // Any non-2xx status code is an error. Response headers are in either 11626 // *GoogleCloudRetailV2alphaBranch.ServerResponse.Header or (if a response was 11627 // returned at all) in error.(*googleapi.Error).Header. Use 11628 // googleapi.IsNotModified to check whether the returned error was because 11629 // http.StatusNotModified was returned. 11630 func (c *ProjectsLocationsCatalogsBranchesGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2alphaBranch, error) { 11631 gensupport.SetOptions(c.urlParams_, opts...) 11632 res, err := c.doRequest("json") 11633 if res != nil && res.StatusCode == http.StatusNotModified { 11634 if res.Body != nil { 11635 res.Body.Close() 11636 } 11637 return nil, gensupport.WrapError(&googleapi.Error{ 11638 Code: res.StatusCode, 11639 Header: res.Header, 11640 }) 11641 } 11642 if err != nil { 11643 return nil, err 11644 } 11645 defer googleapi.CloseBody(res) 11646 if err := googleapi.CheckResponse(res); err != nil { 11647 return nil, gensupport.WrapError(err) 11648 } 11649 ret := &GoogleCloudRetailV2alphaBranch{ 11650 ServerResponse: googleapi.ServerResponse{ 11651 Header: res.Header, 11652 HTTPStatusCode: res.StatusCode, 11653 }, 11654 } 11655 target := &ret 11656 if err := gensupport.DecodeResponse(target, res); err != nil { 11657 return nil, err 11658 } 11659 return ret, nil 11660 } 11661 11662 type ProjectsLocationsCatalogsBranchesListCall struct { 11663 s *Service 11664 parent string 11665 urlParams_ gensupport.URLParams 11666 ifNoneMatch_ string 11667 ctx_ context.Context 11668 header_ http.Header 11669 } 11670 11671 // List: Lists all Branchs under the specified parent Catalog. 11672 // 11673 // - parent: The parent catalog resource name. 11674 func (r *ProjectsLocationsCatalogsBranchesService) List(parent string) *ProjectsLocationsCatalogsBranchesListCall { 11675 c := &ProjectsLocationsCatalogsBranchesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11676 c.parent = parent 11677 return c 11678 } 11679 11680 // View sets the optional parameter "view": The view to apply to the returned 11681 // Branch. Defaults to [Branch.BranchView.BASIC] if unspecified. See 11682 // documentation of fields of Branch to find what fields are excluded from 11683 // BASIC view. 11684 // 11685 // Possible values: 11686 // 11687 // "BRANCH_VIEW_UNSPECIFIED" - The value when it's unspecified. This defaults 11688 // 11689 // to the BASIC view. 11690 // 11691 // "BRANCH_VIEW_BASIC" - Includes basic metadata about the branch, but not 11692 // 11693 // statistical fields. See documentation of fields of Branch to find what 11694 // fields are excluded from BASIC view. 11695 // 11696 // "BRANCH_VIEW_FULL" - Includes all fields of a Branch. 11697 func (c *ProjectsLocationsCatalogsBranchesListCall) View(view string) *ProjectsLocationsCatalogsBranchesListCall { 11698 c.urlParams_.Set("view", view) 11699 return c 11700 } 11701 11702 // Fields allows partial responses to be retrieved. See 11703 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 11704 // details. 11705 func (c *ProjectsLocationsCatalogsBranchesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesListCall { 11706 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11707 return c 11708 } 11709 11710 // IfNoneMatch sets an optional parameter which makes the operation fail if the 11711 // object's ETag matches the given value. This is useful for getting updates 11712 // only after the object has changed since the last request. 11713 func (c *ProjectsLocationsCatalogsBranchesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsBranchesListCall { 11714 c.ifNoneMatch_ = entityTag 11715 return c 11716 } 11717 11718 // Context sets the context to be used in this call's Do method. 11719 func (c *ProjectsLocationsCatalogsBranchesListCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesListCall { 11720 c.ctx_ = ctx 11721 return c 11722 } 11723 11724 // Header returns a http.Header that can be modified by the caller to add 11725 // headers to the request. 11726 func (c *ProjectsLocationsCatalogsBranchesListCall) Header() http.Header { 11727 if c.header_ == nil { 11728 c.header_ = make(http.Header) 11729 } 11730 return c.header_ 11731 } 11732 11733 func (c *ProjectsLocationsCatalogsBranchesListCall) doRequest(alt string) (*http.Response, error) { 11734 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 11735 if c.ifNoneMatch_ != "" { 11736 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 11737 } 11738 var body io.Reader = nil 11739 c.urlParams_.Set("alt", alt) 11740 c.urlParams_.Set("prettyPrint", "false") 11741 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+parent}/branches") 11742 urls += "?" + c.urlParams_.Encode() 11743 req, err := http.NewRequest("GET", urls, body) 11744 if err != nil { 11745 return nil, err 11746 } 11747 req.Header = reqHeaders 11748 googleapi.Expand(req.URL, map[string]string{ 11749 "parent": c.parent, 11750 }) 11751 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11752 } 11753 11754 // Do executes the "retail.projects.locations.catalogs.branches.list" call. 11755 // Any non-2xx status code is an error. Response headers are in either 11756 // *GoogleCloudRetailV2alphaListBranchesResponse.ServerResponse.Header or (if a 11757 // response was returned at all) in error.(*googleapi.Error).Header. Use 11758 // googleapi.IsNotModified to check whether the returned error was because 11759 // http.StatusNotModified was returned. 11760 func (c *ProjectsLocationsCatalogsBranchesListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2alphaListBranchesResponse, error) { 11761 gensupport.SetOptions(c.urlParams_, opts...) 11762 res, err := c.doRequest("json") 11763 if res != nil && res.StatusCode == http.StatusNotModified { 11764 if res.Body != nil { 11765 res.Body.Close() 11766 } 11767 return nil, gensupport.WrapError(&googleapi.Error{ 11768 Code: res.StatusCode, 11769 Header: res.Header, 11770 }) 11771 } 11772 if err != nil { 11773 return nil, err 11774 } 11775 defer googleapi.CloseBody(res) 11776 if err := googleapi.CheckResponse(res); err != nil { 11777 return nil, gensupport.WrapError(err) 11778 } 11779 ret := &GoogleCloudRetailV2alphaListBranchesResponse{ 11780 ServerResponse: googleapi.ServerResponse{ 11781 Header: res.Header, 11782 HTTPStatusCode: res.StatusCode, 11783 }, 11784 } 11785 target := &ret 11786 if err := gensupport.DecodeResponse(target, res); err != nil { 11787 return nil, err 11788 } 11789 return ret, nil 11790 } 11791 11792 type ProjectsLocationsCatalogsBranchesOperationsGetCall struct { 11793 s *Service 11794 name string 11795 urlParams_ gensupport.URLParams 11796 ifNoneMatch_ string 11797 ctx_ context.Context 11798 header_ http.Header 11799 } 11800 11801 // Get: Gets the latest state of a long-running operation. Clients can use this 11802 // method to poll the operation result at intervals as recommended by the API 11803 // service. 11804 // 11805 // - name: The name of the operation resource. 11806 func (r *ProjectsLocationsCatalogsBranchesOperationsService) Get(name string) *ProjectsLocationsCatalogsBranchesOperationsGetCall { 11807 c := &ProjectsLocationsCatalogsBranchesOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11808 c.name = name 11809 return c 11810 } 11811 11812 // Fields allows partial responses to be retrieved. See 11813 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 11814 // details. 11815 func (c *ProjectsLocationsCatalogsBranchesOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesOperationsGetCall { 11816 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11817 return c 11818 } 11819 11820 // IfNoneMatch sets an optional parameter which makes the operation fail if the 11821 // object's ETag matches the given value. This is useful for getting updates 11822 // only after the object has changed since the last request. 11823 func (c *ProjectsLocationsCatalogsBranchesOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsBranchesOperationsGetCall { 11824 c.ifNoneMatch_ = entityTag 11825 return c 11826 } 11827 11828 // Context sets the context to be used in this call's Do method. 11829 func (c *ProjectsLocationsCatalogsBranchesOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesOperationsGetCall { 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 *ProjectsLocationsCatalogsBranchesOperationsGetCall) Header() http.Header { 11837 if c.header_ == nil { 11838 c.header_ = make(http.Header) 11839 } 11840 return c.header_ 11841 } 11842 11843 func (c *ProjectsLocationsCatalogsBranchesOperationsGetCall) doRequest(alt string) (*http.Response, error) { 11844 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 11845 if c.ifNoneMatch_ != "" { 11846 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 11847 } 11848 var body io.Reader = nil 11849 c.urlParams_.Set("alt", alt) 11850 c.urlParams_.Set("prettyPrint", "false") 11851 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") 11852 urls += "?" + c.urlParams_.Encode() 11853 req, err := http.NewRequest("GET", urls, body) 11854 if err != nil { 11855 return nil, err 11856 } 11857 req.Header = reqHeaders 11858 googleapi.Expand(req.URL, map[string]string{ 11859 "name": c.name, 11860 }) 11861 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11862 } 11863 11864 // Do executes the "retail.projects.locations.catalogs.branches.operations.get" call. 11865 // Any non-2xx status code is an error. Response headers are in either 11866 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was 11867 // returned at all) in error.(*googleapi.Error).Header. Use 11868 // googleapi.IsNotModified to check whether the returned error was because 11869 // http.StatusNotModified was returned. 11870 func (c *ProjectsLocationsCatalogsBranchesOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 11871 gensupport.SetOptions(c.urlParams_, opts...) 11872 res, err := c.doRequest("json") 11873 if res != nil && res.StatusCode == http.StatusNotModified { 11874 if res.Body != nil { 11875 res.Body.Close() 11876 } 11877 return nil, gensupport.WrapError(&googleapi.Error{ 11878 Code: res.StatusCode, 11879 Header: res.Header, 11880 }) 11881 } 11882 if err != nil { 11883 return nil, err 11884 } 11885 defer googleapi.CloseBody(res) 11886 if err := googleapi.CheckResponse(res); err != nil { 11887 return nil, gensupport.WrapError(err) 11888 } 11889 ret := &GoogleLongrunningOperation{ 11890 ServerResponse: googleapi.ServerResponse{ 11891 Header: res.Header, 11892 HTTPStatusCode: res.StatusCode, 11893 }, 11894 } 11895 target := &ret 11896 if err := gensupport.DecodeResponse(target, res); err != nil { 11897 return nil, err 11898 } 11899 return ret, nil 11900 } 11901 11902 type ProjectsLocationsCatalogsBranchesPlacesOperationsGetCall struct { 11903 s *Service 11904 name string 11905 urlParams_ gensupport.URLParams 11906 ifNoneMatch_ string 11907 ctx_ context.Context 11908 header_ http.Header 11909 } 11910 11911 // Get: Gets the latest state of a long-running operation. Clients can use this 11912 // method to poll the operation result at intervals as recommended by the API 11913 // service. 11914 // 11915 // - name: The name of the operation resource. 11916 func (r *ProjectsLocationsCatalogsBranchesPlacesOperationsService) Get(name string) *ProjectsLocationsCatalogsBranchesPlacesOperationsGetCall { 11917 c := &ProjectsLocationsCatalogsBranchesPlacesOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11918 c.name = name 11919 return c 11920 } 11921 11922 // Fields allows partial responses to be retrieved. See 11923 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 11924 // details. 11925 func (c *ProjectsLocationsCatalogsBranchesPlacesOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesPlacesOperationsGetCall { 11926 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11927 return c 11928 } 11929 11930 // IfNoneMatch sets an optional parameter which makes the operation fail if the 11931 // object's ETag matches the given value. This is useful for getting updates 11932 // only after the object has changed since the last request. 11933 func (c *ProjectsLocationsCatalogsBranchesPlacesOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsBranchesPlacesOperationsGetCall { 11934 c.ifNoneMatch_ = entityTag 11935 return c 11936 } 11937 11938 // Context sets the context to be used in this call's Do method. 11939 func (c *ProjectsLocationsCatalogsBranchesPlacesOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesPlacesOperationsGetCall { 11940 c.ctx_ = ctx 11941 return c 11942 } 11943 11944 // Header returns a http.Header that can be modified by the caller to add 11945 // headers to the request. 11946 func (c *ProjectsLocationsCatalogsBranchesPlacesOperationsGetCall) Header() http.Header { 11947 if c.header_ == nil { 11948 c.header_ = make(http.Header) 11949 } 11950 return c.header_ 11951 } 11952 11953 func (c *ProjectsLocationsCatalogsBranchesPlacesOperationsGetCall) doRequest(alt string) (*http.Response, error) { 11954 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 11955 if c.ifNoneMatch_ != "" { 11956 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 11957 } 11958 var body io.Reader = nil 11959 c.urlParams_.Set("alt", alt) 11960 c.urlParams_.Set("prettyPrint", "false") 11961 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") 11962 urls += "?" + c.urlParams_.Encode() 11963 req, err := http.NewRequest("GET", urls, body) 11964 if err != nil { 11965 return nil, err 11966 } 11967 req.Header = reqHeaders 11968 googleapi.Expand(req.URL, map[string]string{ 11969 "name": c.name, 11970 }) 11971 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11972 } 11973 11974 // Do executes the "retail.projects.locations.catalogs.branches.places.operations.get" call. 11975 // Any non-2xx status code is an error. Response headers are in either 11976 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was 11977 // returned at all) in error.(*googleapi.Error).Header. Use 11978 // googleapi.IsNotModified to check whether the returned error was because 11979 // http.StatusNotModified was returned. 11980 func (c *ProjectsLocationsCatalogsBranchesPlacesOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 11981 gensupport.SetOptions(c.urlParams_, opts...) 11982 res, err := c.doRequest("json") 11983 if res != nil && res.StatusCode == http.StatusNotModified { 11984 if res.Body != nil { 11985 res.Body.Close() 11986 } 11987 return nil, gensupport.WrapError(&googleapi.Error{ 11988 Code: res.StatusCode, 11989 Header: res.Header, 11990 }) 11991 } 11992 if err != nil { 11993 return nil, err 11994 } 11995 defer googleapi.CloseBody(res) 11996 if err := googleapi.CheckResponse(res); err != nil { 11997 return nil, gensupport.WrapError(err) 11998 } 11999 ret := &GoogleLongrunningOperation{ 12000 ServerResponse: googleapi.ServerResponse{ 12001 Header: res.Header, 12002 HTTPStatusCode: res.StatusCode, 12003 }, 12004 } 12005 target := &ret 12006 if err := gensupport.DecodeResponse(target, res); err != nil { 12007 return nil, err 12008 } 12009 return ret, nil 12010 } 12011 12012 type ProjectsLocationsCatalogsBranchesProductsAddFulfillmentPlacesCall struct { 12013 s *Service 12014 product string 12015 googlecloudretailv2alphaaddfulfillmentplacesrequest *GoogleCloudRetailV2alphaAddFulfillmentPlacesRequest 12016 urlParams_ gensupport.URLParams 12017 ctx_ context.Context 12018 header_ http.Header 12019 } 12020 12021 // AddFulfillmentPlaces: We recommend that you use the 12022 // ProductService.AddLocalInventories method instead of the 12023 // ProductService.AddFulfillmentPlaces method. 12024 // ProductService.AddLocalInventories achieves the same results but provides 12025 // more fine-grained control over ingesting local inventory data. Incrementally 12026 // adds place IDs to Product.fulfillment_info.place_ids. This process is 12027 // asynchronous and does not require the Product to exist before updating 12028 // fulfillment information. If the request is valid, the update will be 12029 // enqueued and processed downstream. As a consequence, when a response is 12030 // returned, the added place IDs are not immediately manifested in the Product 12031 // queried by ProductService.GetProduct or ProductService.ListProducts. The 12032 // returned Operations will be obsolete after 1 day, and GetOperation API will 12033 // return NOT_FOUND afterwards. If conflicting updates are issued, the 12034 // Operations associated with the stale updates will not be marked as done 12035 // until being obsolete. 12036 // 12037 // - product: Full resource name of Product, such as 12038 // `projects/*/locations/global/catalogs/default_catalog/branches/default_bran 12039 // ch/products/some_product_id`. If the caller does not have permission to 12040 // access the Product, regardless of whether or not it exists, a 12041 // PERMISSION_DENIED error is returned. 12042 func (r *ProjectsLocationsCatalogsBranchesProductsService) AddFulfillmentPlaces(product string, googlecloudretailv2alphaaddfulfillmentplacesrequest *GoogleCloudRetailV2alphaAddFulfillmentPlacesRequest) *ProjectsLocationsCatalogsBranchesProductsAddFulfillmentPlacesCall { 12043 c := &ProjectsLocationsCatalogsBranchesProductsAddFulfillmentPlacesCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12044 c.product = product 12045 c.googlecloudretailv2alphaaddfulfillmentplacesrequest = googlecloudretailv2alphaaddfulfillmentplacesrequest 12046 return c 12047 } 12048 12049 // Fields allows partial responses to be retrieved. See 12050 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 12051 // details. 12052 func (c *ProjectsLocationsCatalogsBranchesProductsAddFulfillmentPlacesCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesProductsAddFulfillmentPlacesCall { 12053 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12054 return c 12055 } 12056 12057 // Context sets the context to be used in this call's Do method. 12058 func (c *ProjectsLocationsCatalogsBranchesProductsAddFulfillmentPlacesCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesProductsAddFulfillmentPlacesCall { 12059 c.ctx_ = ctx 12060 return c 12061 } 12062 12063 // Header returns a http.Header that can be modified by the caller to add 12064 // headers to the request. 12065 func (c *ProjectsLocationsCatalogsBranchesProductsAddFulfillmentPlacesCall) Header() http.Header { 12066 if c.header_ == nil { 12067 c.header_ = make(http.Header) 12068 } 12069 return c.header_ 12070 } 12071 12072 func (c *ProjectsLocationsCatalogsBranchesProductsAddFulfillmentPlacesCall) doRequest(alt string) (*http.Response, error) { 12073 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 12074 var body io.Reader = nil 12075 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphaaddfulfillmentplacesrequest) 12076 if err != nil { 12077 return nil, err 12078 } 12079 c.urlParams_.Set("alt", alt) 12080 c.urlParams_.Set("prettyPrint", "false") 12081 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+product}:addFulfillmentPlaces") 12082 urls += "?" + c.urlParams_.Encode() 12083 req, err := http.NewRequest("POST", urls, body) 12084 if err != nil { 12085 return nil, err 12086 } 12087 req.Header = reqHeaders 12088 googleapi.Expand(req.URL, map[string]string{ 12089 "product": c.product, 12090 }) 12091 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12092 } 12093 12094 // Do executes the "retail.projects.locations.catalogs.branches.products.addFulfillmentPlaces" call. 12095 // Any non-2xx status code is an error. Response headers are in either 12096 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was 12097 // returned at all) in error.(*googleapi.Error).Header. Use 12098 // googleapi.IsNotModified to check whether the returned error was because 12099 // http.StatusNotModified was returned. 12100 func (c *ProjectsLocationsCatalogsBranchesProductsAddFulfillmentPlacesCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 12101 gensupport.SetOptions(c.urlParams_, opts...) 12102 res, err := c.doRequest("json") 12103 if res != nil && res.StatusCode == http.StatusNotModified { 12104 if res.Body != nil { 12105 res.Body.Close() 12106 } 12107 return nil, gensupport.WrapError(&googleapi.Error{ 12108 Code: res.StatusCode, 12109 Header: res.Header, 12110 }) 12111 } 12112 if err != nil { 12113 return nil, err 12114 } 12115 defer googleapi.CloseBody(res) 12116 if err := googleapi.CheckResponse(res); err != nil { 12117 return nil, gensupport.WrapError(err) 12118 } 12119 ret := &GoogleLongrunningOperation{ 12120 ServerResponse: googleapi.ServerResponse{ 12121 Header: res.Header, 12122 HTTPStatusCode: res.StatusCode, 12123 }, 12124 } 12125 target := &ret 12126 if err := gensupport.DecodeResponse(target, res); err != nil { 12127 return nil, err 12128 } 12129 return ret, nil 12130 } 12131 12132 type ProjectsLocationsCatalogsBranchesProductsAddLocalInventoriesCall struct { 12133 s *Service 12134 product string 12135 googlecloudretailv2alphaaddlocalinventoriesrequest *GoogleCloudRetailV2alphaAddLocalInventoriesRequest 12136 urlParams_ gensupport.URLParams 12137 ctx_ context.Context 12138 header_ http.Header 12139 } 12140 12141 // AddLocalInventories: Updates local inventory information for a Product at a 12142 // list of places, while respecting the last update timestamps of each 12143 // inventory field. This process is asynchronous and does not require the 12144 // Product to exist before updating inventory information. If the request is 12145 // valid, the update will be enqueued and processed downstream. As a 12146 // consequence, when a response is returned, updates are not immediately 12147 // manifested in the Product queried by ProductService.GetProduct or 12148 // ProductService.ListProducts. Local inventory information can only be 12149 // modified using this method. ProductService.CreateProduct and 12150 // ProductService.UpdateProduct has no effect on local inventories. The 12151 // returned Operations will be obsolete after 1 day, and GetOperation API will 12152 // return NOT_FOUND afterwards. If conflicting updates are issued, the 12153 // Operations associated with the stale updates will not be marked as done 12154 // until being obsolete. 12155 // 12156 // - product: Full resource name of Product, such as 12157 // `projects/*/locations/global/catalogs/default_catalog/branches/default_bran 12158 // ch/products/some_product_id`. If the caller does not have permission to 12159 // access the Product, regardless of whether or not it exists, a 12160 // PERMISSION_DENIED error is returned. 12161 func (r *ProjectsLocationsCatalogsBranchesProductsService) AddLocalInventories(product string, googlecloudretailv2alphaaddlocalinventoriesrequest *GoogleCloudRetailV2alphaAddLocalInventoriesRequest) *ProjectsLocationsCatalogsBranchesProductsAddLocalInventoriesCall { 12162 c := &ProjectsLocationsCatalogsBranchesProductsAddLocalInventoriesCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12163 c.product = product 12164 c.googlecloudretailv2alphaaddlocalinventoriesrequest = googlecloudretailv2alphaaddlocalinventoriesrequest 12165 return c 12166 } 12167 12168 // Fields allows partial responses to be retrieved. See 12169 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 12170 // details. 12171 func (c *ProjectsLocationsCatalogsBranchesProductsAddLocalInventoriesCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesProductsAddLocalInventoriesCall { 12172 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12173 return c 12174 } 12175 12176 // Context sets the context to be used in this call's Do method. 12177 func (c *ProjectsLocationsCatalogsBranchesProductsAddLocalInventoriesCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesProductsAddLocalInventoriesCall { 12178 c.ctx_ = ctx 12179 return c 12180 } 12181 12182 // Header returns a http.Header that can be modified by the caller to add 12183 // headers to the request. 12184 func (c *ProjectsLocationsCatalogsBranchesProductsAddLocalInventoriesCall) Header() http.Header { 12185 if c.header_ == nil { 12186 c.header_ = make(http.Header) 12187 } 12188 return c.header_ 12189 } 12190 12191 func (c *ProjectsLocationsCatalogsBranchesProductsAddLocalInventoriesCall) doRequest(alt string) (*http.Response, error) { 12192 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 12193 var body io.Reader = nil 12194 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphaaddlocalinventoriesrequest) 12195 if err != nil { 12196 return nil, err 12197 } 12198 c.urlParams_.Set("alt", alt) 12199 c.urlParams_.Set("prettyPrint", "false") 12200 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+product}:addLocalInventories") 12201 urls += "?" + c.urlParams_.Encode() 12202 req, err := http.NewRequest("POST", urls, body) 12203 if err != nil { 12204 return nil, err 12205 } 12206 req.Header = reqHeaders 12207 googleapi.Expand(req.URL, map[string]string{ 12208 "product": c.product, 12209 }) 12210 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12211 } 12212 12213 // Do executes the "retail.projects.locations.catalogs.branches.products.addLocalInventories" call. 12214 // Any non-2xx status code is an error. Response headers are in either 12215 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was 12216 // returned at all) in error.(*googleapi.Error).Header. Use 12217 // googleapi.IsNotModified to check whether the returned error was because 12218 // http.StatusNotModified was returned. 12219 func (c *ProjectsLocationsCatalogsBranchesProductsAddLocalInventoriesCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 12220 gensupport.SetOptions(c.urlParams_, opts...) 12221 res, err := c.doRequest("json") 12222 if res != nil && res.StatusCode == http.StatusNotModified { 12223 if res.Body != nil { 12224 res.Body.Close() 12225 } 12226 return nil, gensupport.WrapError(&googleapi.Error{ 12227 Code: res.StatusCode, 12228 Header: res.Header, 12229 }) 12230 } 12231 if err != nil { 12232 return nil, err 12233 } 12234 defer googleapi.CloseBody(res) 12235 if err := googleapi.CheckResponse(res); err != nil { 12236 return nil, gensupport.WrapError(err) 12237 } 12238 ret := &GoogleLongrunningOperation{ 12239 ServerResponse: googleapi.ServerResponse{ 12240 Header: res.Header, 12241 HTTPStatusCode: res.StatusCode, 12242 }, 12243 } 12244 target := &ret 12245 if err := gensupport.DecodeResponse(target, res); err != nil { 12246 return nil, err 12247 } 12248 return ret, nil 12249 } 12250 12251 type ProjectsLocationsCatalogsBranchesProductsCreateCall struct { 12252 s *Service 12253 parent string 12254 googlecloudretailv2alphaproduct *GoogleCloudRetailV2alphaProduct 12255 urlParams_ gensupport.URLParams 12256 ctx_ context.Context 12257 header_ http.Header 12258 } 12259 12260 // Create: Creates a Product. 12261 // 12262 // - parent: The parent catalog resource name, such as 12263 // `projects/*/locations/global/catalogs/default_catalog/branches/default_bran 12264 // ch`. 12265 func (r *ProjectsLocationsCatalogsBranchesProductsService) Create(parent string, googlecloudretailv2alphaproduct *GoogleCloudRetailV2alphaProduct) *ProjectsLocationsCatalogsBranchesProductsCreateCall { 12266 c := &ProjectsLocationsCatalogsBranchesProductsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12267 c.parent = parent 12268 c.googlecloudretailv2alphaproduct = googlecloudretailv2alphaproduct 12269 return c 12270 } 12271 12272 // ProductId sets the optional parameter "productId": Required. The ID to use 12273 // for the Product, which will become the final component of the Product.name. 12274 // If the caller does not have permission to create the Product, regardless of 12275 // whether or not it exists, a PERMISSION_DENIED error is returned. This field 12276 // must be unique among all Products with the same parent. Otherwise, an 12277 // ALREADY_EXISTS error is returned. This field must be a UTF-8 encoded string 12278 // with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error 12279 // is returned. 12280 func (c *ProjectsLocationsCatalogsBranchesProductsCreateCall) ProductId(productId string) *ProjectsLocationsCatalogsBranchesProductsCreateCall { 12281 c.urlParams_.Set("productId", productId) 12282 return c 12283 } 12284 12285 // Fields allows partial responses to be retrieved. See 12286 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 12287 // details. 12288 func (c *ProjectsLocationsCatalogsBranchesProductsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesProductsCreateCall { 12289 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12290 return c 12291 } 12292 12293 // Context sets the context to be used in this call's Do method. 12294 func (c *ProjectsLocationsCatalogsBranchesProductsCreateCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesProductsCreateCall { 12295 c.ctx_ = ctx 12296 return c 12297 } 12298 12299 // Header returns a http.Header that can be modified by the caller to add 12300 // headers to the request. 12301 func (c *ProjectsLocationsCatalogsBranchesProductsCreateCall) Header() http.Header { 12302 if c.header_ == nil { 12303 c.header_ = make(http.Header) 12304 } 12305 return c.header_ 12306 } 12307 12308 func (c *ProjectsLocationsCatalogsBranchesProductsCreateCall) doRequest(alt string) (*http.Response, error) { 12309 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 12310 var body io.Reader = nil 12311 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphaproduct) 12312 if err != nil { 12313 return nil, err 12314 } 12315 c.urlParams_.Set("alt", alt) 12316 c.urlParams_.Set("prettyPrint", "false") 12317 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+parent}/products") 12318 urls += "?" + c.urlParams_.Encode() 12319 req, err := http.NewRequest("POST", urls, body) 12320 if err != nil { 12321 return nil, err 12322 } 12323 req.Header = reqHeaders 12324 googleapi.Expand(req.URL, map[string]string{ 12325 "parent": c.parent, 12326 }) 12327 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12328 } 12329 12330 // Do executes the "retail.projects.locations.catalogs.branches.products.create" call. 12331 // Any non-2xx status code is an error. Response headers are in either 12332 // *GoogleCloudRetailV2alphaProduct.ServerResponse.Header or (if a response was 12333 // returned at all) in error.(*googleapi.Error).Header. Use 12334 // googleapi.IsNotModified to check whether the returned error was because 12335 // http.StatusNotModified was returned. 12336 func (c *ProjectsLocationsCatalogsBranchesProductsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2alphaProduct, error) { 12337 gensupport.SetOptions(c.urlParams_, opts...) 12338 res, err := c.doRequest("json") 12339 if res != nil && res.StatusCode == http.StatusNotModified { 12340 if res.Body != nil { 12341 res.Body.Close() 12342 } 12343 return nil, gensupport.WrapError(&googleapi.Error{ 12344 Code: res.StatusCode, 12345 Header: res.Header, 12346 }) 12347 } 12348 if err != nil { 12349 return nil, err 12350 } 12351 defer googleapi.CloseBody(res) 12352 if err := googleapi.CheckResponse(res); err != nil { 12353 return nil, gensupport.WrapError(err) 12354 } 12355 ret := &GoogleCloudRetailV2alphaProduct{ 12356 ServerResponse: googleapi.ServerResponse{ 12357 Header: res.Header, 12358 HTTPStatusCode: res.StatusCode, 12359 }, 12360 } 12361 target := &ret 12362 if err := gensupport.DecodeResponse(target, res); err != nil { 12363 return nil, err 12364 } 12365 return ret, nil 12366 } 12367 12368 type ProjectsLocationsCatalogsBranchesProductsDeleteCall struct { 12369 s *Service 12370 name string 12371 urlParams_ gensupport.URLParams 12372 ctx_ context.Context 12373 header_ http.Header 12374 } 12375 12376 // Delete: Deletes a Product. 12377 // 12378 // - name: Full resource name of Product, such as 12379 // `projects/*/locations/global/catalogs/default_catalog/branches/default_bran 12380 // ch/products/some_product_id`. If the caller does not have permission to 12381 // delete the Product, regardless of whether or not it exists, a 12382 // PERMISSION_DENIED error is returned. If the Product to delete does not 12383 // exist, a NOT_FOUND error is returned. The Product to delete can neither be 12384 // a Product.Type.COLLECTION Product member nor a Product.Type.PRIMARY 12385 // Product with more than one variants. Otherwise, an INVALID_ARGUMENT error 12386 // is returned. All inventory information for the named Product will be 12387 // deleted. 12388 func (r *ProjectsLocationsCatalogsBranchesProductsService) Delete(name string) *ProjectsLocationsCatalogsBranchesProductsDeleteCall { 12389 c := &ProjectsLocationsCatalogsBranchesProductsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12390 c.name = name 12391 return c 12392 } 12393 12394 // Force sets the optional parameter "force": This value only applies to the 12395 // case when the target product is of type PRIMARY. When deleting a product of 12396 // VARIANT/COLLECTION type, this value will be ignored. When set to true, the 12397 // subsequent variant products will be deleted. When set to false, if the 12398 // primary product has active variant products, an error will be returned. 12399 func (c *ProjectsLocationsCatalogsBranchesProductsDeleteCall) Force(force bool) *ProjectsLocationsCatalogsBranchesProductsDeleteCall { 12400 c.urlParams_.Set("force", fmt.Sprint(force)) 12401 return c 12402 } 12403 12404 // Fields allows partial responses to be retrieved. See 12405 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 12406 // details. 12407 func (c *ProjectsLocationsCatalogsBranchesProductsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesProductsDeleteCall { 12408 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12409 return c 12410 } 12411 12412 // Context sets the context to be used in this call's Do method. 12413 func (c *ProjectsLocationsCatalogsBranchesProductsDeleteCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesProductsDeleteCall { 12414 c.ctx_ = ctx 12415 return c 12416 } 12417 12418 // Header returns a http.Header that can be modified by the caller to add 12419 // headers to the request. 12420 func (c *ProjectsLocationsCatalogsBranchesProductsDeleteCall) Header() http.Header { 12421 if c.header_ == nil { 12422 c.header_ = make(http.Header) 12423 } 12424 return c.header_ 12425 } 12426 12427 func (c *ProjectsLocationsCatalogsBranchesProductsDeleteCall) doRequest(alt string) (*http.Response, error) { 12428 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 12429 var body io.Reader = nil 12430 c.urlParams_.Set("alt", alt) 12431 c.urlParams_.Set("prettyPrint", "false") 12432 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") 12433 urls += "?" + c.urlParams_.Encode() 12434 req, err := http.NewRequest("DELETE", urls, body) 12435 if err != nil { 12436 return nil, err 12437 } 12438 req.Header = reqHeaders 12439 googleapi.Expand(req.URL, map[string]string{ 12440 "name": c.name, 12441 }) 12442 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12443 } 12444 12445 // Do executes the "retail.projects.locations.catalogs.branches.products.delete" call. 12446 // Any non-2xx status code is an error. Response headers are in either 12447 // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at 12448 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 12449 // check whether the returned error was because http.StatusNotModified was 12450 // returned. 12451 func (c *ProjectsLocationsCatalogsBranchesProductsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { 12452 gensupport.SetOptions(c.urlParams_, opts...) 12453 res, err := c.doRequest("json") 12454 if res != nil && res.StatusCode == http.StatusNotModified { 12455 if res.Body != nil { 12456 res.Body.Close() 12457 } 12458 return nil, gensupport.WrapError(&googleapi.Error{ 12459 Code: res.StatusCode, 12460 Header: res.Header, 12461 }) 12462 } 12463 if err != nil { 12464 return nil, err 12465 } 12466 defer googleapi.CloseBody(res) 12467 if err := googleapi.CheckResponse(res); err != nil { 12468 return nil, gensupport.WrapError(err) 12469 } 12470 ret := &GoogleProtobufEmpty{ 12471 ServerResponse: googleapi.ServerResponse{ 12472 Header: res.Header, 12473 HTTPStatusCode: res.StatusCode, 12474 }, 12475 } 12476 target := &ret 12477 if err := gensupport.DecodeResponse(target, res); err != nil { 12478 return nil, err 12479 } 12480 return ret, nil 12481 } 12482 12483 type ProjectsLocationsCatalogsBranchesProductsGetCall struct { 12484 s *Service 12485 name string 12486 urlParams_ gensupport.URLParams 12487 ifNoneMatch_ string 12488 ctx_ context.Context 12489 header_ http.Header 12490 } 12491 12492 // Get: Gets a Product. 12493 // 12494 // - name: Full resource name of Product, such as 12495 // `projects/*/locations/global/catalogs/default_catalog/branches/default_bran 12496 // ch/products/some_product_id`. If the caller does not have permission to 12497 // access the Product, regardless of whether or not it exists, a 12498 // PERMISSION_DENIED error is returned. If the requested Product does not 12499 // exist, a NOT_FOUND error is returned. 12500 func (r *ProjectsLocationsCatalogsBranchesProductsService) Get(name string) *ProjectsLocationsCatalogsBranchesProductsGetCall { 12501 c := &ProjectsLocationsCatalogsBranchesProductsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12502 c.name = name 12503 return c 12504 } 12505 12506 // Fields allows partial responses to be retrieved. See 12507 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 12508 // details. 12509 func (c *ProjectsLocationsCatalogsBranchesProductsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesProductsGetCall { 12510 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12511 return c 12512 } 12513 12514 // IfNoneMatch sets an optional parameter which makes the operation fail if the 12515 // object's ETag matches the given value. This is useful for getting updates 12516 // only after the object has changed since the last request. 12517 func (c *ProjectsLocationsCatalogsBranchesProductsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsBranchesProductsGetCall { 12518 c.ifNoneMatch_ = entityTag 12519 return c 12520 } 12521 12522 // Context sets the context to be used in this call's Do method. 12523 func (c *ProjectsLocationsCatalogsBranchesProductsGetCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesProductsGetCall { 12524 c.ctx_ = ctx 12525 return c 12526 } 12527 12528 // Header returns a http.Header that can be modified by the caller to add 12529 // headers to the request. 12530 func (c *ProjectsLocationsCatalogsBranchesProductsGetCall) Header() http.Header { 12531 if c.header_ == nil { 12532 c.header_ = make(http.Header) 12533 } 12534 return c.header_ 12535 } 12536 12537 func (c *ProjectsLocationsCatalogsBranchesProductsGetCall) doRequest(alt string) (*http.Response, error) { 12538 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 12539 if c.ifNoneMatch_ != "" { 12540 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 12541 } 12542 var body io.Reader = nil 12543 c.urlParams_.Set("alt", alt) 12544 c.urlParams_.Set("prettyPrint", "false") 12545 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") 12546 urls += "?" + c.urlParams_.Encode() 12547 req, err := http.NewRequest("GET", urls, body) 12548 if err != nil { 12549 return nil, err 12550 } 12551 req.Header = reqHeaders 12552 googleapi.Expand(req.URL, map[string]string{ 12553 "name": c.name, 12554 }) 12555 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12556 } 12557 12558 // Do executes the "retail.projects.locations.catalogs.branches.products.get" call. 12559 // Any non-2xx status code is an error. Response headers are in either 12560 // *GoogleCloudRetailV2alphaProduct.ServerResponse.Header or (if a response was 12561 // returned at all) in error.(*googleapi.Error).Header. Use 12562 // googleapi.IsNotModified to check whether the returned error was because 12563 // http.StatusNotModified was returned. 12564 func (c *ProjectsLocationsCatalogsBranchesProductsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2alphaProduct, error) { 12565 gensupport.SetOptions(c.urlParams_, opts...) 12566 res, err := c.doRequest("json") 12567 if res != nil && res.StatusCode == http.StatusNotModified { 12568 if res.Body != nil { 12569 res.Body.Close() 12570 } 12571 return nil, gensupport.WrapError(&googleapi.Error{ 12572 Code: res.StatusCode, 12573 Header: res.Header, 12574 }) 12575 } 12576 if err != nil { 12577 return nil, err 12578 } 12579 defer googleapi.CloseBody(res) 12580 if err := googleapi.CheckResponse(res); err != nil { 12581 return nil, gensupport.WrapError(err) 12582 } 12583 ret := &GoogleCloudRetailV2alphaProduct{ 12584 ServerResponse: googleapi.ServerResponse{ 12585 Header: res.Header, 12586 HTTPStatusCode: res.StatusCode, 12587 }, 12588 } 12589 target := &ret 12590 if err := gensupport.DecodeResponse(target, res); err != nil { 12591 return nil, err 12592 } 12593 return ret, nil 12594 } 12595 12596 type ProjectsLocationsCatalogsBranchesProductsImportCall struct { 12597 s *Service 12598 parent string 12599 googlecloudretailv2alphaimportproductsrequest *GoogleCloudRetailV2alphaImportProductsRequest 12600 urlParams_ gensupport.URLParams 12601 ctx_ context.Context 12602 header_ http.Header 12603 } 12604 12605 // Import: Bulk import of multiple Products. Request processing may be 12606 // synchronous. Non-existing items are created. Note that it is possible for a 12607 // subset of the Products to be successfully updated. 12608 // 12609 // - parent: 12610 // `projects/1234/locations/global/catalogs/default_catalog/branches/default_b 12611 // ranch` If no updateMask is specified, requires products.create permission. 12612 // If updateMask is specified, requires products.update permission. 12613 func (r *ProjectsLocationsCatalogsBranchesProductsService) Import(parent string, googlecloudretailv2alphaimportproductsrequest *GoogleCloudRetailV2alphaImportProductsRequest) *ProjectsLocationsCatalogsBranchesProductsImportCall { 12614 c := &ProjectsLocationsCatalogsBranchesProductsImportCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12615 c.parent = parent 12616 c.googlecloudretailv2alphaimportproductsrequest = googlecloudretailv2alphaimportproductsrequest 12617 return c 12618 } 12619 12620 // Fields allows partial responses to be retrieved. See 12621 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 12622 // details. 12623 func (c *ProjectsLocationsCatalogsBranchesProductsImportCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesProductsImportCall { 12624 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12625 return c 12626 } 12627 12628 // Context sets the context to be used in this call's Do method. 12629 func (c *ProjectsLocationsCatalogsBranchesProductsImportCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesProductsImportCall { 12630 c.ctx_ = ctx 12631 return c 12632 } 12633 12634 // Header returns a http.Header that can be modified by the caller to add 12635 // headers to the request. 12636 func (c *ProjectsLocationsCatalogsBranchesProductsImportCall) Header() http.Header { 12637 if c.header_ == nil { 12638 c.header_ = make(http.Header) 12639 } 12640 return c.header_ 12641 } 12642 12643 func (c *ProjectsLocationsCatalogsBranchesProductsImportCall) doRequest(alt string) (*http.Response, error) { 12644 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 12645 var body io.Reader = nil 12646 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphaimportproductsrequest) 12647 if err != nil { 12648 return nil, err 12649 } 12650 c.urlParams_.Set("alt", alt) 12651 c.urlParams_.Set("prettyPrint", "false") 12652 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+parent}/products:import") 12653 urls += "?" + c.urlParams_.Encode() 12654 req, err := http.NewRequest("POST", urls, body) 12655 if err != nil { 12656 return nil, err 12657 } 12658 req.Header = reqHeaders 12659 googleapi.Expand(req.URL, map[string]string{ 12660 "parent": c.parent, 12661 }) 12662 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12663 } 12664 12665 // Do executes the "retail.projects.locations.catalogs.branches.products.import" call. 12666 // Any non-2xx status code is an error. Response headers are in either 12667 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was 12668 // returned at all) in error.(*googleapi.Error).Header. Use 12669 // googleapi.IsNotModified to check whether the returned error was because 12670 // http.StatusNotModified was returned. 12671 func (c *ProjectsLocationsCatalogsBranchesProductsImportCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 12672 gensupport.SetOptions(c.urlParams_, opts...) 12673 res, err := c.doRequest("json") 12674 if res != nil && res.StatusCode == http.StatusNotModified { 12675 if res.Body != nil { 12676 res.Body.Close() 12677 } 12678 return nil, gensupport.WrapError(&googleapi.Error{ 12679 Code: res.StatusCode, 12680 Header: res.Header, 12681 }) 12682 } 12683 if err != nil { 12684 return nil, err 12685 } 12686 defer googleapi.CloseBody(res) 12687 if err := googleapi.CheckResponse(res); err != nil { 12688 return nil, gensupport.WrapError(err) 12689 } 12690 ret := &GoogleLongrunningOperation{ 12691 ServerResponse: googleapi.ServerResponse{ 12692 Header: res.Header, 12693 HTTPStatusCode: res.StatusCode, 12694 }, 12695 } 12696 target := &ret 12697 if err := gensupport.DecodeResponse(target, res); err != nil { 12698 return nil, err 12699 } 12700 return ret, nil 12701 } 12702 12703 type ProjectsLocationsCatalogsBranchesProductsListCall struct { 12704 s *Service 12705 parent string 12706 urlParams_ gensupport.URLParams 12707 ifNoneMatch_ string 12708 ctx_ context.Context 12709 header_ http.Header 12710 } 12711 12712 // List: Gets a list of Products. 12713 // 12714 // - parent: The parent branch resource name, such as 12715 // `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use 12716 // `default_branch` as the branch ID, to list products under the default 12717 // branch. If the caller does not have permission to list Products under this 12718 // branch, regardless of whether or not this branch exists, a 12719 // PERMISSION_DENIED error is returned. 12720 func (r *ProjectsLocationsCatalogsBranchesProductsService) List(parent string) *ProjectsLocationsCatalogsBranchesProductsListCall { 12721 c := &ProjectsLocationsCatalogsBranchesProductsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12722 c.parent = parent 12723 return c 12724 } 12725 12726 // Filter sets the optional parameter "filter": A filter to apply on the list 12727 // results. Supported features: * List all the products under the parent branch 12728 // if filter is unset. * List Product.Type.VARIANT Products sharing the same 12729 // Product.Type.PRIMARY Product. For example: `primary_product_id = 12730 // "some_product_id" * List Products bundled in a Product.Type.COLLECTION 12731 // Product. For example: `collection_product_id = "some_product_id" * List 12732 // Products with a partibular type. For example: `type = "PRIMARY" `type = 12733 // "VARIANT" `type = "COLLECTION" If the field is unrecognizable, an 12734 // INVALID_ARGUMENT error is returned. If the specified Product.Type.PRIMARY 12735 // Product or Product.Type.COLLECTION Product does not exist, a NOT_FOUND error 12736 // is returned. 12737 func (c *ProjectsLocationsCatalogsBranchesProductsListCall) Filter(filter string) *ProjectsLocationsCatalogsBranchesProductsListCall { 12738 c.urlParams_.Set("filter", filter) 12739 return c 12740 } 12741 12742 // PageSize sets the optional parameter "pageSize": Maximum number of Products 12743 // to return. If unspecified, defaults to 100. The maximum allowed value is 12744 // 1000. Values above 1000 will be coerced to 1000. If this field is negative, 12745 // an INVALID_ARGUMENT error is returned. 12746 func (c *ProjectsLocationsCatalogsBranchesProductsListCall) PageSize(pageSize int64) *ProjectsLocationsCatalogsBranchesProductsListCall { 12747 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 12748 return c 12749 } 12750 12751 // PageToken sets the optional parameter "pageToken": A page token 12752 // ListProductsResponse.next_page_token, received from a previous 12753 // ProductService.ListProducts call. Provide this to retrieve the subsequent 12754 // page. When paginating, all other parameters provided to 12755 // ProductService.ListProducts must match the call that provided the page 12756 // token. Otherwise, an INVALID_ARGUMENT error is returned. 12757 func (c *ProjectsLocationsCatalogsBranchesProductsListCall) PageToken(pageToken string) *ProjectsLocationsCatalogsBranchesProductsListCall { 12758 c.urlParams_.Set("pageToken", pageToken) 12759 return c 12760 } 12761 12762 // ReadMask sets the optional parameter "readMask": The fields of Product to 12763 // return in the responses. If not set or empty, the following fields are 12764 // returned: * Product.name * Product.id * Product.title * Product.uri * 12765 // Product.images * Product.price_info * Product.brands If "*" is provided, all 12766 // fields are returned. Product.name is always returned no matter what mask is 12767 // set. If an unsupported or unknown field is provided, an INVALID_ARGUMENT 12768 // error is returned. 12769 func (c *ProjectsLocationsCatalogsBranchesProductsListCall) ReadMask(readMask string) *ProjectsLocationsCatalogsBranchesProductsListCall { 12770 c.urlParams_.Set("readMask", readMask) 12771 return c 12772 } 12773 12774 // RequireTotalSize sets the optional parameter "requireTotalSize": If true and 12775 // page_token is empty, ListProductsResponse.total_size is set to the total 12776 // count of matched items irrespective of pagination. Notice that setting this 12777 // field to true affects the performance. 12778 func (c *ProjectsLocationsCatalogsBranchesProductsListCall) RequireTotalSize(requireTotalSize bool) *ProjectsLocationsCatalogsBranchesProductsListCall { 12779 c.urlParams_.Set("requireTotalSize", fmt.Sprint(requireTotalSize)) 12780 return c 12781 } 12782 12783 // Fields allows partial responses to be retrieved. See 12784 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 12785 // details. 12786 func (c *ProjectsLocationsCatalogsBranchesProductsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesProductsListCall { 12787 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12788 return c 12789 } 12790 12791 // IfNoneMatch sets an optional parameter which makes the operation fail if the 12792 // object's ETag matches the given value. This is useful for getting updates 12793 // only after the object has changed since the last request. 12794 func (c *ProjectsLocationsCatalogsBranchesProductsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsBranchesProductsListCall { 12795 c.ifNoneMatch_ = entityTag 12796 return c 12797 } 12798 12799 // Context sets the context to be used in this call's Do method. 12800 func (c *ProjectsLocationsCatalogsBranchesProductsListCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesProductsListCall { 12801 c.ctx_ = ctx 12802 return c 12803 } 12804 12805 // Header returns a http.Header that can be modified by the caller to add 12806 // headers to the request. 12807 func (c *ProjectsLocationsCatalogsBranchesProductsListCall) Header() http.Header { 12808 if c.header_ == nil { 12809 c.header_ = make(http.Header) 12810 } 12811 return c.header_ 12812 } 12813 12814 func (c *ProjectsLocationsCatalogsBranchesProductsListCall) doRequest(alt string) (*http.Response, error) { 12815 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 12816 if c.ifNoneMatch_ != "" { 12817 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 12818 } 12819 var body io.Reader = nil 12820 c.urlParams_.Set("alt", alt) 12821 c.urlParams_.Set("prettyPrint", "false") 12822 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+parent}/products") 12823 urls += "?" + c.urlParams_.Encode() 12824 req, err := http.NewRequest("GET", urls, body) 12825 if err != nil { 12826 return nil, err 12827 } 12828 req.Header = reqHeaders 12829 googleapi.Expand(req.URL, map[string]string{ 12830 "parent": c.parent, 12831 }) 12832 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12833 } 12834 12835 // Do executes the "retail.projects.locations.catalogs.branches.products.list" call. 12836 // Any non-2xx status code is an error. Response headers are in either 12837 // *GoogleCloudRetailV2alphaListProductsResponse.ServerResponse.Header or (if a 12838 // response was returned at all) in error.(*googleapi.Error).Header. Use 12839 // googleapi.IsNotModified to check whether the returned error was because 12840 // http.StatusNotModified was returned. 12841 func (c *ProjectsLocationsCatalogsBranchesProductsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2alphaListProductsResponse, error) { 12842 gensupport.SetOptions(c.urlParams_, opts...) 12843 res, err := c.doRequest("json") 12844 if res != nil && res.StatusCode == http.StatusNotModified { 12845 if res.Body != nil { 12846 res.Body.Close() 12847 } 12848 return nil, gensupport.WrapError(&googleapi.Error{ 12849 Code: res.StatusCode, 12850 Header: res.Header, 12851 }) 12852 } 12853 if err != nil { 12854 return nil, err 12855 } 12856 defer googleapi.CloseBody(res) 12857 if err := googleapi.CheckResponse(res); err != nil { 12858 return nil, gensupport.WrapError(err) 12859 } 12860 ret := &GoogleCloudRetailV2alphaListProductsResponse{ 12861 ServerResponse: googleapi.ServerResponse{ 12862 Header: res.Header, 12863 HTTPStatusCode: res.StatusCode, 12864 }, 12865 } 12866 target := &ret 12867 if err := gensupport.DecodeResponse(target, res); err != nil { 12868 return nil, err 12869 } 12870 return ret, nil 12871 } 12872 12873 // Pages invokes f for each page of results. 12874 // A non-nil error returned from f will halt the iteration. 12875 // The provided context supersedes any context provided to the Context method. 12876 func (c *ProjectsLocationsCatalogsBranchesProductsListCall) Pages(ctx context.Context, f func(*GoogleCloudRetailV2alphaListProductsResponse) error) error { 12877 c.ctx_ = ctx 12878 defer c.PageToken(c.urlParams_.Get("pageToken")) 12879 for { 12880 x, err := c.Do() 12881 if err != nil { 12882 return err 12883 } 12884 if err := f(x); err != nil { 12885 return err 12886 } 12887 if x.NextPageToken == "" { 12888 return nil 12889 } 12890 c.PageToken(x.NextPageToken) 12891 } 12892 } 12893 12894 type ProjectsLocationsCatalogsBranchesProductsPatchCall struct { 12895 s *Service 12896 name string 12897 googlecloudretailv2alphaproduct *GoogleCloudRetailV2alphaProduct 12898 urlParams_ gensupport.URLParams 12899 ctx_ context.Context 12900 header_ http.Header 12901 } 12902 12903 // Patch: Updates a Product. 12904 // 12905 // - name: Immutable. Full resource name of the product, such as 12906 // `projects/*/locations/global/catalogs/default_catalog/branches/default_bran 12907 // ch/products/product_id`. 12908 func (r *ProjectsLocationsCatalogsBranchesProductsService) Patch(name string, googlecloudretailv2alphaproduct *GoogleCloudRetailV2alphaProduct) *ProjectsLocationsCatalogsBranchesProductsPatchCall { 12909 c := &ProjectsLocationsCatalogsBranchesProductsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12910 c.name = name 12911 c.googlecloudretailv2alphaproduct = googlecloudretailv2alphaproduct 12912 return c 12913 } 12914 12915 // AllowMissing sets the optional parameter "allowMissing": If set to true, and 12916 // the Product is not found, a new Product will be created. In this situation, 12917 // `update_mask` is ignored. 12918 func (c *ProjectsLocationsCatalogsBranchesProductsPatchCall) AllowMissing(allowMissing bool) *ProjectsLocationsCatalogsBranchesProductsPatchCall { 12919 c.urlParams_.Set("allowMissing", fmt.Sprint(allowMissing)) 12920 return c 12921 } 12922 12923 // UpdateMask sets the optional parameter "updateMask": Indicates which fields 12924 // in the provided Product to update. The immutable and output only fields are 12925 // NOT supported. If not set, all supported fields (the fields that are neither 12926 // immutable nor output only) are updated. If an unsupported or unknown field 12927 // is provided, an INVALID_ARGUMENT error is returned. The attribute key can be 12928 // updated by setting the mask path as "attributes.${key_name}". If a key name 12929 // is present in the mask but not in the patching product from the request, 12930 // this key will be deleted after the update. 12931 func (c *ProjectsLocationsCatalogsBranchesProductsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsCatalogsBranchesProductsPatchCall { 12932 c.urlParams_.Set("updateMask", updateMask) 12933 return c 12934 } 12935 12936 // Fields allows partial responses to be retrieved. See 12937 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 12938 // details. 12939 func (c *ProjectsLocationsCatalogsBranchesProductsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesProductsPatchCall { 12940 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12941 return c 12942 } 12943 12944 // Context sets the context to be used in this call's Do method. 12945 func (c *ProjectsLocationsCatalogsBranchesProductsPatchCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesProductsPatchCall { 12946 c.ctx_ = ctx 12947 return c 12948 } 12949 12950 // Header returns a http.Header that can be modified by the caller to add 12951 // headers to the request. 12952 func (c *ProjectsLocationsCatalogsBranchesProductsPatchCall) Header() http.Header { 12953 if c.header_ == nil { 12954 c.header_ = make(http.Header) 12955 } 12956 return c.header_ 12957 } 12958 12959 func (c *ProjectsLocationsCatalogsBranchesProductsPatchCall) doRequest(alt string) (*http.Response, error) { 12960 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 12961 var body io.Reader = nil 12962 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphaproduct) 12963 if err != nil { 12964 return nil, err 12965 } 12966 c.urlParams_.Set("alt", alt) 12967 c.urlParams_.Set("prettyPrint", "false") 12968 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") 12969 urls += "?" + c.urlParams_.Encode() 12970 req, err := http.NewRequest("PATCH", urls, body) 12971 if err != nil { 12972 return nil, err 12973 } 12974 req.Header = reqHeaders 12975 googleapi.Expand(req.URL, map[string]string{ 12976 "name": c.name, 12977 }) 12978 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12979 } 12980 12981 // Do executes the "retail.projects.locations.catalogs.branches.products.patch" call. 12982 // Any non-2xx status code is an error. Response headers are in either 12983 // *GoogleCloudRetailV2alphaProduct.ServerResponse.Header or (if a response was 12984 // returned at all) in error.(*googleapi.Error).Header. Use 12985 // googleapi.IsNotModified to check whether the returned error was because 12986 // http.StatusNotModified was returned. 12987 func (c *ProjectsLocationsCatalogsBranchesProductsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2alphaProduct, error) { 12988 gensupport.SetOptions(c.urlParams_, opts...) 12989 res, err := c.doRequest("json") 12990 if res != nil && res.StatusCode == http.StatusNotModified { 12991 if res.Body != nil { 12992 res.Body.Close() 12993 } 12994 return nil, gensupport.WrapError(&googleapi.Error{ 12995 Code: res.StatusCode, 12996 Header: res.Header, 12997 }) 12998 } 12999 if err != nil { 13000 return nil, err 13001 } 13002 defer googleapi.CloseBody(res) 13003 if err := googleapi.CheckResponse(res); err != nil { 13004 return nil, gensupport.WrapError(err) 13005 } 13006 ret := &GoogleCloudRetailV2alphaProduct{ 13007 ServerResponse: googleapi.ServerResponse{ 13008 Header: res.Header, 13009 HTTPStatusCode: res.StatusCode, 13010 }, 13011 } 13012 target := &ret 13013 if err := gensupport.DecodeResponse(target, res); err != nil { 13014 return nil, err 13015 } 13016 return ret, nil 13017 } 13018 13019 type ProjectsLocationsCatalogsBranchesProductsPurgeCall struct { 13020 s *Service 13021 parent string 13022 googlecloudretailv2alphapurgeproductsrequest *GoogleCloudRetailV2alphaPurgeProductsRequest 13023 urlParams_ gensupport.URLParams 13024 ctx_ context.Context 13025 header_ http.Header 13026 } 13027 13028 // Purge: Permanently deletes all selected Products under a branch. This 13029 // process is asynchronous. If the request is valid, the removal will be 13030 // enqueued and processed offline. Depending on the number of Products, this 13031 // operation could take hours to complete. Before the operation completes, some 13032 // Products may still be returned by ProductService.GetProduct or 13033 // ProductService.ListProducts. Depending on the number of Products, this 13034 // operation could take hours to complete. To get a sample of Products that 13035 // would be deleted, set PurgeProductsRequest.force to false. 13036 // 13037 // - parent: The resource name of the branch under which the products are 13038 // created. The format is 13039 // `projects/${projectId}/locations/global/catalogs/${catalogId}/branches/${br 13040 // anchId}`. 13041 func (r *ProjectsLocationsCatalogsBranchesProductsService) Purge(parent string, googlecloudretailv2alphapurgeproductsrequest *GoogleCloudRetailV2alphaPurgeProductsRequest) *ProjectsLocationsCatalogsBranchesProductsPurgeCall { 13042 c := &ProjectsLocationsCatalogsBranchesProductsPurgeCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13043 c.parent = parent 13044 c.googlecloudretailv2alphapurgeproductsrequest = googlecloudretailv2alphapurgeproductsrequest 13045 return c 13046 } 13047 13048 // Fields allows partial responses to be retrieved. See 13049 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 13050 // details. 13051 func (c *ProjectsLocationsCatalogsBranchesProductsPurgeCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesProductsPurgeCall { 13052 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13053 return c 13054 } 13055 13056 // Context sets the context to be used in this call's Do method. 13057 func (c *ProjectsLocationsCatalogsBranchesProductsPurgeCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesProductsPurgeCall { 13058 c.ctx_ = ctx 13059 return c 13060 } 13061 13062 // Header returns a http.Header that can be modified by the caller to add 13063 // headers to the request. 13064 func (c *ProjectsLocationsCatalogsBranchesProductsPurgeCall) Header() http.Header { 13065 if c.header_ == nil { 13066 c.header_ = make(http.Header) 13067 } 13068 return c.header_ 13069 } 13070 13071 func (c *ProjectsLocationsCatalogsBranchesProductsPurgeCall) doRequest(alt string) (*http.Response, error) { 13072 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 13073 var body io.Reader = nil 13074 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphapurgeproductsrequest) 13075 if err != nil { 13076 return nil, err 13077 } 13078 c.urlParams_.Set("alt", alt) 13079 c.urlParams_.Set("prettyPrint", "false") 13080 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+parent}/products:purge") 13081 urls += "?" + c.urlParams_.Encode() 13082 req, err := http.NewRequest("POST", urls, body) 13083 if err != nil { 13084 return nil, err 13085 } 13086 req.Header = reqHeaders 13087 googleapi.Expand(req.URL, map[string]string{ 13088 "parent": c.parent, 13089 }) 13090 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13091 } 13092 13093 // Do executes the "retail.projects.locations.catalogs.branches.products.purge" call. 13094 // Any non-2xx status code is an error. Response headers are in either 13095 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was 13096 // returned at all) in error.(*googleapi.Error).Header. Use 13097 // googleapi.IsNotModified to check whether the returned error was because 13098 // http.StatusNotModified was returned. 13099 func (c *ProjectsLocationsCatalogsBranchesProductsPurgeCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 13100 gensupport.SetOptions(c.urlParams_, opts...) 13101 res, err := c.doRequest("json") 13102 if res != nil && res.StatusCode == http.StatusNotModified { 13103 if res.Body != nil { 13104 res.Body.Close() 13105 } 13106 return nil, gensupport.WrapError(&googleapi.Error{ 13107 Code: res.StatusCode, 13108 Header: res.Header, 13109 }) 13110 } 13111 if err != nil { 13112 return nil, err 13113 } 13114 defer googleapi.CloseBody(res) 13115 if err := googleapi.CheckResponse(res); err != nil { 13116 return nil, gensupport.WrapError(err) 13117 } 13118 ret := &GoogleLongrunningOperation{ 13119 ServerResponse: googleapi.ServerResponse{ 13120 Header: res.Header, 13121 HTTPStatusCode: res.StatusCode, 13122 }, 13123 } 13124 target := &ret 13125 if err := gensupport.DecodeResponse(target, res); err != nil { 13126 return nil, err 13127 } 13128 return ret, nil 13129 } 13130 13131 type ProjectsLocationsCatalogsBranchesProductsRemoveFulfillmentPlacesCall struct { 13132 s *Service 13133 product string 13134 googlecloudretailv2alpharemovefulfillmentplacesrequest *GoogleCloudRetailV2alphaRemoveFulfillmentPlacesRequest 13135 urlParams_ gensupport.URLParams 13136 ctx_ context.Context 13137 header_ http.Header 13138 } 13139 13140 // RemoveFulfillmentPlaces: We recommend that you use the 13141 // ProductService.RemoveLocalInventories method instead of the 13142 // ProductService.RemoveFulfillmentPlaces method. 13143 // ProductService.RemoveLocalInventories achieves the same results but provides 13144 // more fine-grained control over ingesting local inventory data. Incrementally 13145 // removes place IDs from a Product.fulfillment_info.place_ids. This process is 13146 // asynchronous and does not require the Product to exist before updating 13147 // fulfillment information. If the request is valid, the update will be 13148 // enqueued and processed downstream. As a consequence, when a response is 13149 // returned, the removed place IDs are not immediately manifested in the 13150 // Product queried by ProductService.GetProduct or ProductService.ListProducts. 13151 // The returned Operations will be obsolete after 1 day, and GetOperation API 13152 // will return NOT_FOUND afterwards. If conflicting updates are issued, the 13153 // Operations associated with the stale updates will not be marked as done 13154 // until being obsolete. 13155 // 13156 // - product: Full resource name of Product, such as 13157 // `projects/*/locations/global/catalogs/default_catalog/branches/default_bran 13158 // ch/products/some_product_id`. If the caller does not have permission to 13159 // access the Product, regardless of whether or not it exists, a 13160 // PERMISSION_DENIED error is returned. 13161 func (r *ProjectsLocationsCatalogsBranchesProductsService) RemoveFulfillmentPlaces(product string, googlecloudretailv2alpharemovefulfillmentplacesrequest *GoogleCloudRetailV2alphaRemoveFulfillmentPlacesRequest) *ProjectsLocationsCatalogsBranchesProductsRemoveFulfillmentPlacesCall { 13162 c := &ProjectsLocationsCatalogsBranchesProductsRemoveFulfillmentPlacesCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13163 c.product = product 13164 c.googlecloudretailv2alpharemovefulfillmentplacesrequest = googlecloudretailv2alpharemovefulfillmentplacesrequest 13165 return c 13166 } 13167 13168 // Fields allows partial responses to be retrieved. See 13169 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 13170 // details. 13171 func (c *ProjectsLocationsCatalogsBranchesProductsRemoveFulfillmentPlacesCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesProductsRemoveFulfillmentPlacesCall { 13172 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13173 return c 13174 } 13175 13176 // Context sets the context to be used in this call's Do method. 13177 func (c *ProjectsLocationsCatalogsBranchesProductsRemoveFulfillmentPlacesCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesProductsRemoveFulfillmentPlacesCall { 13178 c.ctx_ = ctx 13179 return c 13180 } 13181 13182 // Header returns a http.Header that can be modified by the caller to add 13183 // headers to the request. 13184 func (c *ProjectsLocationsCatalogsBranchesProductsRemoveFulfillmentPlacesCall) Header() http.Header { 13185 if c.header_ == nil { 13186 c.header_ = make(http.Header) 13187 } 13188 return c.header_ 13189 } 13190 13191 func (c *ProjectsLocationsCatalogsBranchesProductsRemoveFulfillmentPlacesCall) doRequest(alt string) (*http.Response, error) { 13192 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 13193 var body io.Reader = nil 13194 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alpharemovefulfillmentplacesrequest) 13195 if err != nil { 13196 return nil, err 13197 } 13198 c.urlParams_.Set("alt", alt) 13199 c.urlParams_.Set("prettyPrint", "false") 13200 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+product}:removeFulfillmentPlaces") 13201 urls += "?" + c.urlParams_.Encode() 13202 req, err := http.NewRequest("POST", urls, body) 13203 if err != nil { 13204 return nil, err 13205 } 13206 req.Header = reqHeaders 13207 googleapi.Expand(req.URL, map[string]string{ 13208 "product": c.product, 13209 }) 13210 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13211 } 13212 13213 // Do executes the "retail.projects.locations.catalogs.branches.products.removeFulfillmentPlaces" call. 13214 // Any non-2xx status code is an error. Response headers are in either 13215 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was 13216 // returned at all) in error.(*googleapi.Error).Header. Use 13217 // googleapi.IsNotModified to check whether the returned error was because 13218 // http.StatusNotModified was returned. 13219 func (c *ProjectsLocationsCatalogsBranchesProductsRemoveFulfillmentPlacesCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 13220 gensupport.SetOptions(c.urlParams_, opts...) 13221 res, err := c.doRequest("json") 13222 if res != nil && res.StatusCode == http.StatusNotModified { 13223 if res.Body != nil { 13224 res.Body.Close() 13225 } 13226 return nil, gensupport.WrapError(&googleapi.Error{ 13227 Code: res.StatusCode, 13228 Header: res.Header, 13229 }) 13230 } 13231 if err != nil { 13232 return nil, err 13233 } 13234 defer googleapi.CloseBody(res) 13235 if err := googleapi.CheckResponse(res); err != nil { 13236 return nil, gensupport.WrapError(err) 13237 } 13238 ret := &GoogleLongrunningOperation{ 13239 ServerResponse: googleapi.ServerResponse{ 13240 Header: res.Header, 13241 HTTPStatusCode: res.StatusCode, 13242 }, 13243 } 13244 target := &ret 13245 if err := gensupport.DecodeResponse(target, res); err != nil { 13246 return nil, err 13247 } 13248 return ret, nil 13249 } 13250 13251 type ProjectsLocationsCatalogsBranchesProductsRemoveLocalInventoriesCall struct { 13252 s *Service 13253 product string 13254 googlecloudretailv2alpharemovelocalinventoriesrequest *GoogleCloudRetailV2alphaRemoveLocalInventoriesRequest 13255 urlParams_ gensupport.URLParams 13256 ctx_ context.Context 13257 header_ http.Header 13258 } 13259 13260 // RemoveLocalInventories: Remove local inventory information for a Product at 13261 // a list of places at a removal timestamp. This process is asynchronous. If 13262 // the request is valid, the removal will be enqueued and processed downstream. 13263 // As a consequence, when a response is returned, removals are not immediately 13264 // manifested in the Product queried by ProductService.GetProduct or 13265 // ProductService.ListProducts. Local inventory information can only be removed 13266 // using this method. ProductService.CreateProduct and 13267 // ProductService.UpdateProduct has no effect on local inventories. The 13268 // returned Operations will be obsolete after 1 day, and GetOperation API will 13269 // return NOT_FOUND afterwards. If conflicting updates are issued, the 13270 // Operations associated with the stale updates will not be marked as done 13271 // until being obsolete. 13272 // 13273 // - product: Full resource name of Product, such as 13274 // `projects/*/locations/global/catalogs/default_catalog/branches/default_bran 13275 // ch/products/some_product_id`. If the caller does not have permission to 13276 // access the Product, regardless of whether or not it exists, a 13277 // PERMISSION_DENIED error is returned. 13278 func (r *ProjectsLocationsCatalogsBranchesProductsService) RemoveLocalInventories(product string, googlecloudretailv2alpharemovelocalinventoriesrequest *GoogleCloudRetailV2alphaRemoveLocalInventoriesRequest) *ProjectsLocationsCatalogsBranchesProductsRemoveLocalInventoriesCall { 13279 c := &ProjectsLocationsCatalogsBranchesProductsRemoveLocalInventoriesCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13280 c.product = product 13281 c.googlecloudretailv2alpharemovelocalinventoriesrequest = googlecloudretailv2alpharemovelocalinventoriesrequest 13282 return c 13283 } 13284 13285 // Fields allows partial responses to be retrieved. See 13286 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 13287 // details. 13288 func (c *ProjectsLocationsCatalogsBranchesProductsRemoveLocalInventoriesCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesProductsRemoveLocalInventoriesCall { 13289 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13290 return c 13291 } 13292 13293 // Context sets the context to be used in this call's Do method. 13294 func (c *ProjectsLocationsCatalogsBranchesProductsRemoveLocalInventoriesCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesProductsRemoveLocalInventoriesCall { 13295 c.ctx_ = ctx 13296 return c 13297 } 13298 13299 // Header returns a http.Header that can be modified by the caller to add 13300 // headers to the request. 13301 func (c *ProjectsLocationsCatalogsBranchesProductsRemoveLocalInventoriesCall) Header() http.Header { 13302 if c.header_ == nil { 13303 c.header_ = make(http.Header) 13304 } 13305 return c.header_ 13306 } 13307 13308 func (c *ProjectsLocationsCatalogsBranchesProductsRemoveLocalInventoriesCall) doRequest(alt string) (*http.Response, error) { 13309 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 13310 var body io.Reader = nil 13311 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alpharemovelocalinventoriesrequest) 13312 if err != nil { 13313 return nil, err 13314 } 13315 c.urlParams_.Set("alt", alt) 13316 c.urlParams_.Set("prettyPrint", "false") 13317 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+product}:removeLocalInventories") 13318 urls += "?" + c.urlParams_.Encode() 13319 req, err := http.NewRequest("POST", urls, body) 13320 if err != nil { 13321 return nil, err 13322 } 13323 req.Header = reqHeaders 13324 googleapi.Expand(req.URL, map[string]string{ 13325 "product": c.product, 13326 }) 13327 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13328 } 13329 13330 // Do executes the "retail.projects.locations.catalogs.branches.products.removeLocalInventories" call. 13331 // Any non-2xx status code is an error. Response headers are in either 13332 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was 13333 // returned at all) in error.(*googleapi.Error).Header. Use 13334 // googleapi.IsNotModified to check whether the returned error was because 13335 // http.StatusNotModified was returned. 13336 func (c *ProjectsLocationsCatalogsBranchesProductsRemoveLocalInventoriesCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 13337 gensupport.SetOptions(c.urlParams_, opts...) 13338 res, err := c.doRequest("json") 13339 if res != nil && res.StatusCode == http.StatusNotModified { 13340 if res.Body != nil { 13341 res.Body.Close() 13342 } 13343 return nil, gensupport.WrapError(&googleapi.Error{ 13344 Code: res.StatusCode, 13345 Header: res.Header, 13346 }) 13347 } 13348 if err != nil { 13349 return nil, err 13350 } 13351 defer googleapi.CloseBody(res) 13352 if err := googleapi.CheckResponse(res); err != nil { 13353 return nil, gensupport.WrapError(err) 13354 } 13355 ret := &GoogleLongrunningOperation{ 13356 ServerResponse: googleapi.ServerResponse{ 13357 Header: res.Header, 13358 HTTPStatusCode: res.StatusCode, 13359 }, 13360 } 13361 target := &ret 13362 if err := gensupport.DecodeResponse(target, res); err != nil { 13363 return nil, err 13364 } 13365 return ret, nil 13366 } 13367 13368 type ProjectsLocationsCatalogsBranchesProductsSetInventoryCall struct { 13369 s *Service 13370 name string 13371 googlecloudretailv2alphasetinventoryrequest *GoogleCloudRetailV2alphaSetInventoryRequest 13372 urlParams_ gensupport.URLParams 13373 ctx_ context.Context 13374 header_ http.Header 13375 } 13376 13377 // SetInventory: Updates inventory information for a Product while respecting 13378 // the last update timestamps of each inventory field. This process is 13379 // asynchronous and does not require the Product to exist before updating 13380 // fulfillment information. If the request is valid, the update is enqueued and 13381 // processed downstream. As a consequence, when a response is returned, updates 13382 // are not immediately manifested in the Product queried by 13383 // ProductService.GetProduct or ProductService.ListProducts. When inventory is 13384 // updated with ProductService.CreateProduct and ProductService.UpdateProduct, 13385 // the specified inventory field value(s) overwrite any existing value(s) while 13386 // ignoring the last update time for this field. Furthermore, the last update 13387 // times for the specified inventory fields are overwritten by the times of the 13388 // ProductService.CreateProduct or ProductService.UpdateProduct request. If no 13389 // inventory fields are set in CreateProductRequest.product, then any 13390 // pre-existing inventory information for this product is used. If no inventory 13391 // fields are set in SetInventoryRequest.set_mask, then any existing inventory 13392 // information is preserved. Pre-existing inventory information can only be 13393 // updated with ProductService.SetInventory, 13394 // ProductService.AddFulfillmentPlaces, and 13395 // ProductService.RemoveFulfillmentPlaces. The returned Operations is obsolete 13396 // after one day, and the GetOperation API returns `NOT_FOUND` afterwards. If 13397 // conflicting updates are issued, the Operations associated with the stale 13398 // updates are not marked as done until they are obsolete. 13399 // 13400 // - name: Immutable. Full resource name of the product, such as 13401 // `projects/*/locations/global/catalogs/default_catalog/branches/default_bran 13402 // ch/products/product_id`. 13403 func (r *ProjectsLocationsCatalogsBranchesProductsService) SetInventory(name string, googlecloudretailv2alphasetinventoryrequest *GoogleCloudRetailV2alphaSetInventoryRequest) *ProjectsLocationsCatalogsBranchesProductsSetInventoryCall { 13404 c := &ProjectsLocationsCatalogsBranchesProductsSetInventoryCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13405 c.name = name 13406 c.googlecloudretailv2alphasetinventoryrequest = googlecloudretailv2alphasetinventoryrequest 13407 return c 13408 } 13409 13410 // Fields allows partial responses to be retrieved. See 13411 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 13412 // details. 13413 func (c *ProjectsLocationsCatalogsBranchesProductsSetInventoryCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesProductsSetInventoryCall { 13414 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13415 return c 13416 } 13417 13418 // Context sets the context to be used in this call's Do method. 13419 func (c *ProjectsLocationsCatalogsBranchesProductsSetInventoryCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesProductsSetInventoryCall { 13420 c.ctx_ = ctx 13421 return c 13422 } 13423 13424 // Header returns a http.Header that can be modified by the caller to add 13425 // headers to the request. 13426 func (c *ProjectsLocationsCatalogsBranchesProductsSetInventoryCall) Header() http.Header { 13427 if c.header_ == nil { 13428 c.header_ = make(http.Header) 13429 } 13430 return c.header_ 13431 } 13432 13433 func (c *ProjectsLocationsCatalogsBranchesProductsSetInventoryCall) doRequest(alt string) (*http.Response, error) { 13434 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 13435 var body io.Reader = nil 13436 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphasetinventoryrequest) 13437 if err != nil { 13438 return nil, err 13439 } 13440 c.urlParams_.Set("alt", alt) 13441 c.urlParams_.Set("prettyPrint", "false") 13442 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}:setInventory") 13443 urls += "?" + c.urlParams_.Encode() 13444 req, err := http.NewRequest("POST", urls, body) 13445 if err != nil { 13446 return nil, err 13447 } 13448 req.Header = reqHeaders 13449 googleapi.Expand(req.URL, map[string]string{ 13450 "name": c.name, 13451 }) 13452 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13453 } 13454 13455 // Do executes the "retail.projects.locations.catalogs.branches.products.setInventory" call. 13456 // Any non-2xx status code is an error. Response headers are in either 13457 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was 13458 // returned at all) in error.(*googleapi.Error).Header. Use 13459 // googleapi.IsNotModified to check whether the returned error was because 13460 // http.StatusNotModified was returned. 13461 func (c *ProjectsLocationsCatalogsBranchesProductsSetInventoryCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 13462 gensupport.SetOptions(c.urlParams_, opts...) 13463 res, err := c.doRequest("json") 13464 if res != nil && res.StatusCode == http.StatusNotModified { 13465 if res.Body != nil { 13466 res.Body.Close() 13467 } 13468 return nil, gensupport.WrapError(&googleapi.Error{ 13469 Code: res.StatusCode, 13470 Header: res.Header, 13471 }) 13472 } 13473 if err != nil { 13474 return nil, err 13475 } 13476 defer googleapi.CloseBody(res) 13477 if err := googleapi.CheckResponse(res); err != nil { 13478 return nil, gensupport.WrapError(err) 13479 } 13480 ret := &GoogleLongrunningOperation{ 13481 ServerResponse: googleapi.ServerResponse{ 13482 Header: res.Header, 13483 HTTPStatusCode: res.StatusCode, 13484 }, 13485 } 13486 target := &ret 13487 if err := gensupport.DecodeResponse(target, res); err != nil { 13488 return nil, err 13489 } 13490 return ret, nil 13491 } 13492 13493 type ProjectsLocationsCatalogsCompletionDataImportCall struct { 13494 s *Service 13495 parent string 13496 googlecloudretailv2alphaimportcompletiondatarequest *GoogleCloudRetailV2alphaImportCompletionDataRequest 13497 urlParams_ gensupport.URLParams 13498 ctx_ context.Context 13499 header_ http.Header 13500 } 13501 13502 // Import: Bulk import of processed completion dataset. Request processing is 13503 // asynchronous. Partial updating is not supported. The operation is 13504 // successfully finished only after the imported suggestions are indexed 13505 // successfully and ready for serving. The process takes hours. This feature is 13506 // only available for users who have Retail Search enabled. Enable Retail 13507 // Search on Cloud Console before using this feature. 13508 // 13509 // - parent: The catalog which the suggestions dataset belongs to. Format: 13510 // `projects/1234/locations/global/catalogs/default_catalog`. 13511 func (r *ProjectsLocationsCatalogsCompletionDataService) Import(parent string, googlecloudretailv2alphaimportcompletiondatarequest *GoogleCloudRetailV2alphaImportCompletionDataRequest) *ProjectsLocationsCatalogsCompletionDataImportCall { 13512 c := &ProjectsLocationsCatalogsCompletionDataImportCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13513 c.parent = parent 13514 c.googlecloudretailv2alphaimportcompletiondatarequest = googlecloudretailv2alphaimportcompletiondatarequest 13515 return c 13516 } 13517 13518 // Fields allows partial responses to be retrieved. See 13519 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 13520 // details. 13521 func (c *ProjectsLocationsCatalogsCompletionDataImportCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsCompletionDataImportCall { 13522 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13523 return c 13524 } 13525 13526 // Context sets the context to be used in this call's Do method. 13527 func (c *ProjectsLocationsCatalogsCompletionDataImportCall) Context(ctx context.Context) *ProjectsLocationsCatalogsCompletionDataImportCall { 13528 c.ctx_ = ctx 13529 return c 13530 } 13531 13532 // Header returns a http.Header that can be modified by the caller to add 13533 // headers to the request. 13534 func (c *ProjectsLocationsCatalogsCompletionDataImportCall) Header() http.Header { 13535 if c.header_ == nil { 13536 c.header_ = make(http.Header) 13537 } 13538 return c.header_ 13539 } 13540 13541 func (c *ProjectsLocationsCatalogsCompletionDataImportCall) doRequest(alt string) (*http.Response, error) { 13542 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 13543 var body io.Reader = nil 13544 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphaimportcompletiondatarequest) 13545 if err != nil { 13546 return nil, err 13547 } 13548 c.urlParams_.Set("alt", alt) 13549 c.urlParams_.Set("prettyPrint", "false") 13550 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+parent}/completionData:import") 13551 urls += "?" + c.urlParams_.Encode() 13552 req, err := http.NewRequest("POST", urls, body) 13553 if err != nil { 13554 return nil, err 13555 } 13556 req.Header = reqHeaders 13557 googleapi.Expand(req.URL, map[string]string{ 13558 "parent": c.parent, 13559 }) 13560 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13561 } 13562 13563 // Do executes the "retail.projects.locations.catalogs.completionData.import" call. 13564 // Any non-2xx status code is an error. Response headers are in either 13565 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was 13566 // returned at all) in error.(*googleapi.Error).Header. Use 13567 // googleapi.IsNotModified to check whether the returned error was because 13568 // http.StatusNotModified was returned. 13569 func (c *ProjectsLocationsCatalogsCompletionDataImportCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 13570 gensupport.SetOptions(c.urlParams_, opts...) 13571 res, err := c.doRequest("json") 13572 if res != nil && res.StatusCode == http.StatusNotModified { 13573 if res.Body != nil { 13574 res.Body.Close() 13575 } 13576 return nil, gensupport.WrapError(&googleapi.Error{ 13577 Code: res.StatusCode, 13578 Header: res.Header, 13579 }) 13580 } 13581 if err != nil { 13582 return nil, err 13583 } 13584 defer googleapi.CloseBody(res) 13585 if err := googleapi.CheckResponse(res); err != nil { 13586 return nil, gensupport.WrapError(err) 13587 } 13588 ret := &GoogleLongrunningOperation{ 13589 ServerResponse: googleapi.ServerResponse{ 13590 Header: res.Header, 13591 HTTPStatusCode: res.StatusCode, 13592 }, 13593 } 13594 target := &ret 13595 if err := gensupport.DecodeResponse(target, res); err != nil { 13596 return nil, err 13597 } 13598 return ret, nil 13599 } 13600 13601 type ProjectsLocationsCatalogsControlsCreateCall struct { 13602 s *Service 13603 parent string 13604 googlecloudretailv2alphacontrol *GoogleCloudRetailV2alphaControl 13605 urlParams_ gensupport.URLParams 13606 ctx_ context.Context 13607 header_ http.Header 13608 } 13609 13610 // Create: Creates a Control. If the Control to create already exists, an 13611 // ALREADY_EXISTS error is returned. 13612 // 13613 // - parent: Full resource name of parent catalog. Format: 13614 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`. 13615 func (r *ProjectsLocationsCatalogsControlsService) Create(parent string, googlecloudretailv2alphacontrol *GoogleCloudRetailV2alphaControl) *ProjectsLocationsCatalogsControlsCreateCall { 13616 c := &ProjectsLocationsCatalogsControlsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13617 c.parent = parent 13618 c.googlecloudretailv2alphacontrol = googlecloudretailv2alphacontrol 13619 return c 13620 } 13621 13622 // ControlId sets the optional parameter "controlId": Required. The ID to use 13623 // for the Control, which will become the final component of the Control's 13624 // resource name. This value should be 4-63 characters, and valid characters 13625 // are /a-z-_/. 13626 func (c *ProjectsLocationsCatalogsControlsCreateCall) ControlId(controlId string) *ProjectsLocationsCatalogsControlsCreateCall { 13627 c.urlParams_.Set("controlId", controlId) 13628 return c 13629 } 13630 13631 // Fields allows partial responses to be retrieved. See 13632 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 13633 // details. 13634 func (c *ProjectsLocationsCatalogsControlsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsControlsCreateCall { 13635 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13636 return c 13637 } 13638 13639 // Context sets the context to be used in this call's Do method. 13640 func (c *ProjectsLocationsCatalogsControlsCreateCall) Context(ctx context.Context) *ProjectsLocationsCatalogsControlsCreateCall { 13641 c.ctx_ = ctx 13642 return c 13643 } 13644 13645 // Header returns a http.Header that can be modified by the caller to add 13646 // headers to the request. 13647 func (c *ProjectsLocationsCatalogsControlsCreateCall) Header() http.Header { 13648 if c.header_ == nil { 13649 c.header_ = make(http.Header) 13650 } 13651 return c.header_ 13652 } 13653 13654 func (c *ProjectsLocationsCatalogsControlsCreateCall) doRequest(alt string) (*http.Response, error) { 13655 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 13656 var body io.Reader = nil 13657 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphacontrol) 13658 if err != nil { 13659 return nil, err 13660 } 13661 c.urlParams_.Set("alt", alt) 13662 c.urlParams_.Set("prettyPrint", "false") 13663 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+parent}/controls") 13664 urls += "?" + c.urlParams_.Encode() 13665 req, err := http.NewRequest("POST", urls, body) 13666 if err != nil { 13667 return nil, err 13668 } 13669 req.Header = reqHeaders 13670 googleapi.Expand(req.URL, map[string]string{ 13671 "parent": c.parent, 13672 }) 13673 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13674 } 13675 13676 // Do executes the "retail.projects.locations.catalogs.controls.create" call. 13677 // Any non-2xx status code is an error. Response headers are in either 13678 // *GoogleCloudRetailV2alphaControl.ServerResponse.Header or (if a response was 13679 // returned at all) in error.(*googleapi.Error).Header. Use 13680 // googleapi.IsNotModified to check whether the returned error was because 13681 // http.StatusNotModified was returned. 13682 func (c *ProjectsLocationsCatalogsControlsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2alphaControl, error) { 13683 gensupport.SetOptions(c.urlParams_, opts...) 13684 res, err := c.doRequest("json") 13685 if res != nil && res.StatusCode == http.StatusNotModified { 13686 if res.Body != nil { 13687 res.Body.Close() 13688 } 13689 return nil, gensupport.WrapError(&googleapi.Error{ 13690 Code: res.StatusCode, 13691 Header: res.Header, 13692 }) 13693 } 13694 if err != nil { 13695 return nil, err 13696 } 13697 defer googleapi.CloseBody(res) 13698 if err := googleapi.CheckResponse(res); err != nil { 13699 return nil, gensupport.WrapError(err) 13700 } 13701 ret := &GoogleCloudRetailV2alphaControl{ 13702 ServerResponse: googleapi.ServerResponse{ 13703 Header: res.Header, 13704 HTTPStatusCode: res.StatusCode, 13705 }, 13706 } 13707 target := &ret 13708 if err := gensupport.DecodeResponse(target, res); err != nil { 13709 return nil, err 13710 } 13711 return ret, nil 13712 } 13713 13714 type ProjectsLocationsCatalogsControlsDeleteCall struct { 13715 s *Service 13716 name string 13717 urlParams_ gensupport.URLParams 13718 ctx_ context.Context 13719 header_ http.Header 13720 } 13721 13722 // Delete: Deletes a Control. If the Control to delete does not exist, a 13723 // NOT_FOUND error is returned. 13724 // 13725 // - name: The resource name of the Control to delete. Format: 13726 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/co 13727 // ntrols/{control_id}`. 13728 func (r *ProjectsLocationsCatalogsControlsService) Delete(name string) *ProjectsLocationsCatalogsControlsDeleteCall { 13729 c := &ProjectsLocationsCatalogsControlsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13730 c.name = name 13731 return c 13732 } 13733 13734 // Fields allows partial responses to be retrieved. See 13735 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 13736 // details. 13737 func (c *ProjectsLocationsCatalogsControlsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsControlsDeleteCall { 13738 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13739 return c 13740 } 13741 13742 // Context sets the context to be used in this call's Do method. 13743 func (c *ProjectsLocationsCatalogsControlsDeleteCall) Context(ctx context.Context) *ProjectsLocationsCatalogsControlsDeleteCall { 13744 c.ctx_ = ctx 13745 return c 13746 } 13747 13748 // Header returns a http.Header that can be modified by the caller to add 13749 // headers to the request. 13750 func (c *ProjectsLocationsCatalogsControlsDeleteCall) Header() http.Header { 13751 if c.header_ == nil { 13752 c.header_ = make(http.Header) 13753 } 13754 return c.header_ 13755 } 13756 13757 func (c *ProjectsLocationsCatalogsControlsDeleteCall) doRequest(alt string) (*http.Response, error) { 13758 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 13759 var body io.Reader = nil 13760 c.urlParams_.Set("alt", alt) 13761 c.urlParams_.Set("prettyPrint", "false") 13762 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") 13763 urls += "?" + c.urlParams_.Encode() 13764 req, err := http.NewRequest("DELETE", urls, body) 13765 if err != nil { 13766 return nil, err 13767 } 13768 req.Header = reqHeaders 13769 googleapi.Expand(req.URL, map[string]string{ 13770 "name": c.name, 13771 }) 13772 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13773 } 13774 13775 // Do executes the "retail.projects.locations.catalogs.controls.delete" call. 13776 // Any non-2xx status code is an error. Response headers are in either 13777 // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at 13778 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 13779 // check whether the returned error was because http.StatusNotModified was 13780 // returned. 13781 func (c *ProjectsLocationsCatalogsControlsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { 13782 gensupport.SetOptions(c.urlParams_, opts...) 13783 res, err := c.doRequest("json") 13784 if res != nil && res.StatusCode == http.StatusNotModified { 13785 if res.Body != nil { 13786 res.Body.Close() 13787 } 13788 return nil, gensupport.WrapError(&googleapi.Error{ 13789 Code: res.StatusCode, 13790 Header: res.Header, 13791 }) 13792 } 13793 if err != nil { 13794 return nil, err 13795 } 13796 defer googleapi.CloseBody(res) 13797 if err := googleapi.CheckResponse(res); err != nil { 13798 return nil, gensupport.WrapError(err) 13799 } 13800 ret := &GoogleProtobufEmpty{ 13801 ServerResponse: googleapi.ServerResponse{ 13802 Header: res.Header, 13803 HTTPStatusCode: res.StatusCode, 13804 }, 13805 } 13806 target := &ret 13807 if err := gensupport.DecodeResponse(target, res); err != nil { 13808 return nil, err 13809 } 13810 return ret, nil 13811 } 13812 13813 type ProjectsLocationsCatalogsControlsGetCall struct { 13814 s *Service 13815 name string 13816 urlParams_ gensupport.URLParams 13817 ifNoneMatch_ string 13818 ctx_ context.Context 13819 header_ http.Header 13820 } 13821 13822 // Get: Gets a Control. 13823 // 13824 // - name: The resource name of the Control to get. Format: 13825 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/co 13826 // ntrols/{control_id}`. 13827 func (r *ProjectsLocationsCatalogsControlsService) Get(name string) *ProjectsLocationsCatalogsControlsGetCall { 13828 c := &ProjectsLocationsCatalogsControlsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13829 c.name = name 13830 return c 13831 } 13832 13833 // Fields allows partial responses to be retrieved. See 13834 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 13835 // details. 13836 func (c *ProjectsLocationsCatalogsControlsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsControlsGetCall { 13837 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13838 return c 13839 } 13840 13841 // IfNoneMatch sets an optional parameter which makes the operation fail if the 13842 // object's ETag matches the given value. This is useful for getting updates 13843 // only after the object has changed since the last request. 13844 func (c *ProjectsLocationsCatalogsControlsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsControlsGetCall { 13845 c.ifNoneMatch_ = entityTag 13846 return c 13847 } 13848 13849 // Context sets the context to be used in this call's Do method. 13850 func (c *ProjectsLocationsCatalogsControlsGetCall) Context(ctx context.Context) *ProjectsLocationsCatalogsControlsGetCall { 13851 c.ctx_ = ctx 13852 return c 13853 } 13854 13855 // Header returns a http.Header that can be modified by the caller to add 13856 // headers to the request. 13857 func (c *ProjectsLocationsCatalogsControlsGetCall) Header() http.Header { 13858 if c.header_ == nil { 13859 c.header_ = make(http.Header) 13860 } 13861 return c.header_ 13862 } 13863 13864 func (c *ProjectsLocationsCatalogsControlsGetCall) doRequest(alt string) (*http.Response, error) { 13865 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 13866 if c.ifNoneMatch_ != "" { 13867 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 13868 } 13869 var body io.Reader = nil 13870 c.urlParams_.Set("alt", alt) 13871 c.urlParams_.Set("prettyPrint", "false") 13872 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") 13873 urls += "?" + c.urlParams_.Encode() 13874 req, err := http.NewRequest("GET", urls, body) 13875 if err != nil { 13876 return nil, err 13877 } 13878 req.Header = reqHeaders 13879 googleapi.Expand(req.URL, map[string]string{ 13880 "name": c.name, 13881 }) 13882 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13883 } 13884 13885 // Do executes the "retail.projects.locations.catalogs.controls.get" call. 13886 // Any non-2xx status code is an error. Response headers are in either 13887 // *GoogleCloudRetailV2alphaControl.ServerResponse.Header or (if a response was 13888 // returned at all) in error.(*googleapi.Error).Header. Use 13889 // googleapi.IsNotModified to check whether the returned error was because 13890 // http.StatusNotModified was returned. 13891 func (c *ProjectsLocationsCatalogsControlsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2alphaControl, error) { 13892 gensupport.SetOptions(c.urlParams_, opts...) 13893 res, err := c.doRequest("json") 13894 if res != nil && res.StatusCode == http.StatusNotModified { 13895 if res.Body != nil { 13896 res.Body.Close() 13897 } 13898 return nil, gensupport.WrapError(&googleapi.Error{ 13899 Code: res.StatusCode, 13900 Header: res.Header, 13901 }) 13902 } 13903 if err != nil { 13904 return nil, err 13905 } 13906 defer googleapi.CloseBody(res) 13907 if err := googleapi.CheckResponse(res); err != nil { 13908 return nil, gensupport.WrapError(err) 13909 } 13910 ret := &GoogleCloudRetailV2alphaControl{ 13911 ServerResponse: googleapi.ServerResponse{ 13912 Header: res.Header, 13913 HTTPStatusCode: res.StatusCode, 13914 }, 13915 } 13916 target := &ret 13917 if err := gensupport.DecodeResponse(target, res); err != nil { 13918 return nil, err 13919 } 13920 return ret, nil 13921 } 13922 13923 type ProjectsLocationsCatalogsControlsListCall struct { 13924 s *Service 13925 parent string 13926 urlParams_ gensupport.URLParams 13927 ifNoneMatch_ string 13928 ctx_ context.Context 13929 header_ http.Header 13930 } 13931 13932 // List: Lists all Controls by their parent Catalog. 13933 // 13934 // - parent: The catalog resource name. Format: 13935 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`. 13936 func (r *ProjectsLocationsCatalogsControlsService) List(parent string) *ProjectsLocationsCatalogsControlsListCall { 13937 c := &ProjectsLocationsCatalogsControlsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13938 c.parent = parent 13939 return c 13940 } 13941 13942 // Filter sets the optional parameter "filter": A filter to apply on the list 13943 // results. Supported features: * List all the products under the parent branch 13944 // if filter is unset. * List controls that are used in a single ServingConfig: 13945 // 'serving_config = "boosted_home_page_cvr"' 13946 func (c *ProjectsLocationsCatalogsControlsListCall) Filter(filter string) *ProjectsLocationsCatalogsControlsListCall { 13947 c.urlParams_.Set("filter", filter) 13948 return c 13949 } 13950 13951 // PageSize sets the optional parameter "pageSize": Maximum number of results 13952 // to return. If unspecified, defaults to 50. Max allowed value is 1000. 13953 func (c *ProjectsLocationsCatalogsControlsListCall) PageSize(pageSize int64) *ProjectsLocationsCatalogsControlsListCall { 13954 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 13955 return c 13956 } 13957 13958 // PageToken sets the optional parameter "pageToken": A page token, received 13959 // from a previous `ListControls` call. Provide this to retrieve the subsequent 13960 // page. 13961 func (c *ProjectsLocationsCatalogsControlsListCall) PageToken(pageToken string) *ProjectsLocationsCatalogsControlsListCall { 13962 c.urlParams_.Set("pageToken", pageToken) 13963 return c 13964 } 13965 13966 // Fields allows partial responses to be retrieved. See 13967 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 13968 // details. 13969 func (c *ProjectsLocationsCatalogsControlsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsControlsListCall { 13970 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13971 return c 13972 } 13973 13974 // IfNoneMatch sets an optional parameter which makes the operation fail if the 13975 // object's ETag matches the given value. This is useful for getting updates 13976 // only after the object has changed since the last request. 13977 func (c *ProjectsLocationsCatalogsControlsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsControlsListCall { 13978 c.ifNoneMatch_ = entityTag 13979 return c 13980 } 13981 13982 // Context sets the context to be used in this call's Do method. 13983 func (c *ProjectsLocationsCatalogsControlsListCall) Context(ctx context.Context) *ProjectsLocationsCatalogsControlsListCall { 13984 c.ctx_ = ctx 13985 return c 13986 } 13987 13988 // Header returns a http.Header that can be modified by the caller to add 13989 // headers to the request. 13990 func (c *ProjectsLocationsCatalogsControlsListCall) Header() http.Header { 13991 if c.header_ == nil { 13992 c.header_ = make(http.Header) 13993 } 13994 return c.header_ 13995 } 13996 13997 func (c *ProjectsLocationsCatalogsControlsListCall) doRequest(alt string) (*http.Response, error) { 13998 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 13999 if c.ifNoneMatch_ != "" { 14000 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 14001 } 14002 var body io.Reader = nil 14003 c.urlParams_.Set("alt", alt) 14004 c.urlParams_.Set("prettyPrint", "false") 14005 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+parent}/controls") 14006 urls += "?" + c.urlParams_.Encode() 14007 req, err := http.NewRequest("GET", urls, body) 14008 if err != nil { 14009 return nil, err 14010 } 14011 req.Header = reqHeaders 14012 googleapi.Expand(req.URL, map[string]string{ 14013 "parent": c.parent, 14014 }) 14015 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14016 } 14017 14018 // Do executes the "retail.projects.locations.catalogs.controls.list" call. 14019 // Any non-2xx status code is an error. Response headers are in either 14020 // *GoogleCloudRetailV2alphaListControlsResponse.ServerResponse.Header or (if a 14021 // response was returned at all) in error.(*googleapi.Error).Header. Use 14022 // googleapi.IsNotModified to check whether the returned error was because 14023 // http.StatusNotModified was returned. 14024 func (c *ProjectsLocationsCatalogsControlsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2alphaListControlsResponse, error) { 14025 gensupport.SetOptions(c.urlParams_, opts...) 14026 res, err := c.doRequest("json") 14027 if res != nil && res.StatusCode == http.StatusNotModified { 14028 if res.Body != nil { 14029 res.Body.Close() 14030 } 14031 return nil, gensupport.WrapError(&googleapi.Error{ 14032 Code: res.StatusCode, 14033 Header: res.Header, 14034 }) 14035 } 14036 if err != nil { 14037 return nil, err 14038 } 14039 defer googleapi.CloseBody(res) 14040 if err := googleapi.CheckResponse(res); err != nil { 14041 return nil, gensupport.WrapError(err) 14042 } 14043 ret := &GoogleCloudRetailV2alphaListControlsResponse{ 14044 ServerResponse: googleapi.ServerResponse{ 14045 Header: res.Header, 14046 HTTPStatusCode: res.StatusCode, 14047 }, 14048 } 14049 target := &ret 14050 if err := gensupport.DecodeResponse(target, res); err != nil { 14051 return nil, err 14052 } 14053 return ret, nil 14054 } 14055 14056 // Pages invokes f for each page of results. 14057 // A non-nil error returned from f will halt the iteration. 14058 // The provided context supersedes any context provided to the Context method. 14059 func (c *ProjectsLocationsCatalogsControlsListCall) Pages(ctx context.Context, f func(*GoogleCloudRetailV2alphaListControlsResponse) error) error { 14060 c.ctx_ = ctx 14061 defer c.PageToken(c.urlParams_.Get("pageToken")) 14062 for { 14063 x, err := c.Do() 14064 if err != nil { 14065 return err 14066 } 14067 if err := f(x); err != nil { 14068 return err 14069 } 14070 if x.NextPageToken == "" { 14071 return nil 14072 } 14073 c.PageToken(x.NextPageToken) 14074 } 14075 } 14076 14077 type ProjectsLocationsCatalogsControlsPatchCall struct { 14078 s *Service 14079 name string 14080 googlecloudretailv2alphacontrol *GoogleCloudRetailV2alphaControl 14081 urlParams_ gensupport.URLParams 14082 ctx_ context.Context 14083 header_ http.Header 14084 } 14085 14086 // Patch: Updates a Control. Control cannot be set to a different oneof field, 14087 // if so an INVALID_ARGUMENT is returned. If the Control to update does not 14088 // exist, a NOT_FOUND error is returned. 14089 // 14090 // - name: Immutable. Fully qualified name 14091 // `projects/*/locations/global/catalogs/*/controls/*`. 14092 func (r *ProjectsLocationsCatalogsControlsService) Patch(name string, googlecloudretailv2alphacontrol *GoogleCloudRetailV2alphaControl) *ProjectsLocationsCatalogsControlsPatchCall { 14093 c := &ProjectsLocationsCatalogsControlsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14094 c.name = name 14095 c.googlecloudretailv2alphacontrol = googlecloudretailv2alphacontrol 14096 return c 14097 } 14098 14099 // UpdateMask sets the optional parameter "updateMask": Indicates which fields 14100 // in the provided Control to update. The following are NOT supported: * 14101 // Control.name If not set or empty, all supported fields are updated. 14102 func (c *ProjectsLocationsCatalogsControlsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsCatalogsControlsPatchCall { 14103 c.urlParams_.Set("updateMask", updateMask) 14104 return c 14105 } 14106 14107 // Fields allows partial responses to be retrieved. See 14108 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 14109 // details. 14110 func (c *ProjectsLocationsCatalogsControlsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsControlsPatchCall { 14111 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14112 return c 14113 } 14114 14115 // Context sets the context to be used in this call's Do method. 14116 func (c *ProjectsLocationsCatalogsControlsPatchCall) Context(ctx context.Context) *ProjectsLocationsCatalogsControlsPatchCall { 14117 c.ctx_ = ctx 14118 return c 14119 } 14120 14121 // Header returns a http.Header that can be modified by the caller to add 14122 // headers to the request. 14123 func (c *ProjectsLocationsCatalogsControlsPatchCall) Header() http.Header { 14124 if c.header_ == nil { 14125 c.header_ = make(http.Header) 14126 } 14127 return c.header_ 14128 } 14129 14130 func (c *ProjectsLocationsCatalogsControlsPatchCall) doRequest(alt string) (*http.Response, error) { 14131 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 14132 var body io.Reader = nil 14133 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphacontrol) 14134 if err != nil { 14135 return nil, err 14136 } 14137 c.urlParams_.Set("alt", alt) 14138 c.urlParams_.Set("prettyPrint", "false") 14139 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") 14140 urls += "?" + c.urlParams_.Encode() 14141 req, err := http.NewRequest("PATCH", urls, body) 14142 if err != nil { 14143 return nil, err 14144 } 14145 req.Header = reqHeaders 14146 googleapi.Expand(req.URL, map[string]string{ 14147 "name": c.name, 14148 }) 14149 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14150 } 14151 14152 // Do executes the "retail.projects.locations.catalogs.controls.patch" call. 14153 // Any non-2xx status code is an error. Response headers are in either 14154 // *GoogleCloudRetailV2alphaControl.ServerResponse.Header or (if a response was 14155 // returned at all) in error.(*googleapi.Error).Header. Use 14156 // googleapi.IsNotModified to check whether the returned error was because 14157 // http.StatusNotModified was returned. 14158 func (c *ProjectsLocationsCatalogsControlsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2alphaControl, error) { 14159 gensupport.SetOptions(c.urlParams_, opts...) 14160 res, err := c.doRequest("json") 14161 if res != nil && res.StatusCode == http.StatusNotModified { 14162 if res.Body != nil { 14163 res.Body.Close() 14164 } 14165 return nil, gensupport.WrapError(&googleapi.Error{ 14166 Code: res.StatusCode, 14167 Header: res.Header, 14168 }) 14169 } 14170 if err != nil { 14171 return nil, err 14172 } 14173 defer googleapi.CloseBody(res) 14174 if err := googleapi.CheckResponse(res); err != nil { 14175 return nil, gensupport.WrapError(err) 14176 } 14177 ret := &GoogleCloudRetailV2alphaControl{ 14178 ServerResponse: googleapi.ServerResponse{ 14179 Header: res.Header, 14180 HTTPStatusCode: res.StatusCode, 14181 }, 14182 } 14183 target := &ret 14184 if err := gensupport.DecodeResponse(target, res); err != nil { 14185 return nil, err 14186 } 14187 return ret, nil 14188 } 14189 14190 type ProjectsLocationsCatalogsMerchantCenterAccountLinksCreateCall struct { 14191 s *Service 14192 parent string 14193 googlecloudretailv2alphamerchantcenteraccountlink *GoogleCloudRetailV2alphaMerchantCenterAccountLink 14194 urlParams_ gensupport.URLParams 14195 ctx_ context.Context 14196 header_ http.Header 14197 } 14198 14199 // Create: Creates a MerchantCenterAccountLink. 14200 // 14201 // - parent: The branch resource where this MerchantCenterAccountLink will be 14202 // created. Format: 14203 // `projects/{PROJECT_NUMBER}/locations/global/catalogs/{CATALOG_ID}`. 14204 func (r *ProjectsLocationsCatalogsMerchantCenterAccountLinksService) Create(parent string, googlecloudretailv2alphamerchantcenteraccountlink *GoogleCloudRetailV2alphaMerchantCenterAccountLink) *ProjectsLocationsCatalogsMerchantCenterAccountLinksCreateCall { 14205 c := &ProjectsLocationsCatalogsMerchantCenterAccountLinksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14206 c.parent = parent 14207 c.googlecloudretailv2alphamerchantcenteraccountlink = googlecloudretailv2alphamerchantcenteraccountlink 14208 return c 14209 } 14210 14211 // Fields allows partial responses to be retrieved. See 14212 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 14213 // details. 14214 func (c *ProjectsLocationsCatalogsMerchantCenterAccountLinksCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsMerchantCenterAccountLinksCreateCall { 14215 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14216 return c 14217 } 14218 14219 // Context sets the context to be used in this call's Do method. 14220 func (c *ProjectsLocationsCatalogsMerchantCenterAccountLinksCreateCall) Context(ctx context.Context) *ProjectsLocationsCatalogsMerchantCenterAccountLinksCreateCall { 14221 c.ctx_ = ctx 14222 return c 14223 } 14224 14225 // Header returns a http.Header that can be modified by the caller to add 14226 // headers to the request. 14227 func (c *ProjectsLocationsCatalogsMerchantCenterAccountLinksCreateCall) Header() http.Header { 14228 if c.header_ == nil { 14229 c.header_ = make(http.Header) 14230 } 14231 return c.header_ 14232 } 14233 14234 func (c *ProjectsLocationsCatalogsMerchantCenterAccountLinksCreateCall) doRequest(alt string) (*http.Response, error) { 14235 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 14236 var body io.Reader = nil 14237 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphamerchantcenteraccountlink) 14238 if err != nil { 14239 return nil, err 14240 } 14241 c.urlParams_.Set("alt", alt) 14242 c.urlParams_.Set("prettyPrint", "false") 14243 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+parent}/merchantCenterAccountLinks") 14244 urls += "?" + c.urlParams_.Encode() 14245 req, err := http.NewRequest("POST", urls, body) 14246 if err != nil { 14247 return nil, err 14248 } 14249 req.Header = reqHeaders 14250 googleapi.Expand(req.URL, map[string]string{ 14251 "parent": c.parent, 14252 }) 14253 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14254 } 14255 14256 // Do executes the "retail.projects.locations.catalogs.merchantCenterAccountLinks.create" call. 14257 // Any non-2xx status code is an error. Response headers are in either 14258 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was 14259 // returned at all) in error.(*googleapi.Error).Header. Use 14260 // googleapi.IsNotModified to check whether the returned error was because 14261 // http.StatusNotModified was returned. 14262 func (c *ProjectsLocationsCatalogsMerchantCenterAccountLinksCreateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 14263 gensupport.SetOptions(c.urlParams_, opts...) 14264 res, err := c.doRequest("json") 14265 if res != nil && res.StatusCode == http.StatusNotModified { 14266 if res.Body != nil { 14267 res.Body.Close() 14268 } 14269 return nil, gensupport.WrapError(&googleapi.Error{ 14270 Code: res.StatusCode, 14271 Header: res.Header, 14272 }) 14273 } 14274 if err != nil { 14275 return nil, err 14276 } 14277 defer googleapi.CloseBody(res) 14278 if err := googleapi.CheckResponse(res); err != nil { 14279 return nil, gensupport.WrapError(err) 14280 } 14281 ret := &GoogleLongrunningOperation{ 14282 ServerResponse: googleapi.ServerResponse{ 14283 Header: res.Header, 14284 HTTPStatusCode: res.StatusCode, 14285 }, 14286 } 14287 target := &ret 14288 if err := gensupport.DecodeResponse(target, res); err != nil { 14289 return nil, err 14290 } 14291 return ret, nil 14292 } 14293 14294 type ProjectsLocationsCatalogsMerchantCenterAccountLinksDeleteCall struct { 14295 s *Service 14296 name string 14297 urlParams_ gensupport.URLParams 14298 ctx_ context.Context 14299 header_ http.Header 14300 } 14301 14302 // Delete: Deletes a MerchantCenterAccountLink. If the 14303 // MerchantCenterAccountLink to delete does not exist, a NOT_FOUND error is 14304 // returned. 14305 // 14306 // - name: Full resource name. Format: 14307 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/me 14308 // rchantCenterAccountLinks/{merchant_center_account_link_id}`. 14309 func (r *ProjectsLocationsCatalogsMerchantCenterAccountLinksService) Delete(name string) *ProjectsLocationsCatalogsMerchantCenterAccountLinksDeleteCall { 14310 c := &ProjectsLocationsCatalogsMerchantCenterAccountLinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14311 c.name = name 14312 return c 14313 } 14314 14315 // Fields allows partial responses to be retrieved. See 14316 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 14317 // details. 14318 func (c *ProjectsLocationsCatalogsMerchantCenterAccountLinksDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsMerchantCenterAccountLinksDeleteCall { 14319 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14320 return c 14321 } 14322 14323 // Context sets the context to be used in this call's Do method. 14324 func (c *ProjectsLocationsCatalogsMerchantCenterAccountLinksDeleteCall) Context(ctx context.Context) *ProjectsLocationsCatalogsMerchantCenterAccountLinksDeleteCall { 14325 c.ctx_ = ctx 14326 return c 14327 } 14328 14329 // Header returns a http.Header that can be modified by the caller to add 14330 // headers to the request. 14331 func (c *ProjectsLocationsCatalogsMerchantCenterAccountLinksDeleteCall) Header() http.Header { 14332 if c.header_ == nil { 14333 c.header_ = make(http.Header) 14334 } 14335 return c.header_ 14336 } 14337 14338 func (c *ProjectsLocationsCatalogsMerchantCenterAccountLinksDeleteCall) doRequest(alt string) (*http.Response, error) { 14339 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 14340 var body io.Reader = nil 14341 c.urlParams_.Set("alt", alt) 14342 c.urlParams_.Set("prettyPrint", "false") 14343 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") 14344 urls += "?" + c.urlParams_.Encode() 14345 req, err := http.NewRequest("DELETE", urls, body) 14346 if err != nil { 14347 return nil, err 14348 } 14349 req.Header = reqHeaders 14350 googleapi.Expand(req.URL, map[string]string{ 14351 "name": c.name, 14352 }) 14353 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14354 } 14355 14356 // Do executes the "retail.projects.locations.catalogs.merchantCenterAccountLinks.delete" call. 14357 // Any non-2xx status code is an error. Response headers are in either 14358 // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at 14359 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 14360 // check whether the returned error was because http.StatusNotModified was 14361 // returned. 14362 func (c *ProjectsLocationsCatalogsMerchantCenterAccountLinksDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { 14363 gensupport.SetOptions(c.urlParams_, opts...) 14364 res, err := c.doRequest("json") 14365 if res != nil && res.StatusCode == http.StatusNotModified { 14366 if res.Body != nil { 14367 res.Body.Close() 14368 } 14369 return nil, gensupport.WrapError(&googleapi.Error{ 14370 Code: res.StatusCode, 14371 Header: res.Header, 14372 }) 14373 } 14374 if err != nil { 14375 return nil, err 14376 } 14377 defer googleapi.CloseBody(res) 14378 if err := googleapi.CheckResponse(res); err != nil { 14379 return nil, gensupport.WrapError(err) 14380 } 14381 ret := &GoogleProtobufEmpty{ 14382 ServerResponse: googleapi.ServerResponse{ 14383 Header: res.Header, 14384 HTTPStatusCode: res.StatusCode, 14385 }, 14386 } 14387 target := &ret 14388 if err := gensupport.DecodeResponse(target, res); err != nil { 14389 return nil, err 14390 } 14391 return ret, nil 14392 } 14393 14394 type ProjectsLocationsCatalogsMerchantCenterAccountLinksListCall struct { 14395 s *Service 14396 parent string 14397 urlParams_ gensupport.URLParams 14398 ifNoneMatch_ string 14399 ctx_ context.Context 14400 header_ http.Header 14401 } 14402 14403 // List: Lists all MerchantCenterAccountLinks under the specified parent 14404 // Catalog. 14405 // 14406 // - parent: The parent Catalog of the resource. It must match this format: 14407 // `projects/{PROJECT_NUMBER}/locations/global/catalogs/{CATALOG_ID}`. 14408 func (r *ProjectsLocationsCatalogsMerchantCenterAccountLinksService) List(parent string) *ProjectsLocationsCatalogsMerchantCenterAccountLinksListCall { 14409 c := &ProjectsLocationsCatalogsMerchantCenterAccountLinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14410 c.parent = parent 14411 return c 14412 } 14413 14414 // Fields allows partial responses to be retrieved. See 14415 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 14416 // details. 14417 func (c *ProjectsLocationsCatalogsMerchantCenterAccountLinksListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsMerchantCenterAccountLinksListCall { 14418 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14419 return c 14420 } 14421 14422 // IfNoneMatch sets an optional parameter which makes the operation fail if the 14423 // object's ETag matches the given value. This is useful for getting updates 14424 // only after the object has changed since the last request. 14425 func (c *ProjectsLocationsCatalogsMerchantCenterAccountLinksListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsMerchantCenterAccountLinksListCall { 14426 c.ifNoneMatch_ = entityTag 14427 return c 14428 } 14429 14430 // Context sets the context to be used in this call's Do method. 14431 func (c *ProjectsLocationsCatalogsMerchantCenterAccountLinksListCall) Context(ctx context.Context) *ProjectsLocationsCatalogsMerchantCenterAccountLinksListCall { 14432 c.ctx_ = ctx 14433 return c 14434 } 14435 14436 // Header returns a http.Header that can be modified by the caller to add 14437 // headers to the request. 14438 func (c *ProjectsLocationsCatalogsMerchantCenterAccountLinksListCall) Header() http.Header { 14439 if c.header_ == nil { 14440 c.header_ = make(http.Header) 14441 } 14442 return c.header_ 14443 } 14444 14445 func (c *ProjectsLocationsCatalogsMerchantCenterAccountLinksListCall) doRequest(alt string) (*http.Response, error) { 14446 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 14447 if c.ifNoneMatch_ != "" { 14448 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 14449 } 14450 var body io.Reader = nil 14451 c.urlParams_.Set("alt", alt) 14452 c.urlParams_.Set("prettyPrint", "false") 14453 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+parent}/merchantCenterAccountLinks") 14454 urls += "?" + c.urlParams_.Encode() 14455 req, err := http.NewRequest("GET", urls, body) 14456 if err != nil { 14457 return nil, err 14458 } 14459 req.Header = reqHeaders 14460 googleapi.Expand(req.URL, map[string]string{ 14461 "parent": c.parent, 14462 }) 14463 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14464 } 14465 14466 // Do executes the "retail.projects.locations.catalogs.merchantCenterAccountLinks.list" call. 14467 // Any non-2xx status code is an error. Response headers are in either 14468 // *GoogleCloudRetailV2alphaListMerchantCenterAccountLinksResponse.ServerRespons 14469 // e.Header or (if a response was returned at all) in 14470 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 14471 // whether the returned error was because http.StatusNotModified was returned. 14472 func (c *ProjectsLocationsCatalogsMerchantCenterAccountLinksListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2alphaListMerchantCenterAccountLinksResponse, error) { 14473 gensupport.SetOptions(c.urlParams_, opts...) 14474 res, err := c.doRequest("json") 14475 if res != nil && res.StatusCode == http.StatusNotModified { 14476 if res.Body != nil { 14477 res.Body.Close() 14478 } 14479 return nil, gensupport.WrapError(&googleapi.Error{ 14480 Code: res.StatusCode, 14481 Header: res.Header, 14482 }) 14483 } 14484 if err != nil { 14485 return nil, err 14486 } 14487 defer googleapi.CloseBody(res) 14488 if err := googleapi.CheckResponse(res); err != nil { 14489 return nil, gensupport.WrapError(err) 14490 } 14491 ret := &GoogleCloudRetailV2alphaListMerchantCenterAccountLinksResponse{ 14492 ServerResponse: googleapi.ServerResponse{ 14493 Header: res.Header, 14494 HTTPStatusCode: res.StatusCode, 14495 }, 14496 } 14497 target := &ret 14498 if err := gensupport.DecodeResponse(target, res); err != nil { 14499 return nil, err 14500 } 14501 return ret, nil 14502 } 14503 14504 type ProjectsLocationsCatalogsModelsCreateCall struct { 14505 s *Service 14506 parent string 14507 googlecloudretailv2alphamodel *GoogleCloudRetailV2alphaModel 14508 urlParams_ gensupport.URLParams 14509 ctx_ context.Context 14510 header_ http.Header 14511 } 14512 14513 // Create: Creates a new model. 14514 // 14515 // - parent: The parent resource under which to create the model. Format: 14516 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`. 14517 func (r *ProjectsLocationsCatalogsModelsService) Create(parent string, googlecloudretailv2alphamodel *GoogleCloudRetailV2alphaModel) *ProjectsLocationsCatalogsModelsCreateCall { 14518 c := &ProjectsLocationsCatalogsModelsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14519 c.parent = parent 14520 c.googlecloudretailv2alphamodel = googlecloudretailv2alphamodel 14521 return c 14522 } 14523 14524 // DryRun sets the optional parameter "dryRun": Whether to run a dry run to 14525 // validate the request (without actually creating the model). 14526 func (c *ProjectsLocationsCatalogsModelsCreateCall) DryRun(dryRun bool) *ProjectsLocationsCatalogsModelsCreateCall { 14527 c.urlParams_.Set("dryRun", fmt.Sprint(dryRun)) 14528 return c 14529 } 14530 14531 // Fields allows partial responses to be retrieved. See 14532 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 14533 // details. 14534 func (c *ProjectsLocationsCatalogsModelsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsModelsCreateCall { 14535 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14536 return c 14537 } 14538 14539 // Context sets the context to be used in this call's Do method. 14540 func (c *ProjectsLocationsCatalogsModelsCreateCall) Context(ctx context.Context) *ProjectsLocationsCatalogsModelsCreateCall { 14541 c.ctx_ = ctx 14542 return c 14543 } 14544 14545 // Header returns a http.Header that can be modified by the caller to add 14546 // headers to the request. 14547 func (c *ProjectsLocationsCatalogsModelsCreateCall) Header() http.Header { 14548 if c.header_ == nil { 14549 c.header_ = make(http.Header) 14550 } 14551 return c.header_ 14552 } 14553 14554 func (c *ProjectsLocationsCatalogsModelsCreateCall) doRequest(alt string) (*http.Response, error) { 14555 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 14556 var body io.Reader = nil 14557 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphamodel) 14558 if err != nil { 14559 return nil, err 14560 } 14561 c.urlParams_.Set("alt", alt) 14562 c.urlParams_.Set("prettyPrint", "false") 14563 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+parent}/models") 14564 urls += "?" + c.urlParams_.Encode() 14565 req, err := http.NewRequest("POST", urls, body) 14566 if err != nil { 14567 return nil, err 14568 } 14569 req.Header = reqHeaders 14570 googleapi.Expand(req.URL, map[string]string{ 14571 "parent": c.parent, 14572 }) 14573 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14574 } 14575 14576 // Do executes the "retail.projects.locations.catalogs.models.create" call. 14577 // Any non-2xx status code is an error. Response headers are in either 14578 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was 14579 // returned at all) in error.(*googleapi.Error).Header. Use 14580 // googleapi.IsNotModified to check whether the returned error was because 14581 // http.StatusNotModified was returned. 14582 func (c *ProjectsLocationsCatalogsModelsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 14583 gensupport.SetOptions(c.urlParams_, opts...) 14584 res, err := c.doRequest("json") 14585 if res != nil && res.StatusCode == http.StatusNotModified { 14586 if res.Body != nil { 14587 res.Body.Close() 14588 } 14589 return nil, gensupport.WrapError(&googleapi.Error{ 14590 Code: res.StatusCode, 14591 Header: res.Header, 14592 }) 14593 } 14594 if err != nil { 14595 return nil, err 14596 } 14597 defer googleapi.CloseBody(res) 14598 if err := googleapi.CheckResponse(res); err != nil { 14599 return nil, gensupport.WrapError(err) 14600 } 14601 ret := &GoogleLongrunningOperation{ 14602 ServerResponse: googleapi.ServerResponse{ 14603 Header: res.Header, 14604 HTTPStatusCode: res.StatusCode, 14605 }, 14606 } 14607 target := &ret 14608 if err := gensupport.DecodeResponse(target, res); err != nil { 14609 return nil, err 14610 } 14611 return ret, nil 14612 } 14613 14614 type ProjectsLocationsCatalogsModelsDeleteCall struct { 14615 s *Service 14616 name string 14617 urlParams_ gensupport.URLParams 14618 ctx_ context.Context 14619 header_ http.Header 14620 } 14621 14622 // Delete: Deletes an existing model. 14623 // 14624 // - name: The resource name of the Model to delete. Format: 14625 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/mo 14626 // dels/{model_id}`. 14627 func (r *ProjectsLocationsCatalogsModelsService) Delete(name string) *ProjectsLocationsCatalogsModelsDeleteCall { 14628 c := &ProjectsLocationsCatalogsModelsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14629 c.name = name 14630 return c 14631 } 14632 14633 // Fields allows partial responses to be retrieved. See 14634 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 14635 // details. 14636 func (c *ProjectsLocationsCatalogsModelsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsModelsDeleteCall { 14637 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14638 return c 14639 } 14640 14641 // Context sets the context to be used in this call's Do method. 14642 func (c *ProjectsLocationsCatalogsModelsDeleteCall) Context(ctx context.Context) *ProjectsLocationsCatalogsModelsDeleteCall { 14643 c.ctx_ = ctx 14644 return c 14645 } 14646 14647 // Header returns a http.Header that can be modified by the caller to add 14648 // headers to the request. 14649 func (c *ProjectsLocationsCatalogsModelsDeleteCall) Header() http.Header { 14650 if c.header_ == nil { 14651 c.header_ = make(http.Header) 14652 } 14653 return c.header_ 14654 } 14655 14656 func (c *ProjectsLocationsCatalogsModelsDeleteCall) doRequest(alt string) (*http.Response, error) { 14657 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 14658 var body io.Reader = nil 14659 c.urlParams_.Set("alt", alt) 14660 c.urlParams_.Set("prettyPrint", "false") 14661 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") 14662 urls += "?" + c.urlParams_.Encode() 14663 req, err := http.NewRequest("DELETE", urls, body) 14664 if err != nil { 14665 return nil, err 14666 } 14667 req.Header = reqHeaders 14668 googleapi.Expand(req.URL, map[string]string{ 14669 "name": c.name, 14670 }) 14671 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14672 } 14673 14674 // Do executes the "retail.projects.locations.catalogs.models.delete" call. 14675 // Any non-2xx status code is an error. Response headers are in either 14676 // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at 14677 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 14678 // check whether the returned error was because http.StatusNotModified was 14679 // returned. 14680 func (c *ProjectsLocationsCatalogsModelsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { 14681 gensupport.SetOptions(c.urlParams_, opts...) 14682 res, err := c.doRequest("json") 14683 if res != nil && res.StatusCode == http.StatusNotModified { 14684 if res.Body != nil { 14685 res.Body.Close() 14686 } 14687 return nil, gensupport.WrapError(&googleapi.Error{ 14688 Code: res.StatusCode, 14689 Header: res.Header, 14690 }) 14691 } 14692 if err != nil { 14693 return nil, err 14694 } 14695 defer googleapi.CloseBody(res) 14696 if err := googleapi.CheckResponse(res); err != nil { 14697 return nil, gensupport.WrapError(err) 14698 } 14699 ret := &GoogleProtobufEmpty{ 14700 ServerResponse: googleapi.ServerResponse{ 14701 Header: res.Header, 14702 HTTPStatusCode: res.StatusCode, 14703 }, 14704 } 14705 target := &ret 14706 if err := gensupport.DecodeResponse(target, res); err != nil { 14707 return nil, err 14708 } 14709 return ret, nil 14710 } 14711 14712 type ProjectsLocationsCatalogsModelsGetCall struct { 14713 s *Service 14714 name string 14715 urlParams_ gensupport.URLParams 14716 ifNoneMatch_ string 14717 ctx_ context.Context 14718 header_ http.Header 14719 } 14720 14721 // Get: Gets a model. 14722 // 14723 // - name: The resource name of the Model to get. Format: 14724 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog}/model 14725 // s/{model_id}`. 14726 func (r *ProjectsLocationsCatalogsModelsService) Get(name string) *ProjectsLocationsCatalogsModelsGetCall { 14727 c := &ProjectsLocationsCatalogsModelsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14728 c.name = name 14729 return c 14730 } 14731 14732 // Fields allows partial responses to be retrieved. See 14733 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 14734 // details. 14735 func (c *ProjectsLocationsCatalogsModelsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsModelsGetCall { 14736 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14737 return c 14738 } 14739 14740 // IfNoneMatch sets an optional parameter which makes the operation fail if the 14741 // object's ETag matches the given value. This is useful for getting updates 14742 // only after the object has changed since the last request. 14743 func (c *ProjectsLocationsCatalogsModelsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsModelsGetCall { 14744 c.ifNoneMatch_ = entityTag 14745 return c 14746 } 14747 14748 // Context sets the context to be used in this call's Do method. 14749 func (c *ProjectsLocationsCatalogsModelsGetCall) Context(ctx context.Context) *ProjectsLocationsCatalogsModelsGetCall { 14750 c.ctx_ = ctx 14751 return c 14752 } 14753 14754 // Header returns a http.Header that can be modified by the caller to add 14755 // headers to the request. 14756 func (c *ProjectsLocationsCatalogsModelsGetCall) Header() http.Header { 14757 if c.header_ == nil { 14758 c.header_ = make(http.Header) 14759 } 14760 return c.header_ 14761 } 14762 14763 func (c *ProjectsLocationsCatalogsModelsGetCall) doRequest(alt string) (*http.Response, error) { 14764 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 14765 if c.ifNoneMatch_ != "" { 14766 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 14767 } 14768 var body io.Reader = nil 14769 c.urlParams_.Set("alt", alt) 14770 c.urlParams_.Set("prettyPrint", "false") 14771 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") 14772 urls += "?" + c.urlParams_.Encode() 14773 req, err := http.NewRequest("GET", urls, body) 14774 if err != nil { 14775 return nil, err 14776 } 14777 req.Header = reqHeaders 14778 googleapi.Expand(req.URL, map[string]string{ 14779 "name": c.name, 14780 }) 14781 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14782 } 14783 14784 // Do executes the "retail.projects.locations.catalogs.models.get" call. 14785 // Any non-2xx status code is an error. Response headers are in either 14786 // *GoogleCloudRetailV2alphaModel.ServerResponse.Header or (if a response was 14787 // returned at all) in error.(*googleapi.Error).Header. Use 14788 // googleapi.IsNotModified to check whether the returned error was because 14789 // http.StatusNotModified was returned. 14790 func (c *ProjectsLocationsCatalogsModelsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2alphaModel, error) { 14791 gensupport.SetOptions(c.urlParams_, opts...) 14792 res, err := c.doRequest("json") 14793 if res != nil && res.StatusCode == http.StatusNotModified { 14794 if res.Body != nil { 14795 res.Body.Close() 14796 } 14797 return nil, gensupport.WrapError(&googleapi.Error{ 14798 Code: res.StatusCode, 14799 Header: res.Header, 14800 }) 14801 } 14802 if err != nil { 14803 return nil, err 14804 } 14805 defer googleapi.CloseBody(res) 14806 if err := googleapi.CheckResponse(res); err != nil { 14807 return nil, gensupport.WrapError(err) 14808 } 14809 ret := &GoogleCloudRetailV2alphaModel{ 14810 ServerResponse: googleapi.ServerResponse{ 14811 Header: res.Header, 14812 HTTPStatusCode: res.StatusCode, 14813 }, 14814 } 14815 target := &ret 14816 if err := gensupport.DecodeResponse(target, res); err != nil { 14817 return nil, err 14818 } 14819 return ret, nil 14820 } 14821 14822 type ProjectsLocationsCatalogsModelsListCall struct { 14823 s *Service 14824 parent string 14825 urlParams_ gensupport.URLParams 14826 ifNoneMatch_ string 14827 ctx_ context.Context 14828 header_ http.Header 14829 } 14830 14831 // List: Lists all the models linked to this event store. 14832 // 14833 // - parent: The parent for which to list models. Format: 14834 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`. 14835 func (r *ProjectsLocationsCatalogsModelsService) List(parent string) *ProjectsLocationsCatalogsModelsListCall { 14836 c := &ProjectsLocationsCatalogsModelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14837 c.parent = parent 14838 return c 14839 } 14840 14841 // PageSize sets the optional parameter "pageSize": Maximum number of results 14842 // to return. If unspecified, defaults to 50. Max allowed value is 1000. 14843 func (c *ProjectsLocationsCatalogsModelsListCall) PageSize(pageSize int64) *ProjectsLocationsCatalogsModelsListCall { 14844 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 14845 return c 14846 } 14847 14848 // PageToken sets the optional parameter "pageToken": A page token, received 14849 // from a previous `ListModels` call. Provide this to retrieve the subsequent 14850 // page. 14851 func (c *ProjectsLocationsCatalogsModelsListCall) PageToken(pageToken string) *ProjectsLocationsCatalogsModelsListCall { 14852 c.urlParams_.Set("pageToken", pageToken) 14853 return c 14854 } 14855 14856 // Fields allows partial responses to be retrieved. See 14857 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 14858 // details. 14859 func (c *ProjectsLocationsCatalogsModelsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsModelsListCall { 14860 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14861 return c 14862 } 14863 14864 // IfNoneMatch sets an optional parameter which makes the operation fail if the 14865 // object's ETag matches the given value. This is useful for getting updates 14866 // only after the object has changed since the last request. 14867 func (c *ProjectsLocationsCatalogsModelsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsModelsListCall { 14868 c.ifNoneMatch_ = entityTag 14869 return c 14870 } 14871 14872 // Context sets the context to be used in this call's Do method. 14873 func (c *ProjectsLocationsCatalogsModelsListCall) Context(ctx context.Context) *ProjectsLocationsCatalogsModelsListCall { 14874 c.ctx_ = ctx 14875 return c 14876 } 14877 14878 // Header returns a http.Header that can be modified by the caller to add 14879 // headers to the request. 14880 func (c *ProjectsLocationsCatalogsModelsListCall) Header() http.Header { 14881 if c.header_ == nil { 14882 c.header_ = make(http.Header) 14883 } 14884 return c.header_ 14885 } 14886 14887 func (c *ProjectsLocationsCatalogsModelsListCall) doRequest(alt string) (*http.Response, error) { 14888 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 14889 if c.ifNoneMatch_ != "" { 14890 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 14891 } 14892 var body io.Reader = nil 14893 c.urlParams_.Set("alt", alt) 14894 c.urlParams_.Set("prettyPrint", "false") 14895 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+parent}/models") 14896 urls += "?" + c.urlParams_.Encode() 14897 req, err := http.NewRequest("GET", urls, body) 14898 if err != nil { 14899 return nil, err 14900 } 14901 req.Header = reqHeaders 14902 googleapi.Expand(req.URL, map[string]string{ 14903 "parent": c.parent, 14904 }) 14905 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14906 } 14907 14908 // Do executes the "retail.projects.locations.catalogs.models.list" call. 14909 // Any non-2xx status code is an error. Response headers are in either 14910 // *GoogleCloudRetailV2alphaListModelsResponse.ServerResponse.Header or (if a 14911 // response was returned at all) in error.(*googleapi.Error).Header. Use 14912 // googleapi.IsNotModified to check whether the returned error was because 14913 // http.StatusNotModified was returned. 14914 func (c *ProjectsLocationsCatalogsModelsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2alphaListModelsResponse, error) { 14915 gensupport.SetOptions(c.urlParams_, opts...) 14916 res, err := c.doRequest("json") 14917 if res != nil && res.StatusCode == http.StatusNotModified { 14918 if res.Body != nil { 14919 res.Body.Close() 14920 } 14921 return nil, gensupport.WrapError(&googleapi.Error{ 14922 Code: res.StatusCode, 14923 Header: res.Header, 14924 }) 14925 } 14926 if err != nil { 14927 return nil, err 14928 } 14929 defer googleapi.CloseBody(res) 14930 if err := googleapi.CheckResponse(res); err != nil { 14931 return nil, gensupport.WrapError(err) 14932 } 14933 ret := &GoogleCloudRetailV2alphaListModelsResponse{ 14934 ServerResponse: googleapi.ServerResponse{ 14935 Header: res.Header, 14936 HTTPStatusCode: res.StatusCode, 14937 }, 14938 } 14939 target := &ret 14940 if err := gensupport.DecodeResponse(target, res); err != nil { 14941 return nil, err 14942 } 14943 return ret, nil 14944 } 14945 14946 // Pages invokes f for each page of results. 14947 // A non-nil error returned from f will halt the iteration. 14948 // The provided context supersedes any context provided to the Context method. 14949 func (c *ProjectsLocationsCatalogsModelsListCall) Pages(ctx context.Context, f func(*GoogleCloudRetailV2alphaListModelsResponse) error) error { 14950 c.ctx_ = ctx 14951 defer c.PageToken(c.urlParams_.Get("pageToken")) 14952 for { 14953 x, err := c.Do() 14954 if err != nil { 14955 return err 14956 } 14957 if err := f(x); err != nil { 14958 return err 14959 } 14960 if x.NextPageToken == "" { 14961 return nil 14962 } 14963 c.PageToken(x.NextPageToken) 14964 } 14965 } 14966 14967 type ProjectsLocationsCatalogsModelsPatchCall struct { 14968 s *Service 14969 name string 14970 googlecloudretailv2alphamodel *GoogleCloudRetailV2alphaModel 14971 urlParams_ gensupport.URLParams 14972 ctx_ context.Context 14973 header_ http.Header 14974 } 14975 14976 // Patch: Update of model metadata. Only fields that currently can be updated 14977 // are: `filtering_option` and `periodic_tuning_state`. If other values are 14978 // provided, this API method ignores them. 14979 // 14980 // - name: The fully qualified resource name of the model. Format: 14981 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/mo 14982 // dels/{model_id}` catalog_id has char limit of 50. recommendation_model_id 14983 // has char limit of 40. 14984 func (r *ProjectsLocationsCatalogsModelsService) Patch(name string, googlecloudretailv2alphamodel *GoogleCloudRetailV2alphaModel) *ProjectsLocationsCatalogsModelsPatchCall { 14985 c := &ProjectsLocationsCatalogsModelsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14986 c.name = name 14987 c.googlecloudretailv2alphamodel = googlecloudretailv2alphamodel 14988 return c 14989 } 14990 14991 // UpdateMask sets the optional parameter "updateMask": Indicates which fields 14992 // in the provided 'model' to update. If not set, by default updates all 14993 // fields. 14994 func (c *ProjectsLocationsCatalogsModelsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsCatalogsModelsPatchCall { 14995 c.urlParams_.Set("updateMask", updateMask) 14996 return c 14997 } 14998 14999 // Fields allows partial responses to be retrieved. See 15000 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 15001 // details. 15002 func (c *ProjectsLocationsCatalogsModelsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsModelsPatchCall { 15003 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 15004 return c 15005 } 15006 15007 // Context sets the context to be used in this call's Do method. 15008 func (c *ProjectsLocationsCatalogsModelsPatchCall) Context(ctx context.Context) *ProjectsLocationsCatalogsModelsPatchCall { 15009 c.ctx_ = ctx 15010 return c 15011 } 15012 15013 // Header returns a http.Header that can be modified by the caller to add 15014 // headers to the request. 15015 func (c *ProjectsLocationsCatalogsModelsPatchCall) Header() http.Header { 15016 if c.header_ == nil { 15017 c.header_ = make(http.Header) 15018 } 15019 return c.header_ 15020 } 15021 15022 func (c *ProjectsLocationsCatalogsModelsPatchCall) doRequest(alt string) (*http.Response, error) { 15023 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 15024 var body io.Reader = nil 15025 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphamodel) 15026 if err != nil { 15027 return nil, err 15028 } 15029 c.urlParams_.Set("alt", alt) 15030 c.urlParams_.Set("prettyPrint", "false") 15031 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") 15032 urls += "?" + c.urlParams_.Encode() 15033 req, err := http.NewRequest("PATCH", urls, body) 15034 if err != nil { 15035 return nil, err 15036 } 15037 req.Header = reqHeaders 15038 googleapi.Expand(req.URL, map[string]string{ 15039 "name": c.name, 15040 }) 15041 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15042 } 15043 15044 // Do executes the "retail.projects.locations.catalogs.models.patch" call. 15045 // Any non-2xx status code is an error. Response headers are in either 15046 // *GoogleCloudRetailV2alphaModel.ServerResponse.Header or (if a response was 15047 // returned at all) in error.(*googleapi.Error).Header. Use 15048 // googleapi.IsNotModified to check whether the returned error was because 15049 // http.StatusNotModified was returned. 15050 func (c *ProjectsLocationsCatalogsModelsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2alphaModel, error) { 15051 gensupport.SetOptions(c.urlParams_, opts...) 15052 res, err := c.doRequest("json") 15053 if res != nil && res.StatusCode == http.StatusNotModified { 15054 if res.Body != nil { 15055 res.Body.Close() 15056 } 15057 return nil, gensupport.WrapError(&googleapi.Error{ 15058 Code: res.StatusCode, 15059 Header: res.Header, 15060 }) 15061 } 15062 if err != nil { 15063 return nil, err 15064 } 15065 defer googleapi.CloseBody(res) 15066 if err := googleapi.CheckResponse(res); err != nil { 15067 return nil, gensupport.WrapError(err) 15068 } 15069 ret := &GoogleCloudRetailV2alphaModel{ 15070 ServerResponse: googleapi.ServerResponse{ 15071 Header: res.Header, 15072 HTTPStatusCode: res.StatusCode, 15073 }, 15074 } 15075 target := &ret 15076 if err := gensupport.DecodeResponse(target, res); err != nil { 15077 return nil, err 15078 } 15079 return ret, nil 15080 } 15081 15082 type ProjectsLocationsCatalogsModelsPauseCall struct { 15083 s *Service 15084 name string 15085 googlecloudretailv2alphapausemodelrequest *GoogleCloudRetailV2alphaPauseModelRequest 15086 urlParams_ gensupport.URLParams 15087 ctx_ context.Context 15088 header_ http.Header 15089 } 15090 15091 // Pause: Pauses the training of an existing model. 15092 // 15093 // - name: The name of the model to pause. Format: 15094 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/mo 15095 // dels/{model_id}`. 15096 func (r *ProjectsLocationsCatalogsModelsService) Pause(name string, googlecloudretailv2alphapausemodelrequest *GoogleCloudRetailV2alphaPauseModelRequest) *ProjectsLocationsCatalogsModelsPauseCall { 15097 c := &ProjectsLocationsCatalogsModelsPauseCall{s: r.s, urlParams_: make(gensupport.URLParams)} 15098 c.name = name 15099 c.googlecloudretailv2alphapausemodelrequest = googlecloudretailv2alphapausemodelrequest 15100 return c 15101 } 15102 15103 // Fields allows partial responses to be retrieved. See 15104 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 15105 // details. 15106 func (c *ProjectsLocationsCatalogsModelsPauseCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsModelsPauseCall { 15107 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 15108 return c 15109 } 15110 15111 // Context sets the context to be used in this call's Do method. 15112 func (c *ProjectsLocationsCatalogsModelsPauseCall) Context(ctx context.Context) *ProjectsLocationsCatalogsModelsPauseCall { 15113 c.ctx_ = ctx 15114 return c 15115 } 15116 15117 // Header returns a http.Header that can be modified by the caller to add 15118 // headers to the request. 15119 func (c *ProjectsLocationsCatalogsModelsPauseCall) Header() http.Header { 15120 if c.header_ == nil { 15121 c.header_ = make(http.Header) 15122 } 15123 return c.header_ 15124 } 15125 15126 func (c *ProjectsLocationsCatalogsModelsPauseCall) doRequest(alt string) (*http.Response, error) { 15127 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 15128 var body io.Reader = nil 15129 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphapausemodelrequest) 15130 if err != nil { 15131 return nil, err 15132 } 15133 c.urlParams_.Set("alt", alt) 15134 c.urlParams_.Set("prettyPrint", "false") 15135 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}:pause") 15136 urls += "?" + c.urlParams_.Encode() 15137 req, err := http.NewRequest("POST", urls, body) 15138 if err != nil { 15139 return nil, err 15140 } 15141 req.Header = reqHeaders 15142 googleapi.Expand(req.URL, map[string]string{ 15143 "name": c.name, 15144 }) 15145 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15146 } 15147 15148 // Do executes the "retail.projects.locations.catalogs.models.pause" call. 15149 // Any non-2xx status code is an error. Response headers are in either 15150 // *GoogleCloudRetailV2alphaModel.ServerResponse.Header or (if a response was 15151 // returned at all) in error.(*googleapi.Error).Header. Use 15152 // googleapi.IsNotModified to check whether the returned error was because 15153 // http.StatusNotModified was returned. 15154 func (c *ProjectsLocationsCatalogsModelsPauseCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2alphaModel, error) { 15155 gensupport.SetOptions(c.urlParams_, opts...) 15156 res, err := c.doRequest("json") 15157 if res != nil && res.StatusCode == http.StatusNotModified { 15158 if res.Body != nil { 15159 res.Body.Close() 15160 } 15161 return nil, gensupport.WrapError(&googleapi.Error{ 15162 Code: res.StatusCode, 15163 Header: res.Header, 15164 }) 15165 } 15166 if err != nil { 15167 return nil, err 15168 } 15169 defer googleapi.CloseBody(res) 15170 if err := googleapi.CheckResponse(res); err != nil { 15171 return nil, gensupport.WrapError(err) 15172 } 15173 ret := &GoogleCloudRetailV2alphaModel{ 15174 ServerResponse: googleapi.ServerResponse{ 15175 Header: res.Header, 15176 HTTPStatusCode: res.StatusCode, 15177 }, 15178 } 15179 target := &ret 15180 if err := gensupport.DecodeResponse(target, res); err != nil { 15181 return nil, err 15182 } 15183 return ret, nil 15184 } 15185 15186 type ProjectsLocationsCatalogsModelsResumeCall struct { 15187 s *Service 15188 name string 15189 googlecloudretailv2alpharesumemodelrequest *GoogleCloudRetailV2alphaResumeModelRequest 15190 urlParams_ gensupport.URLParams 15191 ctx_ context.Context 15192 header_ http.Header 15193 } 15194 15195 // Resume: Resumes the training of an existing model. 15196 // 15197 // - name: The name of the model to resume. Format: 15198 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/mo 15199 // dels/{model_id}`. 15200 func (r *ProjectsLocationsCatalogsModelsService) Resume(name string, googlecloudretailv2alpharesumemodelrequest *GoogleCloudRetailV2alphaResumeModelRequest) *ProjectsLocationsCatalogsModelsResumeCall { 15201 c := &ProjectsLocationsCatalogsModelsResumeCall{s: r.s, urlParams_: make(gensupport.URLParams)} 15202 c.name = name 15203 c.googlecloudretailv2alpharesumemodelrequest = googlecloudretailv2alpharesumemodelrequest 15204 return c 15205 } 15206 15207 // Fields allows partial responses to be retrieved. See 15208 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 15209 // details. 15210 func (c *ProjectsLocationsCatalogsModelsResumeCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsModelsResumeCall { 15211 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 15212 return c 15213 } 15214 15215 // Context sets the context to be used in this call's Do method. 15216 func (c *ProjectsLocationsCatalogsModelsResumeCall) Context(ctx context.Context) *ProjectsLocationsCatalogsModelsResumeCall { 15217 c.ctx_ = ctx 15218 return c 15219 } 15220 15221 // Header returns a http.Header that can be modified by the caller to add 15222 // headers to the request. 15223 func (c *ProjectsLocationsCatalogsModelsResumeCall) Header() http.Header { 15224 if c.header_ == nil { 15225 c.header_ = make(http.Header) 15226 } 15227 return c.header_ 15228 } 15229 15230 func (c *ProjectsLocationsCatalogsModelsResumeCall) doRequest(alt string) (*http.Response, error) { 15231 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 15232 var body io.Reader = nil 15233 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alpharesumemodelrequest) 15234 if err != nil { 15235 return nil, err 15236 } 15237 c.urlParams_.Set("alt", alt) 15238 c.urlParams_.Set("prettyPrint", "false") 15239 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}:resume") 15240 urls += "?" + c.urlParams_.Encode() 15241 req, err := http.NewRequest("POST", urls, body) 15242 if err != nil { 15243 return nil, err 15244 } 15245 req.Header = reqHeaders 15246 googleapi.Expand(req.URL, map[string]string{ 15247 "name": c.name, 15248 }) 15249 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15250 } 15251 15252 // Do executes the "retail.projects.locations.catalogs.models.resume" call. 15253 // Any non-2xx status code is an error. Response headers are in either 15254 // *GoogleCloudRetailV2alphaModel.ServerResponse.Header or (if a response was 15255 // returned at all) in error.(*googleapi.Error).Header. Use 15256 // googleapi.IsNotModified to check whether the returned error was because 15257 // http.StatusNotModified was returned. 15258 func (c *ProjectsLocationsCatalogsModelsResumeCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2alphaModel, error) { 15259 gensupport.SetOptions(c.urlParams_, opts...) 15260 res, err := c.doRequest("json") 15261 if res != nil && res.StatusCode == http.StatusNotModified { 15262 if res.Body != nil { 15263 res.Body.Close() 15264 } 15265 return nil, gensupport.WrapError(&googleapi.Error{ 15266 Code: res.StatusCode, 15267 Header: res.Header, 15268 }) 15269 } 15270 if err != nil { 15271 return nil, err 15272 } 15273 defer googleapi.CloseBody(res) 15274 if err := googleapi.CheckResponse(res); err != nil { 15275 return nil, gensupport.WrapError(err) 15276 } 15277 ret := &GoogleCloudRetailV2alphaModel{ 15278 ServerResponse: googleapi.ServerResponse{ 15279 Header: res.Header, 15280 HTTPStatusCode: res.StatusCode, 15281 }, 15282 } 15283 target := &ret 15284 if err := gensupport.DecodeResponse(target, res); err != nil { 15285 return nil, err 15286 } 15287 return ret, nil 15288 } 15289 15290 type ProjectsLocationsCatalogsModelsTuneCall struct { 15291 s *Service 15292 name string 15293 googlecloudretailv2alphatunemodelrequest *GoogleCloudRetailV2alphaTuneModelRequest 15294 urlParams_ gensupport.URLParams 15295 ctx_ context.Context 15296 header_ http.Header 15297 } 15298 15299 // Tune: Tunes an existing model. 15300 // 15301 // - name: The resource name of the model to tune. Format: 15302 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/mo 15303 // dels/{model_id}`. 15304 func (r *ProjectsLocationsCatalogsModelsService) Tune(name string, googlecloudretailv2alphatunemodelrequest *GoogleCloudRetailV2alphaTuneModelRequest) *ProjectsLocationsCatalogsModelsTuneCall { 15305 c := &ProjectsLocationsCatalogsModelsTuneCall{s: r.s, urlParams_: make(gensupport.URLParams)} 15306 c.name = name 15307 c.googlecloudretailv2alphatunemodelrequest = googlecloudretailv2alphatunemodelrequest 15308 return c 15309 } 15310 15311 // Fields allows partial responses to be retrieved. See 15312 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 15313 // details. 15314 func (c *ProjectsLocationsCatalogsModelsTuneCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsModelsTuneCall { 15315 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 15316 return c 15317 } 15318 15319 // Context sets the context to be used in this call's Do method. 15320 func (c *ProjectsLocationsCatalogsModelsTuneCall) Context(ctx context.Context) *ProjectsLocationsCatalogsModelsTuneCall { 15321 c.ctx_ = ctx 15322 return c 15323 } 15324 15325 // Header returns a http.Header that can be modified by the caller to add 15326 // headers to the request. 15327 func (c *ProjectsLocationsCatalogsModelsTuneCall) Header() http.Header { 15328 if c.header_ == nil { 15329 c.header_ = make(http.Header) 15330 } 15331 return c.header_ 15332 } 15333 15334 func (c *ProjectsLocationsCatalogsModelsTuneCall) doRequest(alt string) (*http.Response, error) { 15335 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 15336 var body io.Reader = nil 15337 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphatunemodelrequest) 15338 if err != nil { 15339 return nil, err 15340 } 15341 c.urlParams_.Set("alt", alt) 15342 c.urlParams_.Set("prettyPrint", "false") 15343 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}:tune") 15344 urls += "?" + c.urlParams_.Encode() 15345 req, err := http.NewRequest("POST", urls, body) 15346 if err != nil { 15347 return nil, err 15348 } 15349 req.Header = reqHeaders 15350 googleapi.Expand(req.URL, map[string]string{ 15351 "name": c.name, 15352 }) 15353 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15354 } 15355 15356 // Do executes the "retail.projects.locations.catalogs.models.tune" call. 15357 // Any non-2xx status code is an error. Response headers are in either 15358 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was 15359 // returned at all) in error.(*googleapi.Error).Header. Use 15360 // googleapi.IsNotModified to check whether the returned error was because 15361 // http.StatusNotModified was returned. 15362 func (c *ProjectsLocationsCatalogsModelsTuneCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 15363 gensupport.SetOptions(c.urlParams_, opts...) 15364 res, err := c.doRequest("json") 15365 if res != nil && res.StatusCode == http.StatusNotModified { 15366 if res.Body != nil { 15367 res.Body.Close() 15368 } 15369 return nil, gensupport.WrapError(&googleapi.Error{ 15370 Code: res.StatusCode, 15371 Header: res.Header, 15372 }) 15373 } 15374 if err != nil { 15375 return nil, err 15376 } 15377 defer googleapi.CloseBody(res) 15378 if err := googleapi.CheckResponse(res); err != nil { 15379 return nil, gensupport.WrapError(err) 15380 } 15381 ret := &GoogleLongrunningOperation{ 15382 ServerResponse: googleapi.ServerResponse{ 15383 Header: res.Header, 15384 HTTPStatusCode: res.StatusCode, 15385 }, 15386 } 15387 target := &ret 15388 if err := gensupport.DecodeResponse(target, res); err != nil { 15389 return nil, err 15390 } 15391 return ret, nil 15392 } 15393 15394 type ProjectsLocationsCatalogsOperationsGetCall struct { 15395 s *Service 15396 name string 15397 urlParams_ gensupport.URLParams 15398 ifNoneMatch_ string 15399 ctx_ context.Context 15400 header_ http.Header 15401 } 15402 15403 // Get: Gets the latest state of a long-running operation. Clients can use this 15404 // method to poll the operation result at intervals as recommended by the API 15405 // service. 15406 // 15407 // - name: The name of the operation resource. 15408 func (r *ProjectsLocationsCatalogsOperationsService) Get(name string) *ProjectsLocationsCatalogsOperationsGetCall { 15409 c := &ProjectsLocationsCatalogsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 15410 c.name = name 15411 return c 15412 } 15413 15414 // Fields allows partial responses to be retrieved. See 15415 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 15416 // details. 15417 func (c *ProjectsLocationsCatalogsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsOperationsGetCall { 15418 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 15419 return c 15420 } 15421 15422 // IfNoneMatch sets an optional parameter which makes the operation fail if the 15423 // object's ETag matches the given value. This is useful for getting updates 15424 // only after the object has changed since the last request. 15425 func (c *ProjectsLocationsCatalogsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsOperationsGetCall { 15426 c.ifNoneMatch_ = entityTag 15427 return c 15428 } 15429 15430 // Context sets the context to be used in this call's Do method. 15431 func (c *ProjectsLocationsCatalogsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsCatalogsOperationsGetCall { 15432 c.ctx_ = ctx 15433 return c 15434 } 15435 15436 // Header returns a http.Header that can be modified by the caller to add 15437 // headers to the request. 15438 func (c *ProjectsLocationsCatalogsOperationsGetCall) Header() http.Header { 15439 if c.header_ == nil { 15440 c.header_ = make(http.Header) 15441 } 15442 return c.header_ 15443 } 15444 15445 func (c *ProjectsLocationsCatalogsOperationsGetCall) doRequest(alt string) (*http.Response, error) { 15446 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 15447 if c.ifNoneMatch_ != "" { 15448 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 15449 } 15450 var body io.Reader = nil 15451 c.urlParams_.Set("alt", alt) 15452 c.urlParams_.Set("prettyPrint", "false") 15453 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") 15454 urls += "?" + c.urlParams_.Encode() 15455 req, err := http.NewRequest("GET", urls, body) 15456 if err != nil { 15457 return nil, err 15458 } 15459 req.Header = reqHeaders 15460 googleapi.Expand(req.URL, map[string]string{ 15461 "name": c.name, 15462 }) 15463 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15464 } 15465 15466 // Do executes the "retail.projects.locations.catalogs.operations.get" call. 15467 // Any non-2xx status code is an error. Response headers are in either 15468 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was 15469 // returned at all) in error.(*googleapi.Error).Header. Use 15470 // googleapi.IsNotModified to check whether the returned error was because 15471 // http.StatusNotModified was returned. 15472 func (c *ProjectsLocationsCatalogsOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 15473 gensupport.SetOptions(c.urlParams_, opts...) 15474 res, err := c.doRequest("json") 15475 if res != nil && res.StatusCode == http.StatusNotModified { 15476 if res.Body != nil { 15477 res.Body.Close() 15478 } 15479 return nil, gensupport.WrapError(&googleapi.Error{ 15480 Code: res.StatusCode, 15481 Header: res.Header, 15482 }) 15483 } 15484 if err != nil { 15485 return nil, err 15486 } 15487 defer googleapi.CloseBody(res) 15488 if err := googleapi.CheckResponse(res); err != nil { 15489 return nil, gensupport.WrapError(err) 15490 } 15491 ret := &GoogleLongrunningOperation{ 15492 ServerResponse: googleapi.ServerResponse{ 15493 Header: res.Header, 15494 HTTPStatusCode: res.StatusCode, 15495 }, 15496 } 15497 target := &ret 15498 if err := gensupport.DecodeResponse(target, res); err != nil { 15499 return nil, err 15500 } 15501 return ret, nil 15502 } 15503 15504 type ProjectsLocationsCatalogsOperationsListCall struct { 15505 s *Service 15506 name string 15507 urlParams_ gensupport.URLParams 15508 ifNoneMatch_ string 15509 ctx_ context.Context 15510 header_ http.Header 15511 } 15512 15513 // List: Lists operations that match the specified filter in the request. If 15514 // the server doesn't support this method, it returns `UNIMPLEMENTED`. 15515 // 15516 // - name: The name of the operation's parent resource. 15517 func (r *ProjectsLocationsCatalogsOperationsService) List(name string) *ProjectsLocationsCatalogsOperationsListCall { 15518 c := &ProjectsLocationsCatalogsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 15519 c.name = name 15520 return c 15521 } 15522 15523 // Filter sets the optional parameter "filter": The standard list filter. 15524 func (c *ProjectsLocationsCatalogsOperationsListCall) Filter(filter string) *ProjectsLocationsCatalogsOperationsListCall { 15525 c.urlParams_.Set("filter", filter) 15526 return c 15527 } 15528 15529 // PageSize sets the optional parameter "pageSize": The standard list page 15530 // size. 15531 func (c *ProjectsLocationsCatalogsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsCatalogsOperationsListCall { 15532 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 15533 return c 15534 } 15535 15536 // PageToken sets the optional parameter "pageToken": The standard list page 15537 // token. 15538 func (c *ProjectsLocationsCatalogsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsCatalogsOperationsListCall { 15539 c.urlParams_.Set("pageToken", pageToken) 15540 return c 15541 } 15542 15543 // Fields allows partial responses to be retrieved. See 15544 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 15545 // details. 15546 func (c *ProjectsLocationsCatalogsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsOperationsListCall { 15547 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 15548 return c 15549 } 15550 15551 // IfNoneMatch sets an optional parameter which makes the operation fail if the 15552 // object's ETag matches the given value. This is useful for getting updates 15553 // only after the object has changed since the last request. 15554 func (c *ProjectsLocationsCatalogsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsOperationsListCall { 15555 c.ifNoneMatch_ = entityTag 15556 return c 15557 } 15558 15559 // Context sets the context to be used in this call's Do method. 15560 func (c *ProjectsLocationsCatalogsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsCatalogsOperationsListCall { 15561 c.ctx_ = ctx 15562 return c 15563 } 15564 15565 // Header returns a http.Header that can be modified by the caller to add 15566 // headers to the request. 15567 func (c *ProjectsLocationsCatalogsOperationsListCall) Header() http.Header { 15568 if c.header_ == nil { 15569 c.header_ = make(http.Header) 15570 } 15571 return c.header_ 15572 } 15573 15574 func (c *ProjectsLocationsCatalogsOperationsListCall) doRequest(alt string) (*http.Response, error) { 15575 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 15576 if c.ifNoneMatch_ != "" { 15577 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 15578 } 15579 var body io.Reader = nil 15580 c.urlParams_.Set("alt", alt) 15581 c.urlParams_.Set("prettyPrint", "false") 15582 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}/operations") 15583 urls += "?" + c.urlParams_.Encode() 15584 req, err := http.NewRequest("GET", urls, body) 15585 if err != nil { 15586 return nil, err 15587 } 15588 req.Header = reqHeaders 15589 googleapi.Expand(req.URL, map[string]string{ 15590 "name": c.name, 15591 }) 15592 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15593 } 15594 15595 // Do executes the "retail.projects.locations.catalogs.operations.list" call. 15596 // Any non-2xx status code is an error. Response headers are in either 15597 // *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if a 15598 // response was returned at all) in error.(*googleapi.Error).Header. Use 15599 // googleapi.IsNotModified to check whether the returned error was because 15600 // http.StatusNotModified was returned. 15601 func (c *ProjectsLocationsCatalogsOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { 15602 gensupport.SetOptions(c.urlParams_, opts...) 15603 res, err := c.doRequest("json") 15604 if res != nil && res.StatusCode == http.StatusNotModified { 15605 if res.Body != nil { 15606 res.Body.Close() 15607 } 15608 return nil, gensupport.WrapError(&googleapi.Error{ 15609 Code: res.StatusCode, 15610 Header: res.Header, 15611 }) 15612 } 15613 if err != nil { 15614 return nil, err 15615 } 15616 defer googleapi.CloseBody(res) 15617 if err := googleapi.CheckResponse(res); err != nil { 15618 return nil, gensupport.WrapError(err) 15619 } 15620 ret := &GoogleLongrunningListOperationsResponse{ 15621 ServerResponse: googleapi.ServerResponse{ 15622 Header: res.Header, 15623 HTTPStatusCode: res.StatusCode, 15624 }, 15625 } 15626 target := &ret 15627 if err := gensupport.DecodeResponse(target, res); err != nil { 15628 return nil, err 15629 } 15630 return ret, nil 15631 } 15632 15633 // Pages invokes f for each page of results. 15634 // A non-nil error returned from f will halt the iteration. 15635 // The provided context supersedes any context provided to the Context method. 15636 func (c *ProjectsLocationsCatalogsOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { 15637 c.ctx_ = ctx 15638 defer c.PageToken(c.urlParams_.Get("pageToken")) 15639 for { 15640 x, err := c.Do() 15641 if err != nil { 15642 return err 15643 } 15644 if err := f(x); err != nil { 15645 return err 15646 } 15647 if x.NextPageToken == "" { 15648 return nil 15649 } 15650 c.PageToken(x.NextPageToken) 15651 } 15652 } 15653 15654 type ProjectsLocationsCatalogsPlacementsPredictCall struct { 15655 s *Service 15656 placement string 15657 googlecloudretailv2alphapredictrequest *GoogleCloudRetailV2alphaPredictRequest 15658 urlParams_ gensupport.URLParams 15659 ctx_ context.Context 15660 header_ http.Header 15661 } 15662 15663 // Predict: Makes a recommendation prediction. 15664 // 15665 // - placement: Full resource name of the format: 15666 // `{placement=projects/*/locations/global/catalogs/default_catalog/servingCon 15667 // figs/*}` or 15668 // `{placement=projects/*/locations/global/catalogs/default_catalog/placements 15669 // /*}`. We recommend using the `servingConfigs` resource. `placements` is a 15670 // legacy resource. The ID of the Recommendations AI serving config or 15671 // placement. Before you can request predictions from your model, you must 15672 // create at least one serving config or placement for it. For more 15673 // information, see [Manage serving configs] 15674 // (https://cloud.google.com/retail/docs/manage-configs). The full list of 15675 // available serving configs can be seen at 15676 // https://console.cloud.google.com/ai/retail/catalogs/default_catalog/configs. 15677 func (r *ProjectsLocationsCatalogsPlacementsService) Predict(placement string, googlecloudretailv2alphapredictrequest *GoogleCloudRetailV2alphaPredictRequest) *ProjectsLocationsCatalogsPlacementsPredictCall { 15678 c := &ProjectsLocationsCatalogsPlacementsPredictCall{s: r.s, urlParams_: make(gensupport.URLParams)} 15679 c.placement = placement 15680 c.googlecloudretailv2alphapredictrequest = googlecloudretailv2alphapredictrequest 15681 return c 15682 } 15683 15684 // Fields allows partial responses to be retrieved. See 15685 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 15686 // details. 15687 func (c *ProjectsLocationsCatalogsPlacementsPredictCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsPlacementsPredictCall { 15688 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 15689 return c 15690 } 15691 15692 // Context sets the context to be used in this call's Do method. 15693 func (c *ProjectsLocationsCatalogsPlacementsPredictCall) Context(ctx context.Context) *ProjectsLocationsCatalogsPlacementsPredictCall { 15694 c.ctx_ = ctx 15695 return c 15696 } 15697 15698 // Header returns a http.Header that can be modified by the caller to add 15699 // headers to the request. 15700 func (c *ProjectsLocationsCatalogsPlacementsPredictCall) Header() http.Header { 15701 if c.header_ == nil { 15702 c.header_ = make(http.Header) 15703 } 15704 return c.header_ 15705 } 15706 15707 func (c *ProjectsLocationsCatalogsPlacementsPredictCall) doRequest(alt string) (*http.Response, error) { 15708 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 15709 var body io.Reader = nil 15710 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphapredictrequest) 15711 if err != nil { 15712 return nil, err 15713 } 15714 c.urlParams_.Set("alt", alt) 15715 c.urlParams_.Set("prettyPrint", "false") 15716 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+placement}:predict") 15717 urls += "?" + c.urlParams_.Encode() 15718 req, err := http.NewRequest("POST", urls, body) 15719 if err != nil { 15720 return nil, err 15721 } 15722 req.Header = reqHeaders 15723 googleapi.Expand(req.URL, map[string]string{ 15724 "placement": c.placement, 15725 }) 15726 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15727 } 15728 15729 // Do executes the "retail.projects.locations.catalogs.placements.predict" call. 15730 // Any non-2xx status code is an error. Response headers are in either 15731 // *GoogleCloudRetailV2alphaPredictResponse.ServerResponse.Header or (if a 15732 // response was returned at all) in error.(*googleapi.Error).Header. Use 15733 // googleapi.IsNotModified to check whether the returned error was because 15734 // http.StatusNotModified was returned. 15735 func (c *ProjectsLocationsCatalogsPlacementsPredictCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2alphaPredictResponse, error) { 15736 gensupport.SetOptions(c.urlParams_, opts...) 15737 res, err := c.doRequest("json") 15738 if res != nil && res.StatusCode == http.StatusNotModified { 15739 if res.Body != nil { 15740 res.Body.Close() 15741 } 15742 return nil, gensupport.WrapError(&googleapi.Error{ 15743 Code: res.StatusCode, 15744 Header: res.Header, 15745 }) 15746 } 15747 if err != nil { 15748 return nil, err 15749 } 15750 defer googleapi.CloseBody(res) 15751 if err := googleapi.CheckResponse(res); err != nil { 15752 return nil, gensupport.WrapError(err) 15753 } 15754 ret := &GoogleCloudRetailV2alphaPredictResponse{ 15755 ServerResponse: googleapi.ServerResponse{ 15756 Header: res.Header, 15757 HTTPStatusCode: res.StatusCode, 15758 }, 15759 } 15760 target := &ret 15761 if err := gensupport.DecodeResponse(target, res); err != nil { 15762 return nil, err 15763 } 15764 return ret, nil 15765 } 15766 15767 type ProjectsLocationsCatalogsPlacementsSearchCall struct { 15768 s *Service 15769 placement string 15770 googlecloudretailv2alphasearchrequest *GoogleCloudRetailV2alphaSearchRequest 15771 urlParams_ gensupport.URLParams 15772 ctx_ context.Context 15773 header_ http.Header 15774 } 15775 15776 // Search: Performs a search. This feature is only available for users who have 15777 // Retail Search enabled. Enable Retail Search on Cloud Console before using 15778 // this feature. 15779 // 15780 // - placement: The resource name of the Retail Search serving config, such as 15781 // `projects/*/locations/global/catalogs/default_catalog/servingConfigs/defaul 15782 // t_serving_config` or the name of the legacy placement resource, such as 15783 // `projects/*/locations/global/catalogs/default_catalog/placements/default_se 15784 // arch`. This field is used to identify the serving config name and the set 15785 // of models that are used to make the search. 15786 func (r *ProjectsLocationsCatalogsPlacementsService) Search(placement string, googlecloudretailv2alphasearchrequest *GoogleCloudRetailV2alphaSearchRequest) *ProjectsLocationsCatalogsPlacementsSearchCall { 15787 c := &ProjectsLocationsCatalogsPlacementsSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 15788 c.placement = placement 15789 c.googlecloudretailv2alphasearchrequest = googlecloudretailv2alphasearchrequest 15790 return c 15791 } 15792 15793 // Fields allows partial responses to be retrieved. See 15794 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 15795 // details. 15796 func (c *ProjectsLocationsCatalogsPlacementsSearchCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsPlacementsSearchCall { 15797 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 15798 return c 15799 } 15800 15801 // Context sets the context to be used in this call's Do method. 15802 func (c *ProjectsLocationsCatalogsPlacementsSearchCall) Context(ctx context.Context) *ProjectsLocationsCatalogsPlacementsSearchCall { 15803 c.ctx_ = ctx 15804 return c 15805 } 15806 15807 // Header returns a http.Header that can be modified by the caller to add 15808 // headers to the request. 15809 func (c *ProjectsLocationsCatalogsPlacementsSearchCall) Header() http.Header { 15810 if c.header_ == nil { 15811 c.header_ = make(http.Header) 15812 } 15813 return c.header_ 15814 } 15815 15816 func (c *ProjectsLocationsCatalogsPlacementsSearchCall) doRequest(alt string) (*http.Response, error) { 15817 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 15818 var body io.Reader = nil 15819 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphasearchrequest) 15820 if err != nil { 15821 return nil, err 15822 } 15823 c.urlParams_.Set("alt", alt) 15824 c.urlParams_.Set("prettyPrint", "false") 15825 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+placement}:search") 15826 urls += "?" + c.urlParams_.Encode() 15827 req, err := http.NewRequest("POST", urls, body) 15828 if err != nil { 15829 return nil, err 15830 } 15831 req.Header = reqHeaders 15832 googleapi.Expand(req.URL, map[string]string{ 15833 "placement": c.placement, 15834 }) 15835 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15836 } 15837 15838 // Do executes the "retail.projects.locations.catalogs.placements.search" call. 15839 // Any non-2xx status code is an error. Response headers are in either 15840 // *GoogleCloudRetailV2alphaSearchResponse.ServerResponse.Header or (if a 15841 // response was returned at all) in error.(*googleapi.Error).Header. Use 15842 // googleapi.IsNotModified to check whether the returned error was because 15843 // http.StatusNotModified was returned. 15844 func (c *ProjectsLocationsCatalogsPlacementsSearchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2alphaSearchResponse, error) { 15845 gensupport.SetOptions(c.urlParams_, opts...) 15846 res, err := c.doRequest("json") 15847 if res != nil && res.StatusCode == http.StatusNotModified { 15848 if res.Body != nil { 15849 res.Body.Close() 15850 } 15851 return nil, gensupport.WrapError(&googleapi.Error{ 15852 Code: res.StatusCode, 15853 Header: res.Header, 15854 }) 15855 } 15856 if err != nil { 15857 return nil, err 15858 } 15859 defer googleapi.CloseBody(res) 15860 if err := googleapi.CheckResponse(res); err != nil { 15861 return nil, gensupport.WrapError(err) 15862 } 15863 ret := &GoogleCloudRetailV2alphaSearchResponse{ 15864 ServerResponse: googleapi.ServerResponse{ 15865 Header: res.Header, 15866 HTTPStatusCode: res.StatusCode, 15867 }, 15868 } 15869 target := &ret 15870 if err := gensupport.DecodeResponse(target, res); err != nil { 15871 return nil, err 15872 } 15873 return ret, nil 15874 } 15875 15876 // Pages invokes f for each page of results. 15877 // A non-nil error returned from f will halt the iteration. 15878 // The provided context supersedes any context provided to the Context method. 15879 func (c *ProjectsLocationsCatalogsPlacementsSearchCall) Pages(ctx context.Context, f func(*GoogleCloudRetailV2alphaSearchResponse) error) error { 15880 c.ctx_ = ctx 15881 defer func(pt string) { c.googlecloudretailv2alphasearchrequest.PageToken = pt }(c.googlecloudretailv2alphasearchrequest.PageToken) 15882 for { 15883 x, err := c.Do() 15884 if err != nil { 15885 return err 15886 } 15887 if err := f(x); err != nil { 15888 return err 15889 } 15890 if x.NextPageToken == "" { 15891 return nil 15892 } 15893 c.googlecloudretailv2alphasearchrequest.PageToken = x.NextPageToken 15894 } 15895 } 15896 15897 type ProjectsLocationsCatalogsServingConfigsAddControlCall struct { 15898 s *Service 15899 servingConfig string 15900 googlecloudretailv2alphaaddcontrolrequest *GoogleCloudRetailV2alphaAddControlRequest 15901 urlParams_ gensupport.URLParams 15902 ctx_ context.Context 15903 header_ http.Header 15904 } 15905 15906 // AddControl: Enables a Control on the specified ServingConfig. The control is 15907 // added in the last position of the list of controls it belongs to (e.g. if 15908 // it's a facet spec control it will be applied in the last position of 15909 // servingConfig.facetSpecIds) Returns a ALREADY_EXISTS error if the control 15910 // has already been applied. Returns a FAILED_PRECONDITION error if the 15911 // addition could exceed maximum number of control allowed for that type of 15912 // control. 15913 // 15914 // - servingConfig: The source ServingConfig resource name . Format: 15915 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/se 15916 // rvingConfigs/{serving_config_id}`. 15917 func (r *ProjectsLocationsCatalogsServingConfigsService) AddControl(servingConfig string, googlecloudretailv2alphaaddcontrolrequest *GoogleCloudRetailV2alphaAddControlRequest) *ProjectsLocationsCatalogsServingConfigsAddControlCall { 15918 c := &ProjectsLocationsCatalogsServingConfigsAddControlCall{s: r.s, urlParams_: make(gensupport.URLParams)} 15919 c.servingConfig = servingConfig 15920 c.googlecloudretailv2alphaaddcontrolrequest = googlecloudretailv2alphaaddcontrolrequest 15921 return c 15922 } 15923 15924 // Fields allows partial responses to be retrieved. See 15925 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 15926 // details. 15927 func (c *ProjectsLocationsCatalogsServingConfigsAddControlCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsServingConfigsAddControlCall { 15928 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 15929 return c 15930 } 15931 15932 // Context sets the context to be used in this call's Do method. 15933 func (c *ProjectsLocationsCatalogsServingConfigsAddControlCall) Context(ctx context.Context) *ProjectsLocationsCatalogsServingConfigsAddControlCall { 15934 c.ctx_ = ctx 15935 return c 15936 } 15937 15938 // Header returns a http.Header that can be modified by the caller to add 15939 // headers to the request. 15940 func (c *ProjectsLocationsCatalogsServingConfigsAddControlCall) Header() http.Header { 15941 if c.header_ == nil { 15942 c.header_ = make(http.Header) 15943 } 15944 return c.header_ 15945 } 15946 15947 func (c *ProjectsLocationsCatalogsServingConfigsAddControlCall) doRequest(alt string) (*http.Response, error) { 15948 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 15949 var body io.Reader = nil 15950 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphaaddcontrolrequest) 15951 if err != nil { 15952 return nil, err 15953 } 15954 c.urlParams_.Set("alt", alt) 15955 c.urlParams_.Set("prettyPrint", "false") 15956 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+servingConfig}:addControl") 15957 urls += "?" + c.urlParams_.Encode() 15958 req, err := http.NewRequest("POST", urls, body) 15959 if err != nil { 15960 return nil, err 15961 } 15962 req.Header = reqHeaders 15963 googleapi.Expand(req.URL, map[string]string{ 15964 "servingConfig": c.servingConfig, 15965 }) 15966 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15967 } 15968 15969 // Do executes the "retail.projects.locations.catalogs.servingConfigs.addControl" call. 15970 // Any non-2xx status code is an error. Response headers are in either 15971 // *GoogleCloudRetailV2alphaServingConfig.ServerResponse.Header or (if a 15972 // response was returned at all) in error.(*googleapi.Error).Header. Use 15973 // googleapi.IsNotModified to check whether the returned error was because 15974 // http.StatusNotModified was returned. 15975 func (c *ProjectsLocationsCatalogsServingConfigsAddControlCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2alphaServingConfig, error) { 15976 gensupport.SetOptions(c.urlParams_, opts...) 15977 res, err := c.doRequest("json") 15978 if res != nil && res.StatusCode == http.StatusNotModified { 15979 if res.Body != nil { 15980 res.Body.Close() 15981 } 15982 return nil, gensupport.WrapError(&googleapi.Error{ 15983 Code: res.StatusCode, 15984 Header: res.Header, 15985 }) 15986 } 15987 if err != nil { 15988 return nil, err 15989 } 15990 defer googleapi.CloseBody(res) 15991 if err := googleapi.CheckResponse(res); err != nil { 15992 return nil, gensupport.WrapError(err) 15993 } 15994 ret := &GoogleCloudRetailV2alphaServingConfig{ 15995 ServerResponse: googleapi.ServerResponse{ 15996 Header: res.Header, 15997 HTTPStatusCode: res.StatusCode, 15998 }, 15999 } 16000 target := &ret 16001 if err := gensupport.DecodeResponse(target, res); err != nil { 16002 return nil, err 16003 } 16004 return ret, nil 16005 } 16006 16007 type ProjectsLocationsCatalogsServingConfigsCreateCall struct { 16008 s *Service 16009 parent string 16010 googlecloudretailv2alphaservingconfig *GoogleCloudRetailV2alphaServingConfig 16011 urlParams_ gensupport.URLParams 16012 ctx_ context.Context 16013 header_ http.Header 16014 } 16015 16016 // Create: Creates a ServingConfig. A maximum of 100 ServingConfigs are allowed 16017 // in a Catalog, otherwise a FAILED_PRECONDITION error is returned. 16018 // 16019 // - parent: Full resource name of parent. Format: 16020 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`. 16021 func (r *ProjectsLocationsCatalogsServingConfigsService) Create(parent string, googlecloudretailv2alphaservingconfig *GoogleCloudRetailV2alphaServingConfig) *ProjectsLocationsCatalogsServingConfigsCreateCall { 16022 c := &ProjectsLocationsCatalogsServingConfigsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 16023 c.parent = parent 16024 c.googlecloudretailv2alphaservingconfig = googlecloudretailv2alphaservingconfig 16025 return c 16026 } 16027 16028 // ServingConfigId sets the optional parameter "servingConfigId": Required. The 16029 // ID to use for the ServingConfig, which will become the final component of 16030 // the ServingConfig's resource name. This value should be 4-63 characters, and 16031 // valid characters are /a-z-_/. 16032 func (c *ProjectsLocationsCatalogsServingConfigsCreateCall) ServingConfigId(servingConfigId string) *ProjectsLocationsCatalogsServingConfigsCreateCall { 16033 c.urlParams_.Set("servingConfigId", servingConfigId) 16034 return c 16035 } 16036 16037 // Fields allows partial responses to be retrieved. See 16038 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 16039 // details. 16040 func (c *ProjectsLocationsCatalogsServingConfigsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsServingConfigsCreateCall { 16041 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 16042 return c 16043 } 16044 16045 // Context sets the context to be used in this call's Do method. 16046 func (c *ProjectsLocationsCatalogsServingConfigsCreateCall) Context(ctx context.Context) *ProjectsLocationsCatalogsServingConfigsCreateCall { 16047 c.ctx_ = ctx 16048 return c 16049 } 16050 16051 // Header returns a http.Header that can be modified by the caller to add 16052 // headers to the request. 16053 func (c *ProjectsLocationsCatalogsServingConfigsCreateCall) Header() http.Header { 16054 if c.header_ == nil { 16055 c.header_ = make(http.Header) 16056 } 16057 return c.header_ 16058 } 16059 16060 func (c *ProjectsLocationsCatalogsServingConfigsCreateCall) doRequest(alt string) (*http.Response, error) { 16061 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 16062 var body io.Reader = nil 16063 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphaservingconfig) 16064 if err != nil { 16065 return nil, err 16066 } 16067 c.urlParams_.Set("alt", alt) 16068 c.urlParams_.Set("prettyPrint", "false") 16069 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+parent}/servingConfigs") 16070 urls += "?" + c.urlParams_.Encode() 16071 req, err := http.NewRequest("POST", urls, body) 16072 if err != nil { 16073 return nil, err 16074 } 16075 req.Header = reqHeaders 16076 googleapi.Expand(req.URL, map[string]string{ 16077 "parent": c.parent, 16078 }) 16079 return gensupport.SendRequest(c.ctx_, c.s.client, req) 16080 } 16081 16082 // Do executes the "retail.projects.locations.catalogs.servingConfigs.create" call. 16083 // Any non-2xx status code is an error. Response headers are in either 16084 // *GoogleCloudRetailV2alphaServingConfig.ServerResponse.Header or (if a 16085 // response was returned at all) in error.(*googleapi.Error).Header. Use 16086 // googleapi.IsNotModified to check whether the returned error was because 16087 // http.StatusNotModified was returned. 16088 func (c *ProjectsLocationsCatalogsServingConfigsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2alphaServingConfig, error) { 16089 gensupport.SetOptions(c.urlParams_, opts...) 16090 res, err := c.doRequest("json") 16091 if res != nil && res.StatusCode == http.StatusNotModified { 16092 if res.Body != nil { 16093 res.Body.Close() 16094 } 16095 return nil, gensupport.WrapError(&googleapi.Error{ 16096 Code: res.StatusCode, 16097 Header: res.Header, 16098 }) 16099 } 16100 if err != nil { 16101 return nil, err 16102 } 16103 defer googleapi.CloseBody(res) 16104 if err := googleapi.CheckResponse(res); err != nil { 16105 return nil, gensupport.WrapError(err) 16106 } 16107 ret := &GoogleCloudRetailV2alphaServingConfig{ 16108 ServerResponse: googleapi.ServerResponse{ 16109 Header: res.Header, 16110 HTTPStatusCode: res.StatusCode, 16111 }, 16112 } 16113 target := &ret 16114 if err := gensupport.DecodeResponse(target, res); err != nil { 16115 return nil, err 16116 } 16117 return ret, nil 16118 } 16119 16120 type ProjectsLocationsCatalogsServingConfigsDeleteCall struct { 16121 s *Service 16122 name string 16123 urlParams_ gensupport.URLParams 16124 ctx_ context.Context 16125 header_ http.Header 16126 } 16127 16128 // Delete: Deletes a ServingConfig. Returns a NotFound error if the 16129 // ServingConfig does not exist. 16130 // 16131 // - name: The resource name of the ServingConfig to delete. Format: 16132 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/se 16133 // rvingConfigs/{serving_config_id}`. 16134 func (r *ProjectsLocationsCatalogsServingConfigsService) Delete(name string) *ProjectsLocationsCatalogsServingConfigsDeleteCall { 16135 c := &ProjectsLocationsCatalogsServingConfigsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 16136 c.name = name 16137 return c 16138 } 16139 16140 // Fields allows partial responses to be retrieved. See 16141 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 16142 // details. 16143 func (c *ProjectsLocationsCatalogsServingConfigsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsServingConfigsDeleteCall { 16144 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 16145 return c 16146 } 16147 16148 // Context sets the context to be used in this call's Do method. 16149 func (c *ProjectsLocationsCatalogsServingConfigsDeleteCall) Context(ctx context.Context) *ProjectsLocationsCatalogsServingConfigsDeleteCall { 16150 c.ctx_ = ctx 16151 return c 16152 } 16153 16154 // Header returns a http.Header that can be modified by the caller to add 16155 // headers to the request. 16156 func (c *ProjectsLocationsCatalogsServingConfigsDeleteCall) Header() http.Header { 16157 if c.header_ == nil { 16158 c.header_ = make(http.Header) 16159 } 16160 return c.header_ 16161 } 16162 16163 func (c *ProjectsLocationsCatalogsServingConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { 16164 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 16165 var body io.Reader = nil 16166 c.urlParams_.Set("alt", alt) 16167 c.urlParams_.Set("prettyPrint", "false") 16168 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") 16169 urls += "?" + c.urlParams_.Encode() 16170 req, err := http.NewRequest("DELETE", urls, body) 16171 if err != nil { 16172 return nil, err 16173 } 16174 req.Header = reqHeaders 16175 googleapi.Expand(req.URL, map[string]string{ 16176 "name": c.name, 16177 }) 16178 return gensupport.SendRequest(c.ctx_, c.s.client, req) 16179 } 16180 16181 // Do executes the "retail.projects.locations.catalogs.servingConfigs.delete" call. 16182 // Any non-2xx status code is an error. Response headers are in either 16183 // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was returned at 16184 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 16185 // check whether the returned error was because http.StatusNotModified was 16186 // returned. 16187 func (c *ProjectsLocationsCatalogsServingConfigsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { 16188 gensupport.SetOptions(c.urlParams_, opts...) 16189 res, err := c.doRequest("json") 16190 if res != nil && res.StatusCode == http.StatusNotModified { 16191 if res.Body != nil { 16192 res.Body.Close() 16193 } 16194 return nil, gensupport.WrapError(&googleapi.Error{ 16195 Code: res.StatusCode, 16196 Header: res.Header, 16197 }) 16198 } 16199 if err != nil { 16200 return nil, err 16201 } 16202 defer googleapi.CloseBody(res) 16203 if err := googleapi.CheckResponse(res); err != nil { 16204 return nil, gensupport.WrapError(err) 16205 } 16206 ret := &GoogleProtobufEmpty{ 16207 ServerResponse: googleapi.ServerResponse{ 16208 Header: res.Header, 16209 HTTPStatusCode: res.StatusCode, 16210 }, 16211 } 16212 target := &ret 16213 if err := gensupport.DecodeResponse(target, res); err != nil { 16214 return nil, err 16215 } 16216 return ret, nil 16217 } 16218 16219 type ProjectsLocationsCatalogsServingConfigsGetCall struct { 16220 s *Service 16221 name string 16222 urlParams_ gensupport.URLParams 16223 ifNoneMatch_ string 16224 ctx_ context.Context 16225 header_ http.Header 16226 } 16227 16228 // Get: Gets a ServingConfig. Returns a NotFound error if the ServingConfig 16229 // does not exist. 16230 // 16231 // - name: The resource name of the ServingConfig to get. Format: 16232 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/se 16233 // rvingConfigs/{serving_config_id}`. 16234 func (r *ProjectsLocationsCatalogsServingConfigsService) Get(name string) *ProjectsLocationsCatalogsServingConfigsGetCall { 16235 c := &ProjectsLocationsCatalogsServingConfigsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 16236 c.name = name 16237 return c 16238 } 16239 16240 // Fields allows partial responses to be retrieved. See 16241 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 16242 // details. 16243 func (c *ProjectsLocationsCatalogsServingConfigsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsServingConfigsGetCall { 16244 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 16245 return c 16246 } 16247 16248 // IfNoneMatch sets an optional parameter which makes the operation fail if the 16249 // object's ETag matches the given value. This is useful for getting updates 16250 // only after the object has changed since the last request. 16251 func (c *ProjectsLocationsCatalogsServingConfigsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsServingConfigsGetCall { 16252 c.ifNoneMatch_ = entityTag 16253 return c 16254 } 16255 16256 // Context sets the context to be used in this call's Do method. 16257 func (c *ProjectsLocationsCatalogsServingConfigsGetCall) Context(ctx context.Context) *ProjectsLocationsCatalogsServingConfigsGetCall { 16258 c.ctx_ = ctx 16259 return c 16260 } 16261 16262 // Header returns a http.Header that can be modified by the caller to add 16263 // headers to the request. 16264 func (c *ProjectsLocationsCatalogsServingConfigsGetCall) Header() http.Header { 16265 if c.header_ == nil { 16266 c.header_ = make(http.Header) 16267 } 16268 return c.header_ 16269 } 16270 16271 func (c *ProjectsLocationsCatalogsServingConfigsGetCall) doRequest(alt string) (*http.Response, error) { 16272 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 16273 if c.ifNoneMatch_ != "" { 16274 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 16275 } 16276 var body io.Reader = nil 16277 c.urlParams_.Set("alt", alt) 16278 c.urlParams_.Set("prettyPrint", "false") 16279 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") 16280 urls += "?" + c.urlParams_.Encode() 16281 req, err := http.NewRequest("GET", urls, body) 16282 if err != nil { 16283 return nil, err 16284 } 16285 req.Header = reqHeaders 16286 googleapi.Expand(req.URL, map[string]string{ 16287 "name": c.name, 16288 }) 16289 return gensupport.SendRequest(c.ctx_, c.s.client, req) 16290 } 16291 16292 // Do executes the "retail.projects.locations.catalogs.servingConfigs.get" call. 16293 // Any non-2xx status code is an error. Response headers are in either 16294 // *GoogleCloudRetailV2alphaServingConfig.ServerResponse.Header or (if a 16295 // response was returned at all) in error.(*googleapi.Error).Header. Use 16296 // googleapi.IsNotModified to check whether the returned error was because 16297 // http.StatusNotModified was returned. 16298 func (c *ProjectsLocationsCatalogsServingConfigsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2alphaServingConfig, error) { 16299 gensupport.SetOptions(c.urlParams_, opts...) 16300 res, err := c.doRequest("json") 16301 if res != nil && res.StatusCode == http.StatusNotModified { 16302 if res.Body != nil { 16303 res.Body.Close() 16304 } 16305 return nil, gensupport.WrapError(&googleapi.Error{ 16306 Code: res.StatusCode, 16307 Header: res.Header, 16308 }) 16309 } 16310 if err != nil { 16311 return nil, err 16312 } 16313 defer googleapi.CloseBody(res) 16314 if err := googleapi.CheckResponse(res); err != nil { 16315 return nil, gensupport.WrapError(err) 16316 } 16317 ret := &GoogleCloudRetailV2alphaServingConfig{ 16318 ServerResponse: googleapi.ServerResponse{ 16319 Header: res.Header, 16320 HTTPStatusCode: res.StatusCode, 16321 }, 16322 } 16323 target := &ret 16324 if err := gensupport.DecodeResponse(target, res); err != nil { 16325 return nil, err 16326 } 16327 return ret, nil 16328 } 16329 16330 type ProjectsLocationsCatalogsServingConfigsListCall struct { 16331 s *Service 16332 parent string 16333 urlParams_ gensupport.URLParams 16334 ifNoneMatch_ string 16335 ctx_ context.Context 16336 header_ http.Header 16337 } 16338 16339 // List: Lists all ServingConfigs linked to this catalog. 16340 // 16341 // - parent: The catalog resource name. Format: 16342 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`. 16343 func (r *ProjectsLocationsCatalogsServingConfigsService) List(parent string) *ProjectsLocationsCatalogsServingConfigsListCall { 16344 c := &ProjectsLocationsCatalogsServingConfigsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 16345 c.parent = parent 16346 return c 16347 } 16348 16349 // PageSize sets the optional parameter "pageSize": Maximum number of results 16350 // to return. If unspecified, defaults to 100. If a value greater than 100 is 16351 // provided, at most 100 results are returned. 16352 func (c *ProjectsLocationsCatalogsServingConfigsListCall) PageSize(pageSize int64) *ProjectsLocationsCatalogsServingConfigsListCall { 16353 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 16354 return c 16355 } 16356 16357 // PageToken sets the optional parameter "pageToken": A page token, received 16358 // from a previous `ListServingConfigs` call. Provide this to retrieve the 16359 // subsequent page. 16360 func (c *ProjectsLocationsCatalogsServingConfigsListCall) PageToken(pageToken string) *ProjectsLocationsCatalogsServingConfigsListCall { 16361 c.urlParams_.Set("pageToken", pageToken) 16362 return c 16363 } 16364 16365 // Fields allows partial responses to be retrieved. See 16366 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 16367 // details. 16368 func (c *ProjectsLocationsCatalogsServingConfigsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsServingConfigsListCall { 16369 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 16370 return c 16371 } 16372 16373 // IfNoneMatch sets an optional parameter which makes the operation fail if the 16374 // object's ETag matches the given value. This is useful for getting updates 16375 // only after the object has changed since the last request. 16376 func (c *ProjectsLocationsCatalogsServingConfigsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsServingConfigsListCall { 16377 c.ifNoneMatch_ = entityTag 16378 return c 16379 } 16380 16381 // Context sets the context to be used in this call's Do method. 16382 func (c *ProjectsLocationsCatalogsServingConfigsListCall) Context(ctx context.Context) *ProjectsLocationsCatalogsServingConfigsListCall { 16383 c.ctx_ = ctx 16384 return c 16385 } 16386 16387 // Header returns a http.Header that can be modified by the caller to add 16388 // headers to the request. 16389 func (c *ProjectsLocationsCatalogsServingConfigsListCall) Header() http.Header { 16390 if c.header_ == nil { 16391 c.header_ = make(http.Header) 16392 } 16393 return c.header_ 16394 } 16395 16396 func (c *ProjectsLocationsCatalogsServingConfigsListCall) doRequest(alt string) (*http.Response, error) { 16397 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 16398 if c.ifNoneMatch_ != "" { 16399 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 16400 } 16401 var body io.Reader = nil 16402 c.urlParams_.Set("alt", alt) 16403 c.urlParams_.Set("prettyPrint", "false") 16404 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+parent}/servingConfigs") 16405 urls += "?" + c.urlParams_.Encode() 16406 req, err := http.NewRequest("GET", urls, body) 16407 if err != nil { 16408 return nil, err 16409 } 16410 req.Header = reqHeaders 16411 googleapi.Expand(req.URL, map[string]string{ 16412 "parent": c.parent, 16413 }) 16414 return gensupport.SendRequest(c.ctx_, c.s.client, req) 16415 } 16416 16417 // Do executes the "retail.projects.locations.catalogs.servingConfigs.list" call. 16418 // Any non-2xx status code is an error. Response headers are in either 16419 // *GoogleCloudRetailV2alphaListServingConfigsResponse.ServerResponse.Header or 16420 // (if a response was returned at all) in error.(*googleapi.Error).Header. Use 16421 // googleapi.IsNotModified to check whether the returned error was because 16422 // http.StatusNotModified was returned. 16423 func (c *ProjectsLocationsCatalogsServingConfigsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2alphaListServingConfigsResponse, error) { 16424 gensupport.SetOptions(c.urlParams_, opts...) 16425 res, err := c.doRequest("json") 16426 if res != nil && res.StatusCode == http.StatusNotModified { 16427 if res.Body != nil { 16428 res.Body.Close() 16429 } 16430 return nil, gensupport.WrapError(&googleapi.Error{ 16431 Code: res.StatusCode, 16432 Header: res.Header, 16433 }) 16434 } 16435 if err != nil { 16436 return nil, err 16437 } 16438 defer googleapi.CloseBody(res) 16439 if err := googleapi.CheckResponse(res); err != nil { 16440 return nil, gensupport.WrapError(err) 16441 } 16442 ret := &GoogleCloudRetailV2alphaListServingConfigsResponse{ 16443 ServerResponse: googleapi.ServerResponse{ 16444 Header: res.Header, 16445 HTTPStatusCode: res.StatusCode, 16446 }, 16447 } 16448 target := &ret 16449 if err := gensupport.DecodeResponse(target, res); err != nil { 16450 return nil, err 16451 } 16452 return ret, nil 16453 } 16454 16455 // Pages invokes f for each page of results. 16456 // A non-nil error returned from f will halt the iteration. 16457 // The provided context supersedes any context provided to the Context method. 16458 func (c *ProjectsLocationsCatalogsServingConfigsListCall) Pages(ctx context.Context, f func(*GoogleCloudRetailV2alphaListServingConfigsResponse) error) error { 16459 c.ctx_ = ctx 16460 defer c.PageToken(c.urlParams_.Get("pageToken")) 16461 for { 16462 x, err := c.Do() 16463 if err != nil { 16464 return err 16465 } 16466 if err := f(x); err != nil { 16467 return err 16468 } 16469 if x.NextPageToken == "" { 16470 return nil 16471 } 16472 c.PageToken(x.NextPageToken) 16473 } 16474 } 16475 16476 type ProjectsLocationsCatalogsServingConfigsPatchCall struct { 16477 s *Service 16478 name string 16479 googlecloudretailv2alphaservingconfig *GoogleCloudRetailV2alphaServingConfig 16480 urlParams_ gensupport.URLParams 16481 ctx_ context.Context 16482 header_ http.Header 16483 } 16484 16485 // Patch: Updates a ServingConfig. 16486 // 16487 // - name: Immutable. Fully qualified name 16488 // `projects/*/locations/global/catalogs/*/servingConfig/*`. 16489 func (r *ProjectsLocationsCatalogsServingConfigsService) Patch(name string, googlecloudretailv2alphaservingconfig *GoogleCloudRetailV2alphaServingConfig) *ProjectsLocationsCatalogsServingConfigsPatchCall { 16490 c := &ProjectsLocationsCatalogsServingConfigsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 16491 c.name = name 16492 c.googlecloudretailv2alphaservingconfig = googlecloudretailv2alphaservingconfig 16493 return c 16494 } 16495 16496 // UpdateMask sets the optional parameter "updateMask": Indicates which fields 16497 // in the provided ServingConfig to update. The following are NOT supported: * 16498 // ServingConfig.name If not set, all supported fields are updated. 16499 func (c *ProjectsLocationsCatalogsServingConfigsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsCatalogsServingConfigsPatchCall { 16500 c.urlParams_.Set("updateMask", updateMask) 16501 return c 16502 } 16503 16504 // Fields allows partial responses to be retrieved. See 16505 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 16506 // details. 16507 func (c *ProjectsLocationsCatalogsServingConfigsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsServingConfigsPatchCall { 16508 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 16509 return c 16510 } 16511 16512 // Context sets the context to be used in this call's Do method. 16513 func (c *ProjectsLocationsCatalogsServingConfigsPatchCall) Context(ctx context.Context) *ProjectsLocationsCatalogsServingConfigsPatchCall { 16514 c.ctx_ = ctx 16515 return c 16516 } 16517 16518 // Header returns a http.Header that can be modified by the caller to add 16519 // headers to the request. 16520 func (c *ProjectsLocationsCatalogsServingConfigsPatchCall) Header() http.Header { 16521 if c.header_ == nil { 16522 c.header_ = make(http.Header) 16523 } 16524 return c.header_ 16525 } 16526 16527 func (c *ProjectsLocationsCatalogsServingConfigsPatchCall) doRequest(alt string) (*http.Response, error) { 16528 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 16529 var body io.Reader = nil 16530 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphaservingconfig) 16531 if err != nil { 16532 return nil, err 16533 } 16534 c.urlParams_.Set("alt", alt) 16535 c.urlParams_.Set("prettyPrint", "false") 16536 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") 16537 urls += "?" + c.urlParams_.Encode() 16538 req, err := http.NewRequest("PATCH", urls, body) 16539 if err != nil { 16540 return nil, err 16541 } 16542 req.Header = reqHeaders 16543 googleapi.Expand(req.URL, map[string]string{ 16544 "name": c.name, 16545 }) 16546 return gensupport.SendRequest(c.ctx_, c.s.client, req) 16547 } 16548 16549 // Do executes the "retail.projects.locations.catalogs.servingConfigs.patch" call. 16550 // Any non-2xx status code is an error. Response headers are in either 16551 // *GoogleCloudRetailV2alphaServingConfig.ServerResponse.Header or (if a 16552 // response was returned at all) in error.(*googleapi.Error).Header. Use 16553 // googleapi.IsNotModified to check whether the returned error was because 16554 // http.StatusNotModified was returned. 16555 func (c *ProjectsLocationsCatalogsServingConfigsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2alphaServingConfig, error) { 16556 gensupport.SetOptions(c.urlParams_, opts...) 16557 res, err := c.doRequest("json") 16558 if res != nil && res.StatusCode == http.StatusNotModified { 16559 if res.Body != nil { 16560 res.Body.Close() 16561 } 16562 return nil, gensupport.WrapError(&googleapi.Error{ 16563 Code: res.StatusCode, 16564 Header: res.Header, 16565 }) 16566 } 16567 if err != nil { 16568 return nil, err 16569 } 16570 defer googleapi.CloseBody(res) 16571 if err := googleapi.CheckResponse(res); err != nil { 16572 return nil, gensupport.WrapError(err) 16573 } 16574 ret := &GoogleCloudRetailV2alphaServingConfig{ 16575 ServerResponse: googleapi.ServerResponse{ 16576 Header: res.Header, 16577 HTTPStatusCode: res.StatusCode, 16578 }, 16579 } 16580 target := &ret 16581 if err := gensupport.DecodeResponse(target, res); err != nil { 16582 return nil, err 16583 } 16584 return ret, nil 16585 } 16586 16587 type ProjectsLocationsCatalogsServingConfigsPredictCall struct { 16588 s *Service 16589 placement string 16590 googlecloudretailv2alphapredictrequest *GoogleCloudRetailV2alphaPredictRequest 16591 urlParams_ gensupport.URLParams 16592 ctx_ context.Context 16593 header_ http.Header 16594 } 16595 16596 // Predict: Makes a recommendation prediction. 16597 // 16598 // - placement: Full resource name of the format: 16599 // `{placement=projects/*/locations/global/catalogs/default_catalog/servingCon 16600 // figs/*}` or 16601 // `{placement=projects/*/locations/global/catalogs/default_catalog/placements 16602 // /*}`. We recommend using the `servingConfigs` resource. `placements` is a 16603 // legacy resource. The ID of the Recommendations AI serving config or 16604 // placement. Before you can request predictions from your model, you must 16605 // create at least one serving config or placement for it. For more 16606 // information, see [Manage serving configs] 16607 // (https://cloud.google.com/retail/docs/manage-configs). The full list of 16608 // available serving configs can be seen at 16609 // https://console.cloud.google.com/ai/retail/catalogs/default_catalog/configs. 16610 func (r *ProjectsLocationsCatalogsServingConfigsService) Predict(placement string, googlecloudretailv2alphapredictrequest *GoogleCloudRetailV2alphaPredictRequest) *ProjectsLocationsCatalogsServingConfigsPredictCall { 16611 c := &ProjectsLocationsCatalogsServingConfigsPredictCall{s: r.s, urlParams_: make(gensupport.URLParams)} 16612 c.placement = placement 16613 c.googlecloudretailv2alphapredictrequest = googlecloudretailv2alphapredictrequest 16614 return c 16615 } 16616 16617 // Fields allows partial responses to be retrieved. See 16618 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 16619 // details. 16620 func (c *ProjectsLocationsCatalogsServingConfigsPredictCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsServingConfigsPredictCall { 16621 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 16622 return c 16623 } 16624 16625 // Context sets the context to be used in this call's Do method. 16626 func (c *ProjectsLocationsCatalogsServingConfigsPredictCall) Context(ctx context.Context) *ProjectsLocationsCatalogsServingConfigsPredictCall { 16627 c.ctx_ = ctx 16628 return c 16629 } 16630 16631 // Header returns a http.Header that can be modified by the caller to add 16632 // headers to the request. 16633 func (c *ProjectsLocationsCatalogsServingConfigsPredictCall) Header() http.Header { 16634 if c.header_ == nil { 16635 c.header_ = make(http.Header) 16636 } 16637 return c.header_ 16638 } 16639 16640 func (c *ProjectsLocationsCatalogsServingConfigsPredictCall) doRequest(alt string) (*http.Response, error) { 16641 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 16642 var body io.Reader = nil 16643 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphapredictrequest) 16644 if err != nil { 16645 return nil, err 16646 } 16647 c.urlParams_.Set("alt", alt) 16648 c.urlParams_.Set("prettyPrint", "false") 16649 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+placement}:predict") 16650 urls += "?" + c.urlParams_.Encode() 16651 req, err := http.NewRequest("POST", urls, body) 16652 if err != nil { 16653 return nil, err 16654 } 16655 req.Header = reqHeaders 16656 googleapi.Expand(req.URL, map[string]string{ 16657 "placement": c.placement, 16658 }) 16659 return gensupport.SendRequest(c.ctx_, c.s.client, req) 16660 } 16661 16662 // Do executes the "retail.projects.locations.catalogs.servingConfigs.predict" call. 16663 // Any non-2xx status code is an error. Response headers are in either 16664 // *GoogleCloudRetailV2alphaPredictResponse.ServerResponse.Header or (if a 16665 // response was returned at all) in error.(*googleapi.Error).Header. Use 16666 // googleapi.IsNotModified to check whether the returned error was because 16667 // http.StatusNotModified was returned. 16668 func (c *ProjectsLocationsCatalogsServingConfigsPredictCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2alphaPredictResponse, error) { 16669 gensupport.SetOptions(c.urlParams_, opts...) 16670 res, err := c.doRequest("json") 16671 if res != nil && res.StatusCode == http.StatusNotModified { 16672 if res.Body != nil { 16673 res.Body.Close() 16674 } 16675 return nil, gensupport.WrapError(&googleapi.Error{ 16676 Code: res.StatusCode, 16677 Header: res.Header, 16678 }) 16679 } 16680 if err != nil { 16681 return nil, err 16682 } 16683 defer googleapi.CloseBody(res) 16684 if err := googleapi.CheckResponse(res); err != nil { 16685 return nil, gensupport.WrapError(err) 16686 } 16687 ret := &GoogleCloudRetailV2alphaPredictResponse{ 16688 ServerResponse: googleapi.ServerResponse{ 16689 Header: res.Header, 16690 HTTPStatusCode: res.StatusCode, 16691 }, 16692 } 16693 target := &ret 16694 if err := gensupport.DecodeResponse(target, res); err != nil { 16695 return nil, err 16696 } 16697 return ret, nil 16698 } 16699 16700 type ProjectsLocationsCatalogsServingConfigsRemoveControlCall struct { 16701 s *Service 16702 servingConfig string 16703 googlecloudretailv2alpharemovecontrolrequest *GoogleCloudRetailV2alphaRemoveControlRequest 16704 urlParams_ gensupport.URLParams 16705 ctx_ context.Context 16706 header_ http.Header 16707 } 16708 16709 // RemoveControl: Disables a Control on the specified ServingConfig. The 16710 // control is removed from the ServingConfig. Returns a NOT_FOUND error if the 16711 // Control is not enabled for the ServingConfig. 16712 // 16713 // - servingConfig: The source ServingConfig resource name . Format: 16714 // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/se 16715 // rvingConfigs/{serving_config_id}`. 16716 func (r *ProjectsLocationsCatalogsServingConfigsService) RemoveControl(servingConfig string, googlecloudretailv2alpharemovecontrolrequest *GoogleCloudRetailV2alphaRemoveControlRequest) *ProjectsLocationsCatalogsServingConfigsRemoveControlCall { 16717 c := &ProjectsLocationsCatalogsServingConfigsRemoveControlCall{s: r.s, urlParams_: make(gensupport.URLParams)} 16718 c.servingConfig = servingConfig 16719 c.googlecloudretailv2alpharemovecontrolrequest = googlecloudretailv2alpharemovecontrolrequest 16720 return c 16721 } 16722 16723 // Fields allows partial responses to be retrieved. See 16724 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 16725 // details. 16726 func (c *ProjectsLocationsCatalogsServingConfigsRemoveControlCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsServingConfigsRemoveControlCall { 16727 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 16728 return c 16729 } 16730 16731 // Context sets the context to be used in this call's Do method. 16732 func (c *ProjectsLocationsCatalogsServingConfigsRemoveControlCall) Context(ctx context.Context) *ProjectsLocationsCatalogsServingConfigsRemoveControlCall { 16733 c.ctx_ = ctx 16734 return c 16735 } 16736 16737 // Header returns a http.Header that can be modified by the caller to add 16738 // headers to the request. 16739 func (c *ProjectsLocationsCatalogsServingConfigsRemoveControlCall) Header() http.Header { 16740 if c.header_ == nil { 16741 c.header_ = make(http.Header) 16742 } 16743 return c.header_ 16744 } 16745 16746 func (c *ProjectsLocationsCatalogsServingConfigsRemoveControlCall) doRequest(alt string) (*http.Response, error) { 16747 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 16748 var body io.Reader = nil 16749 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alpharemovecontrolrequest) 16750 if err != nil { 16751 return nil, err 16752 } 16753 c.urlParams_.Set("alt", alt) 16754 c.urlParams_.Set("prettyPrint", "false") 16755 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+servingConfig}:removeControl") 16756 urls += "?" + c.urlParams_.Encode() 16757 req, err := http.NewRequest("POST", urls, body) 16758 if err != nil { 16759 return nil, err 16760 } 16761 req.Header = reqHeaders 16762 googleapi.Expand(req.URL, map[string]string{ 16763 "servingConfig": c.servingConfig, 16764 }) 16765 return gensupport.SendRequest(c.ctx_, c.s.client, req) 16766 } 16767 16768 // Do executes the "retail.projects.locations.catalogs.servingConfigs.removeControl" call. 16769 // Any non-2xx status code is an error. Response headers are in either 16770 // *GoogleCloudRetailV2alphaServingConfig.ServerResponse.Header or (if a 16771 // response was returned at all) in error.(*googleapi.Error).Header. Use 16772 // googleapi.IsNotModified to check whether the returned error was because 16773 // http.StatusNotModified was returned. 16774 func (c *ProjectsLocationsCatalogsServingConfigsRemoveControlCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2alphaServingConfig, error) { 16775 gensupport.SetOptions(c.urlParams_, opts...) 16776 res, err := c.doRequest("json") 16777 if res != nil && res.StatusCode == http.StatusNotModified { 16778 if res.Body != nil { 16779 res.Body.Close() 16780 } 16781 return nil, gensupport.WrapError(&googleapi.Error{ 16782 Code: res.StatusCode, 16783 Header: res.Header, 16784 }) 16785 } 16786 if err != nil { 16787 return nil, err 16788 } 16789 defer googleapi.CloseBody(res) 16790 if err := googleapi.CheckResponse(res); err != nil { 16791 return nil, gensupport.WrapError(err) 16792 } 16793 ret := &GoogleCloudRetailV2alphaServingConfig{ 16794 ServerResponse: googleapi.ServerResponse{ 16795 Header: res.Header, 16796 HTTPStatusCode: res.StatusCode, 16797 }, 16798 } 16799 target := &ret 16800 if err := gensupport.DecodeResponse(target, res); err != nil { 16801 return nil, err 16802 } 16803 return ret, nil 16804 } 16805 16806 type ProjectsLocationsCatalogsServingConfigsSearchCall struct { 16807 s *Service 16808 placement string 16809 googlecloudretailv2alphasearchrequest *GoogleCloudRetailV2alphaSearchRequest 16810 urlParams_ gensupport.URLParams 16811 ctx_ context.Context 16812 header_ http.Header 16813 } 16814 16815 // Search: Performs a search. This feature is only available for users who have 16816 // Retail Search enabled. Enable Retail Search on Cloud Console before using 16817 // this feature. 16818 // 16819 // - placement: The resource name of the Retail Search serving config, such as 16820 // `projects/*/locations/global/catalogs/default_catalog/servingConfigs/defaul 16821 // t_serving_config` or the name of the legacy placement resource, such as 16822 // `projects/*/locations/global/catalogs/default_catalog/placements/default_se 16823 // arch`. This field is used to identify the serving config name and the set 16824 // of models that are used to make the search. 16825 func (r *ProjectsLocationsCatalogsServingConfigsService) Search(placement string, googlecloudretailv2alphasearchrequest *GoogleCloudRetailV2alphaSearchRequest) *ProjectsLocationsCatalogsServingConfigsSearchCall { 16826 c := &ProjectsLocationsCatalogsServingConfigsSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 16827 c.placement = placement 16828 c.googlecloudretailv2alphasearchrequest = googlecloudretailv2alphasearchrequest 16829 return c 16830 } 16831 16832 // Fields allows partial responses to be retrieved. See 16833 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 16834 // details. 16835 func (c *ProjectsLocationsCatalogsServingConfigsSearchCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsServingConfigsSearchCall { 16836 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 16837 return c 16838 } 16839 16840 // Context sets the context to be used in this call's Do method. 16841 func (c *ProjectsLocationsCatalogsServingConfigsSearchCall) Context(ctx context.Context) *ProjectsLocationsCatalogsServingConfigsSearchCall { 16842 c.ctx_ = ctx 16843 return c 16844 } 16845 16846 // Header returns a http.Header that can be modified by the caller to add 16847 // headers to the request. 16848 func (c *ProjectsLocationsCatalogsServingConfigsSearchCall) Header() http.Header { 16849 if c.header_ == nil { 16850 c.header_ = make(http.Header) 16851 } 16852 return c.header_ 16853 } 16854 16855 func (c *ProjectsLocationsCatalogsServingConfigsSearchCall) doRequest(alt string) (*http.Response, error) { 16856 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 16857 var body io.Reader = nil 16858 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphasearchrequest) 16859 if err != nil { 16860 return nil, err 16861 } 16862 c.urlParams_.Set("alt", alt) 16863 c.urlParams_.Set("prettyPrint", "false") 16864 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+placement}:search") 16865 urls += "?" + c.urlParams_.Encode() 16866 req, err := http.NewRequest("POST", urls, body) 16867 if err != nil { 16868 return nil, err 16869 } 16870 req.Header = reqHeaders 16871 googleapi.Expand(req.URL, map[string]string{ 16872 "placement": c.placement, 16873 }) 16874 return gensupport.SendRequest(c.ctx_, c.s.client, req) 16875 } 16876 16877 // Do executes the "retail.projects.locations.catalogs.servingConfigs.search" call. 16878 // Any non-2xx status code is an error. Response headers are in either 16879 // *GoogleCloudRetailV2alphaSearchResponse.ServerResponse.Header or (if a 16880 // response was returned at all) in error.(*googleapi.Error).Header. Use 16881 // googleapi.IsNotModified to check whether the returned error was because 16882 // http.StatusNotModified was returned. 16883 func (c *ProjectsLocationsCatalogsServingConfigsSearchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2alphaSearchResponse, error) { 16884 gensupport.SetOptions(c.urlParams_, opts...) 16885 res, err := c.doRequest("json") 16886 if res != nil && res.StatusCode == http.StatusNotModified { 16887 if res.Body != nil { 16888 res.Body.Close() 16889 } 16890 return nil, gensupport.WrapError(&googleapi.Error{ 16891 Code: res.StatusCode, 16892 Header: res.Header, 16893 }) 16894 } 16895 if err != nil { 16896 return nil, err 16897 } 16898 defer googleapi.CloseBody(res) 16899 if err := googleapi.CheckResponse(res); err != nil { 16900 return nil, gensupport.WrapError(err) 16901 } 16902 ret := &GoogleCloudRetailV2alphaSearchResponse{ 16903 ServerResponse: googleapi.ServerResponse{ 16904 Header: res.Header, 16905 HTTPStatusCode: res.StatusCode, 16906 }, 16907 } 16908 target := &ret 16909 if err := gensupport.DecodeResponse(target, res); err != nil { 16910 return nil, err 16911 } 16912 return ret, nil 16913 } 16914 16915 // Pages invokes f for each page of results. 16916 // A non-nil error returned from f will halt the iteration. 16917 // The provided context supersedes any context provided to the Context method. 16918 func (c *ProjectsLocationsCatalogsServingConfigsSearchCall) Pages(ctx context.Context, f func(*GoogleCloudRetailV2alphaSearchResponse) error) error { 16919 c.ctx_ = ctx 16920 defer func(pt string) { c.googlecloudretailv2alphasearchrequest.PageToken = pt }(c.googlecloudretailv2alphasearchrequest.PageToken) 16921 for { 16922 x, err := c.Do() 16923 if err != nil { 16924 return err 16925 } 16926 if err := f(x); err != nil { 16927 return err 16928 } 16929 if x.NextPageToken == "" { 16930 return nil 16931 } 16932 c.googlecloudretailv2alphasearchrequest.PageToken = x.NextPageToken 16933 } 16934 } 16935 16936 type ProjectsLocationsCatalogsUserEventsCollectCall struct { 16937 s *Service 16938 parent string 16939 urlParams_ gensupport.URLParams 16940 ifNoneMatch_ string 16941 ctx_ context.Context 16942 header_ http.Header 16943 } 16944 16945 // Collect: Writes a single user event from the browser. This uses a GET 16946 // request to due to browser restriction of POST-ing to a 3rd party domain. 16947 // This method is used only by the Retail API JavaScript pixel and Google Tag 16948 // Manager. Users should not call this method directly. 16949 // 16950 // - parent: The parent catalog name, such as 16951 // `projects/1234/locations/global/catalogs/default_catalog`. 16952 func (r *ProjectsLocationsCatalogsUserEventsService) Collect(parent string) *ProjectsLocationsCatalogsUserEventsCollectCall { 16953 c := &ProjectsLocationsCatalogsUserEventsCollectCall{s: r.s, urlParams_: make(gensupport.URLParams)} 16954 c.parent = parent 16955 return c 16956 } 16957 16958 // Ets sets the optional parameter "ets": The event timestamp in milliseconds. 16959 // This prevents browser caching of otherwise identical get requests. The name 16960 // is abbreviated to reduce the payload bytes. 16961 func (c *ProjectsLocationsCatalogsUserEventsCollectCall) Ets(ets int64) *ProjectsLocationsCatalogsUserEventsCollectCall { 16962 c.urlParams_.Set("ets", fmt.Sprint(ets)) 16963 return c 16964 } 16965 16966 // PrebuiltRule sets the optional parameter "prebuiltRule": The prebuilt rule 16967 // name that can convert a specific type of raw_json. For example: "ga4_bq" 16968 // rule for the GA4 user event schema. 16969 func (c *ProjectsLocationsCatalogsUserEventsCollectCall) PrebuiltRule(prebuiltRule string) *ProjectsLocationsCatalogsUserEventsCollectCall { 16970 c.urlParams_.Set("prebuiltRule", prebuiltRule) 16971 return c 16972 } 16973 16974 // RawJson sets the optional parameter "rawJson": An arbitrary serialized JSON 16975 // string that contains necessary information that can comprise a user event. 16976 // When this field is specified, the user_event field will be ignored. Note: 16977 // line-delimited JSON is not supported, a single JSON only. 16978 func (c *ProjectsLocationsCatalogsUserEventsCollectCall) RawJson(rawJson string) *ProjectsLocationsCatalogsUserEventsCollectCall { 16979 c.urlParams_.Set("rawJson", rawJson) 16980 return c 16981 } 16982 16983 // Uri sets the optional parameter "uri": The URL including cgi-parameters but 16984 // excluding the hash fragment with a length limit of 5,000 characters. This is 16985 // often more useful than the referer URL, because many browsers only send the 16986 // domain for 3rd party requests. 16987 func (c *ProjectsLocationsCatalogsUserEventsCollectCall) Uri(uri string) *ProjectsLocationsCatalogsUserEventsCollectCall { 16988 c.urlParams_.Set("uri", uri) 16989 return c 16990 } 16991 16992 // UserEvent sets the optional parameter "userEvent": Required. URL encoded 16993 // UserEvent proto with a length limit of 2,000,000 characters. 16994 func (c *ProjectsLocationsCatalogsUserEventsCollectCall) UserEvent(userEvent string) *ProjectsLocationsCatalogsUserEventsCollectCall { 16995 c.urlParams_.Set("userEvent", userEvent) 16996 return c 16997 } 16998 16999 // Fields allows partial responses to be retrieved. See 17000 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 17001 // details. 17002 func (c *ProjectsLocationsCatalogsUserEventsCollectCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsUserEventsCollectCall { 17003 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 17004 return c 17005 } 17006 17007 // IfNoneMatch sets an optional parameter which makes the operation fail if the 17008 // object's ETag matches the given value. This is useful for getting updates 17009 // only after the object has changed since the last request. 17010 func (c *ProjectsLocationsCatalogsUserEventsCollectCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsUserEventsCollectCall { 17011 c.ifNoneMatch_ = entityTag 17012 return c 17013 } 17014 17015 // Context sets the context to be used in this call's Do method. 17016 func (c *ProjectsLocationsCatalogsUserEventsCollectCall) Context(ctx context.Context) *ProjectsLocationsCatalogsUserEventsCollectCall { 17017 c.ctx_ = ctx 17018 return c 17019 } 17020 17021 // Header returns a http.Header that can be modified by the caller to add 17022 // headers to the request. 17023 func (c *ProjectsLocationsCatalogsUserEventsCollectCall) Header() http.Header { 17024 if c.header_ == nil { 17025 c.header_ = make(http.Header) 17026 } 17027 return c.header_ 17028 } 17029 17030 func (c *ProjectsLocationsCatalogsUserEventsCollectCall) doRequest(alt string) (*http.Response, error) { 17031 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 17032 if c.ifNoneMatch_ != "" { 17033 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 17034 } 17035 var body io.Reader = nil 17036 c.urlParams_.Set("alt", alt) 17037 c.urlParams_.Set("prettyPrint", "false") 17038 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+parent}/userEvents:collect") 17039 urls += "?" + c.urlParams_.Encode() 17040 req, err := http.NewRequest("GET", urls, body) 17041 if err != nil { 17042 return nil, err 17043 } 17044 req.Header = reqHeaders 17045 googleapi.Expand(req.URL, map[string]string{ 17046 "parent": c.parent, 17047 }) 17048 return gensupport.SendRequest(c.ctx_, c.s.client, req) 17049 } 17050 17051 // Do executes the "retail.projects.locations.catalogs.userEvents.collect" call. 17052 // Any non-2xx status code is an error. Response headers are in either 17053 // *GoogleApiHttpBody.ServerResponse.Header or (if a response was returned at 17054 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 17055 // check whether the returned error was because http.StatusNotModified was 17056 // returned. 17057 func (c *ProjectsLocationsCatalogsUserEventsCollectCall) Do(opts ...googleapi.CallOption) (*GoogleApiHttpBody, error) { 17058 gensupport.SetOptions(c.urlParams_, opts...) 17059 res, err := c.doRequest("json") 17060 if res != nil && res.StatusCode == http.StatusNotModified { 17061 if res.Body != nil { 17062 res.Body.Close() 17063 } 17064 return nil, gensupport.WrapError(&googleapi.Error{ 17065 Code: res.StatusCode, 17066 Header: res.Header, 17067 }) 17068 } 17069 if err != nil { 17070 return nil, err 17071 } 17072 defer googleapi.CloseBody(res) 17073 if err := googleapi.CheckResponse(res); err != nil { 17074 return nil, gensupport.WrapError(err) 17075 } 17076 ret := &GoogleApiHttpBody{ 17077 ServerResponse: googleapi.ServerResponse{ 17078 Header: res.Header, 17079 HTTPStatusCode: res.StatusCode, 17080 }, 17081 } 17082 target := &ret 17083 if err := gensupport.DecodeResponse(target, res); err != nil { 17084 return nil, err 17085 } 17086 return ret, nil 17087 } 17088 17089 type ProjectsLocationsCatalogsUserEventsImportCall struct { 17090 s *Service 17091 parent string 17092 googlecloudretailv2alphaimportusereventsrequest *GoogleCloudRetailV2alphaImportUserEventsRequest 17093 urlParams_ gensupport.URLParams 17094 ctx_ context.Context 17095 header_ http.Header 17096 } 17097 17098 // Import: Bulk import of User events. Request processing might be synchronous. 17099 // Events that already exist are skipped. Use this method for backfilling 17100 // historical user events. `Operation.response` is of type `ImportResponse`. 17101 // Note that it is possible for a subset of the items to be successfully 17102 // inserted. `Operation.metadata` is of type `ImportMetadata`. 17103 // 17104 // - parent: `projects/1234/locations/global/catalogs/default_catalog`. 17105 func (r *ProjectsLocationsCatalogsUserEventsService) Import(parent string, googlecloudretailv2alphaimportusereventsrequest *GoogleCloudRetailV2alphaImportUserEventsRequest) *ProjectsLocationsCatalogsUserEventsImportCall { 17106 c := &ProjectsLocationsCatalogsUserEventsImportCall{s: r.s, urlParams_: make(gensupport.URLParams)} 17107 c.parent = parent 17108 c.googlecloudretailv2alphaimportusereventsrequest = googlecloudretailv2alphaimportusereventsrequest 17109 return c 17110 } 17111 17112 // Fields allows partial responses to be retrieved. See 17113 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 17114 // details. 17115 func (c *ProjectsLocationsCatalogsUserEventsImportCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsUserEventsImportCall { 17116 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 17117 return c 17118 } 17119 17120 // Context sets the context to be used in this call's Do method. 17121 func (c *ProjectsLocationsCatalogsUserEventsImportCall) Context(ctx context.Context) *ProjectsLocationsCatalogsUserEventsImportCall { 17122 c.ctx_ = ctx 17123 return c 17124 } 17125 17126 // Header returns a http.Header that can be modified by the caller to add 17127 // headers to the request. 17128 func (c *ProjectsLocationsCatalogsUserEventsImportCall) Header() http.Header { 17129 if c.header_ == nil { 17130 c.header_ = make(http.Header) 17131 } 17132 return c.header_ 17133 } 17134 17135 func (c *ProjectsLocationsCatalogsUserEventsImportCall) doRequest(alt string) (*http.Response, error) { 17136 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 17137 var body io.Reader = nil 17138 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphaimportusereventsrequest) 17139 if err != nil { 17140 return nil, err 17141 } 17142 c.urlParams_.Set("alt", alt) 17143 c.urlParams_.Set("prettyPrint", "false") 17144 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+parent}/userEvents:import") 17145 urls += "?" + c.urlParams_.Encode() 17146 req, err := http.NewRequest("POST", urls, body) 17147 if err != nil { 17148 return nil, err 17149 } 17150 req.Header = reqHeaders 17151 googleapi.Expand(req.URL, map[string]string{ 17152 "parent": c.parent, 17153 }) 17154 return gensupport.SendRequest(c.ctx_, c.s.client, req) 17155 } 17156 17157 // Do executes the "retail.projects.locations.catalogs.userEvents.import" call. 17158 // Any non-2xx status code is an error. Response headers are in either 17159 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was 17160 // returned at all) in error.(*googleapi.Error).Header. Use 17161 // googleapi.IsNotModified to check whether the returned error was because 17162 // http.StatusNotModified was returned. 17163 func (c *ProjectsLocationsCatalogsUserEventsImportCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 17164 gensupport.SetOptions(c.urlParams_, opts...) 17165 res, err := c.doRequest("json") 17166 if res != nil && res.StatusCode == http.StatusNotModified { 17167 if res.Body != nil { 17168 res.Body.Close() 17169 } 17170 return nil, gensupport.WrapError(&googleapi.Error{ 17171 Code: res.StatusCode, 17172 Header: res.Header, 17173 }) 17174 } 17175 if err != nil { 17176 return nil, err 17177 } 17178 defer googleapi.CloseBody(res) 17179 if err := googleapi.CheckResponse(res); err != nil { 17180 return nil, gensupport.WrapError(err) 17181 } 17182 ret := &GoogleLongrunningOperation{ 17183 ServerResponse: googleapi.ServerResponse{ 17184 Header: res.Header, 17185 HTTPStatusCode: res.StatusCode, 17186 }, 17187 } 17188 target := &ret 17189 if err := gensupport.DecodeResponse(target, res); err != nil { 17190 return nil, err 17191 } 17192 return ret, nil 17193 } 17194 17195 type ProjectsLocationsCatalogsUserEventsPurgeCall struct { 17196 s *Service 17197 parent string 17198 googlecloudretailv2alphapurgeusereventsrequest *GoogleCloudRetailV2alphaPurgeUserEventsRequest 17199 urlParams_ gensupport.URLParams 17200 ctx_ context.Context 17201 header_ http.Header 17202 } 17203 17204 // Purge: Deletes permanently all user events specified by the filter provided. 17205 // Depending on the number of events specified by the filter, this operation 17206 // could take hours or days to complete. To test a filter, use the list command 17207 // first. 17208 // 17209 // - parent: The resource name of the catalog under which the events are 17210 // created. The format is 17211 // `projects/${projectId}/locations/global/catalogs/${catalogId}`. 17212 func (r *ProjectsLocationsCatalogsUserEventsService) Purge(parent string, googlecloudretailv2alphapurgeusereventsrequest *GoogleCloudRetailV2alphaPurgeUserEventsRequest) *ProjectsLocationsCatalogsUserEventsPurgeCall { 17213 c := &ProjectsLocationsCatalogsUserEventsPurgeCall{s: r.s, urlParams_: make(gensupport.URLParams)} 17214 c.parent = parent 17215 c.googlecloudretailv2alphapurgeusereventsrequest = googlecloudretailv2alphapurgeusereventsrequest 17216 return c 17217 } 17218 17219 // Fields allows partial responses to be retrieved. See 17220 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 17221 // details. 17222 func (c *ProjectsLocationsCatalogsUserEventsPurgeCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsUserEventsPurgeCall { 17223 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 17224 return c 17225 } 17226 17227 // Context sets the context to be used in this call's Do method. 17228 func (c *ProjectsLocationsCatalogsUserEventsPurgeCall) Context(ctx context.Context) *ProjectsLocationsCatalogsUserEventsPurgeCall { 17229 c.ctx_ = ctx 17230 return c 17231 } 17232 17233 // Header returns a http.Header that can be modified by the caller to add 17234 // headers to the request. 17235 func (c *ProjectsLocationsCatalogsUserEventsPurgeCall) Header() http.Header { 17236 if c.header_ == nil { 17237 c.header_ = make(http.Header) 17238 } 17239 return c.header_ 17240 } 17241 17242 func (c *ProjectsLocationsCatalogsUserEventsPurgeCall) doRequest(alt string) (*http.Response, error) { 17243 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 17244 var body io.Reader = nil 17245 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphapurgeusereventsrequest) 17246 if err != nil { 17247 return nil, err 17248 } 17249 c.urlParams_.Set("alt", alt) 17250 c.urlParams_.Set("prettyPrint", "false") 17251 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+parent}/userEvents:purge") 17252 urls += "?" + c.urlParams_.Encode() 17253 req, err := http.NewRequest("POST", urls, body) 17254 if err != nil { 17255 return nil, err 17256 } 17257 req.Header = reqHeaders 17258 googleapi.Expand(req.URL, map[string]string{ 17259 "parent": c.parent, 17260 }) 17261 return gensupport.SendRequest(c.ctx_, c.s.client, req) 17262 } 17263 17264 // Do executes the "retail.projects.locations.catalogs.userEvents.purge" call. 17265 // Any non-2xx status code is an error. Response headers are in either 17266 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was 17267 // returned at all) in error.(*googleapi.Error).Header. Use 17268 // googleapi.IsNotModified to check whether the returned error was because 17269 // http.StatusNotModified was returned. 17270 func (c *ProjectsLocationsCatalogsUserEventsPurgeCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 17271 gensupport.SetOptions(c.urlParams_, opts...) 17272 res, err := c.doRequest("json") 17273 if res != nil && res.StatusCode == http.StatusNotModified { 17274 if res.Body != nil { 17275 res.Body.Close() 17276 } 17277 return nil, gensupport.WrapError(&googleapi.Error{ 17278 Code: res.StatusCode, 17279 Header: res.Header, 17280 }) 17281 } 17282 if err != nil { 17283 return nil, err 17284 } 17285 defer googleapi.CloseBody(res) 17286 if err := googleapi.CheckResponse(res); err != nil { 17287 return nil, gensupport.WrapError(err) 17288 } 17289 ret := &GoogleLongrunningOperation{ 17290 ServerResponse: googleapi.ServerResponse{ 17291 Header: res.Header, 17292 HTTPStatusCode: res.StatusCode, 17293 }, 17294 } 17295 target := &ret 17296 if err := gensupport.DecodeResponse(target, res); err != nil { 17297 return nil, err 17298 } 17299 return ret, nil 17300 } 17301 17302 type ProjectsLocationsCatalogsUserEventsRejoinCall struct { 17303 s *Service 17304 parent string 17305 googlecloudretailv2alpharejoinusereventsrequest *GoogleCloudRetailV2alphaRejoinUserEventsRequest 17306 urlParams_ gensupport.URLParams 17307 ctx_ context.Context 17308 header_ http.Header 17309 } 17310 17311 // Rejoin: Starts a user-event rejoin operation with latest product catalog. 17312 // Events are not annotated with detailed product information for products that 17313 // are missing from the catalog when the user event is ingested. These events 17314 // are stored as unjoined events with limited usage on training and serving. 17315 // You can use this method to start a join operation on specified events with 17316 // the latest version of product catalog. You can also use this method to 17317 // correct events joined with the wrong product catalog. A rejoin operation can 17318 // take hours or days to complete. 17319 // 17320 // - parent: The parent catalog resource name, such as 17321 // `projects/1234/locations/global/catalogs/default_catalog`. 17322 func (r *ProjectsLocationsCatalogsUserEventsService) Rejoin(parent string, googlecloudretailv2alpharejoinusereventsrequest *GoogleCloudRetailV2alphaRejoinUserEventsRequest) *ProjectsLocationsCatalogsUserEventsRejoinCall { 17323 c := &ProjectsLocationsCatalogsUserEventsRejoinCall{s: r.s, urlParams_: make(gensupport.URLParams)} 17324 c.parent = parent 17325 c.googlecloudretailv2alpharejoinusereventsrequest = googlecloudretailv2alpharejoinusereventsrequest 17326 return c 17327 } 17328 17329 // Fields allows partial responses to be retrieved. See 17330 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 17331 // details. 17332 func (c *ProjectsLocationsCatalogsUserEventsRejoinCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsUserEventsRejoinCall { 17333 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 17334 return c 17335 } 17336 17337 // Context sets the context to be used in this call's Do method. 17338 func (c *ProjectsLocationsCatalogsUserEventsRejoinCall) Context(ctx context.Context) *ProjectsLocationsCatalogsUserEventsRejoinCall { 17339 c.ctx_ = ctx 17340 return c 17341 } 17342 17343 // Header returns a http.Header that can be modified by the caller to add 17344 // headers to the request. 17345 func (c *ProjectsLocationsCatalogsUserEventsRejoinCall) Header() http.Header { 17346 if c.header_ == nil { 17347 c.header_ = make(http.Header) 17348 } 17349 return c.header_ 17350 } 17351 17352 func (c *ProjectsLocationsCatalogsUserEventsRejoinCall) doRequest(alt string) (*http.Response, error) { 17353 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 17354 var body io.Reader = nil 17355 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alpharejoinusereventsrequest) 17356 if err != nil { 17357 return nil, err 17358 } 17359 c.urlParams_.Set("alt", alt) 17360 c.urlParams_.Set("prettyPrint", "false") 17361 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+parent}/userEvents:rejoin") 17362 urls += "?" + c.urlParams_.Encode() 17363 req, err := http.NewRequest("POST", urls, body) 17364 if err != nil { 17365 return nil, err 17366 } 17367 req.Header = reqHeaders 17368 googleapi.Expand(req.URL, map[string]string{ 17369 "parent": c.parent, 17370 }) 17371 return gensupport.SendRequest(c.ctx_, c.s.client, req) 17372 } 17373 17374 // Do executes the "retail.projects.locations.catalogs.userEvents.rejoin" call. 17375 // Any non-2xx status code is an error. Response headers are in either 17376 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was 17377 // returned at all) in error.(*googleapi.Error).Header. Use 17378 // googleapi.IsNotModified to check whether the returned error was because 17379 // http.StatusNotModified was returned. 17380 func (c *ProjectsLocationsCatalogsUserEventsRejoinCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 17381 gensupport.SetOptions(c.urlParams_, opts...) 17382 res, err := c.doRequest("json") 17383 if res != nil && res.StatusCode == http.StatusNotModified { 17384 if res.Body != nil { 17385 res.Body.Close() 17386 } 17387 return nil, gensupport.WrapError(&googleapi.Error{ 17388 Code: res.StatusCode, 17389 Header: res.Header, 17390 }) 17391 } 17392 if err != nil { 17393 return nil, err 17394 } 17395 defer googleapi.CloseBody(res) 17396 if err := googleapi.CheckResponse(res); err != nil { 17397 return nil, gensupport.WrapError(err) 17398 } 17399 ret := &GoogleLongrunningOperation{ 17400 ServerResponse: googleapi.ServerResponse{ 17401 Header: res.Header, 17402 HTTPStatusCode: res.StatusCode, 17403 }, 17404 } 17405 target := &ret 17406 if err := gensupport.DecodeResponse(target, res); err != nil { 17407 return nil, err 17408 } 17409 return ret, nil 17410 } 17411 17412 type ProjectsLocationsCatalogsUserEventsWriteCall struct { 17413 s *Service 17414 parent string 17415 googlecloudretailv2alphauserevent *GoogleCloudRetailV2alphaUserEvent 17416 urlParams_ gensupport.URLParams 17417 ctx_ context.Context 17418 header_ http.Header 17419 } 17420 17421 // Write: Writes a single user event. 17422 // 17423 // - parent: The parent catalog resource name, such as 17424 // `projects/1234/locations/global/catalogs/default_catalog`. 17425 func (r *ProjectsLocationsCatalogsUserEventsService) Write(parent string, googlecloudretailv2alphauserevent *GoogleCloudRetailV2alphaUserEvent) *ProjectsLocationsCatalogsUserEventsWriteCall { 17426 c := &ProjectsLocationsCatalogsUserEventsWriteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 17427 c.parent = parent 17428 c.googlecloudretailv2alphauserevent = googlecloudretailv2alphauserevent 17429 return c 17430 } 17431 17432 // WriteAsync sets the optional parameter "writeAsync": If set to true, the 17433 // user event will be written asynchronously after validation, and the API will 17434 // respond without waiting for the write. Therefore, silent failures can occur 17435 // even if the API returns success. In case of silent failures, error messages 17436 // can be found in Stackdriver logs. 17437 func (c *ProjectsLocationsCatalogsUserEventsWriteCall) WriteAsync(writeAsync bool) *ProjectsLocationsCatalogsUserEventsWriteCall { 17438 c.urlParams_.Set("writeAsync", fmt.Sprint(writeAsync)) 17439 return c 17440 } 17441 17442 // Fields allows partial responses to be retrieved. See 17443 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 17444 // details. 17445 func (c *ProjectsLocationsCatalogsUserEventsWriteCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsUserEventsWriteCall { 17446 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 17447 return c 17448 } 17449 17450 // Context sets the context to be used in this call's Do method. 17451 func (c *ProjectsLocationsCatalogsUserEventsWriteCall) Context(ctx context.Context) *ProjectsLocationsCatalogsUserEventsWriteCall { 17452 c.ctx_ = ctx 17453 return c 17454 } 17455 17456 // Header returns a http.Header that can be modified by the caller to add 17457 // headers to the request. 17458 func (c *ProjectsLocationsCatalogsUserEventsWriteCall) Header() http.Header { 17459 if c.header_ == nil { 17460 c.header_ = make(http.Header) 17461 } 17462 return c.header_ 17463 } 17464 17465 func (c *ProjectsLocationsCatalogsUserEventsWriteCall) doRequest(alt string) (*http.Response, error) { 17466 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 17467 var body io.Reader = nil 17468 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphauserevent) 17469 if err != nil { 17470 return nil, err 17471 } 17472 c.urlParams_.Set("alt", alt) 17473 c.urlParams_.Set("prettyPrint", "false") 17474 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+parent}/userEvents:write") 17475 urls += "?" + c.urlParams_.Encode() 17476 req, err := http.NewRequest("POST", urls, body) 17477 if err != nil { 17478 return nil, err 17479 } 17480 req.Header = reqHeaders 17481 googleapi.Expand(req.URL, map[string]string{ 17482 "parent": c.parent, 17483 }) 17484 return gensupport.SendRequest(c.ctx_, c.s.client, req) 17485 } 17486 17487 // Do executes the "retail.projects.locations.catalogs.userEvents.write" call. 17488 // Any non-2xx status code is an error. Response headers are in either 17489 // *GoogleCloudRetailV2alphaUserEvent.ServerResponse.Header or (if a response 17490 // was returned at all) in error.(*googleapi.Error).Header. Use 17491 // googleapi.IsNotModified to check whether the returned error was because 17492 // http.StatusNotModified was returned. 17493 func (c *ProjectsLocationsCatalogsUserEventsWriteCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2alphaUserEvent, error) { 17494 gensupport.SetOptions(c.urlParams_, opts...) 17495 res, err := c.doRequest("json") 17496 if res != nil && res.StatusCode == http.StatusNotModified { 17497 if res.Body != nil { 17498 res.Body.Close() 17499 } 17500 return nil, gensupport.WrapError(&googleapi.Error{ 17501 Code: res.StatusCode, 17502 Header: res.Header, 17503 }) 17504 } 17505 if err != nil { 17506 return nil, err 17507 } 17508 defer googleapi.CloseBody(res) 17509 if err := googleapi.CheckResponse(res); err != nil { 17510 return nil, gensupport.WrapError(err) 17511 } 17512 ret := &GoogleCloudRetailV2alphaUserEvent{ 17513 ServerResponse: googleapi.ServerResponse{ 17514 Header: res.Header, 17515 HTTPStatusCode: res.StatusCode, 17516 }, 17517 } 17518 target := &ret 17519 if err := gensupport.DecodeResponse(target, res); err != nil { 17520 return nil, err 17521 } 17522 return ret, nil 17523 } 17524 17525 type ProjectsLocationsOperationsGetCall struct { 17526 s *Service 17527 name string 17528 urlParams_ gensupport.URLParams 17529 ifNoneMatch_ string 17530 ctx_ context.Context 17531 header_ http.Header 17532 } 17533 17534 // Get: Gets the latest state of a long-running operation. Clients can use this 17535 // method to poll the operation result at intervals as recommended by the API 17536 // service. 17537 // 17538 // - name: The name of the operation resource. 17539 func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall { 17540 c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 17541 c.name = name 17542 return c 17543 } 17544 17545 // Fields allows partial responses to be retrieved. See 17546 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 17547 // details. 17548 func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall { 17549 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 17550 return c 17551 } 17552 17553 // IfNoneMatch sets an optional parameter which makes the operation fail if the 17554 // object's ETag matches the given value. This is useful for getting updates 17555 // only after the object has changed since the last request. 17556 func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall { 17557 c.ifNoneMatch_ = entityTag 17558 return c 17559 } 17560 17561 // Context sets the context to be used in this call's Do method. 17562 func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall { 17563 c.ctx_ = ctx 17564 return c 17565 } 17566 17567 // Header returns a http.Header that can be modified by the caller to add 17568 // headers to the request. 17569 func (c *ProjectsLocationsOperationsGetCall) Header() http.Header { 17570 if c.header_ == nil { 17571 c.header_ = make(http.Header) 17572 } 17573 return c.header_ 17574 } 17575 17576 func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) { 17577 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 17578 if c.ifNoneMatch_ != "" { 17579 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 17580 } 17581 var body io.Reader = nil 17582 c.urlParams_.Set("alt", alt) 17583 c.urlParams_.Set("prettyPrint", "false") 17584 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") 17585 urls += "?" + c.urlParams_.Encode() 17586 req, err := http.NewRequest("GET", urls, body) 17587 if err != nil { 17588 return nil, err 17589 } 17590 req.Header = reqHeaders 17591 googleapi.Expand(req.URL, map[string]string{ 17592 "name": c.name, 17593 }) 17594 return gensupport.SendRequest(c.ctx_, c.s.client, req) 17595 } 17596 17597 // Do executes the "retail.projects.locations.operations.get" call. 17598 // Any non-2xx status code is an error. Response headers are in either 17599 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was 17600 // returned at all) in error.(*googleapi.Error).Header. Use 17601 // googleapi.IsNotModified to check whether the returned error was because 17602 // http.StatusNotModified was returned. 17603 func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 17604 gensupport.SetOptions(c.urlParams_, opts...) 17605 res, err := c.doRequest("json") 17606 if res != nil && res.StatusCode == http.StatusNotModified { 17607 if res.Body != nil { 17608 res.Body.Close() 17609 } 17610 return nil, gensupport.WrapError(&googleapi.Error{ 17611 Code: res.StatusCode, 17612 Header: res.Header, 17613 }) 17614 } 17615 if err != nil { 17616 return nil, err 17617 } 17618 defer googleapi.CloseBody(res) 17619 if err := googleapi.CheckResponse(res); err != nil { 17620 return nil, gensupport.WrapError(err) 17621 } 17622 ret := &GoogleLongrunningOperation{ 17623 ServerResponse: googleapi.ServerResponse{ 17624 Header: res.Header, 17625 HTTPStatusCode: res.StatusCode, 17626 }, 17627 } 17628 target := &ret 17629 if err := gensupport.DecodeResponse(target, res); err != nil { 17630 return nil, err 17631 } 17632 return ret, nil 17633 } 17634 17635 type ProjectsLocationsOperationsListCall struct { 17636 s *Service 17637 name string 17638 urlParams_ gensupport.URLParams 17639 ifNoneMatch_ string 17640 ctx_ context.Context 17641 header_ http.Header 17642 } 17643 17644 // List: Lists operations that match the specified filter in the request. If 17645 // the server doesn't support this method, it returns `UNIMPLEMENTED`. 17646 // 17647 // - name: The name of the operation's parent resource. 17648 func (r *ProjectsLocationsOperationsService) List(name string) *ProjectsLocationsOperationsListCall { 17649 c := &ProjectsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 17650 c.name = name 17651 return c 17652 } 17653 17654 // Filter sets the optional parameter "filter": The standard list filter. 17655 func (c *ProjectsLocationsOperationsListCall) Filter(filter string) *ProjectsLocationsOperationsListCall { 17656 c.urlParams_.Set("filter", filter) 17657 return c 17658 } 17659 17660 // PageSize sets the optional parameter "pageSize": The standard list page 17661 // size. 17662 func (c *ProjectsLocationsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsOperationsListCall { 17663 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 17664 return c 17665 } 17666 17667 // PageToken sets the optional parameter "pageToken": The standard list page 17668 // token. 17669 func (c *ProjectsLocationsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsOperationsListCall { 17670 c.urlParams_.Set("pageToken", pageToken) 17671 return c 17672 } 17673 17674 // Fields allows partial responses to be retrieved. See 17675 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 17676 // details. 17677 func (c *ProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsListCall { 17678 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 17679 return c 17680 } 17681 17682 // IfNoneMatch sets an optional parameter which makes the operation fail if the 17683 // object's ETag matches the given value. This is useful for getting updates 17684 // only after the object has changed since the last request. 17685 func (c *ProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsListCall { 17686 c.ifNoneMatch_ = entityTag 17687 return c 17688 } 17689 17690 // Context sets the context to be used in this call's Do method. 17691 func (c *ProjectsLocationsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsOperationsListCall { 17692 c.ctx_ = ctx 17693 return c 17694 } 17695 17696 // Header returns a http.Header that can be modified by the caller to add 17697 // headers to the request. 17698 func (c *ProjectsLocationsOperationsListCall) Header() http.Header { 17699 if c.header_ == nil { 17700 c.header_ = make(http.Header) 17701 } 17702 return c.header_ 17703 } 17704 17705 func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) { 17706 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 17707 if c.ifNoneMatch_ != "" { 17708 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 17709 } 17710 var body io.Reader = nil 17711 c.urlParams_.Set("alt", alt) 17712 c.urlParams_.Set("prettyPrint", "false") 17713 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}/operations") 17714 urls += "?" + c.urlParams_.Encode() 17715 req, err := http.NewRequest("GET", urls, body) 17716 if err != nil { 17717 return nil, err 17718 } 17719 req.Header = reqHeaders 17720 googleapi.Expand(req.URL, map[string]string{ 17721 "name": c.name, 17722 }) 17723 return gensupport.SendRequest(c.ctx_, c.s.client, req) 17724 } 17725 17726 // Do executes the "retail.projects.locations.operations.list" call. 17727 // Any non-2xx status code is an error. Response headers are in either 17728 // *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if a 17729 // response was returned at all) in error.(*googleapi.Error).Header. Use 17730 // googleapi.IsNotModified to check whether the returned error was because 17731 // http.StatusNotModified was returned. 17732 func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { 17733 gensupport.SetOptions(c.urlParams_, opts...) 17734 res, err := c.doRequest("json") 17735 if res != nil && res.StatusCode == http.StatusNotModified { 17736 if res.Body != nil { 17737 res.Body.Close() 17738 } 17739 return nil, gensupport.WrapError(&googleapi.Error{ 17740 Code: res.StatusCode, 17741 Header: res.Header, 17742 }) 17743 } 17744 if err != nil { 17745 return nil, err 17746 } 17747 defer googleapi.CloseBody(res) 17748 if err := googleapi.CheckResponse(res); err != nil { 17749 return nil, gensupport.WrapError(err) 17750 } 17751 ret := &GoogleLongrunningListOperationsResponse{ 17752 ServerResponse: googleapi.ServerResponse{ 17753 Header: res.Header, 17754 HTTPStatusCode: res.StatusCode, 17755 }, 17756 } 17757 target := &ret 17758 if err := gensupport.DecodeResponse(target, res); err != nil { 17759 return nil, err 17760 } 17761 return ret, nil 17762 } 17763 17764 // Pages invokes f for each page of results. 17765 // A non-nil error returned from f will halt the iteration. 17766 // The provided context supersedes any context provided to the Context method. 17767 func (c *ProjectsLocationsOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { 17768 c.ctx_ = ctx 17769 defer c.PageToken(c.urlParams_.Get("pageToken")) 17770 for { 17771 x, err := c.Do() 17772 if err != nil { 17773 return err 17774 } 17775 if err := f(x); err != nil { 17776 return err 17777 } 17778 if x.NextPageToken == "" { 17779 return nil 17780 } 17781 c.PageToken(x.NextPageToken) 17782 } 17783 } 17784 17785 type ProjectsOperationsGetCall struct { 17786 s *Service 17787 name string 17788 urlParams_ gensupport.URLParams 17789 ifNoneMatch_ string 17790 ctx_ context.Context 17791 header_ http.Header 17792 } 17793 17794 // Get: Gets the latest state of a long-running operation. Clients can use this 17795 // method to poll the operation result at intervals as recommended by the API 17796 // service. 17797 // 17798 // - name: The name of the operation resource. 17799 func (r *ProjectsOperationsService) Get(name string) *ProjectsOperationsGetCall { 17800 c := &ProjectsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 17801 c.name = name 17802 return c 17803 } 17804 17805 // Fields allows partial responses to be retrieved. See 17806 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 17807 // details. 17808 func (c *ProjectsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsOperationsGetCall { 17809 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 17810 return c 17811 } 17812 17813 // IfNoneMatch sets an optional parameter which makes the operation fail if the 17814 // object's ETag matches the given value. This is useful for getting updates 17815 // only after the object has changed since the last request. 17816 func (c *ProjectsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsOperationsGetCall { 17817 c.ifNoneMatch_ = entityTag 17818 return c 17819 } 17820 17821 // Context sets the context to be used in this call's Do method. 17822 func (c *ProjectsOperationsGetCall) Context(ctx context.Context) *ProjectsOperationsGetCall { 17823 c.ctx_ = ctx 17824 return c 17825 } 17826 17827 // Header returns a http.Header that can be modified by the caller to add 17828 // headers to the request. 17829 func (c *ProjectsOperationsGetCall) Header() http.Header { 17830 if c.header_ == nil { 17831 c.header_ = make(http.Header) 17832 } 17833 return c.header_ 17834 } 17835 17836 func (c *ProjectsOperationsGetCall) doRequest(alt string) (*http.Response, error) { 17837 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 17838 if c.ifNoneMatch_ != "" { 17839 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 17840 } 17841 var body io.Reader = nil 17842 c.urlParams_.Set("alt", alt) 17843 c.urlParams_.Set("prettyPrint", "false") 17844 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") 17845 urls += "?" + c.urlParams_.Encode() 17846 req, err := http.NewRequest("GET", urls, body) 17847 if err != nil { 17848 return nil, err 17849 } 17850 req.Header = reqHeaders 17851 googleapi.Expand(req.URL, map[string]string{ 17852 "name": c.name, 17853 }) 17854 return gensupport.SendRequest(c.ctx_, c.s.client, req) 17855 } 17856 17857 // Do executes the "retail.projects.operations.get" call. 17858 // Any non-2xx status code is an error. Response headers are in either 17859 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was 17860 // returned at all) in error.(*googleapi.Error).Header. Use 17861 // googleapi.IsNotModified to check whether the returned error was because 17862 // http.StatusNotModified was returned. 17863 func (c *ProjectsOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 17864 gensupport.SetOptions(c.urlParams_, opts...) 17865 res, err := c.doRequest("json") 17866 if res != nil && res.StatusCode == http.StatusNotModified { 17867 if res.Body != nil { 17868 res.Body.Close() 17869 } 17870 return nil, gensupport.WrapError(&googleapi.Error{ 17871 Code: res.StatusCode, 17872 Header: res.Header, 17873 }) 17874 } 17875 if err != nil { 17876 return nil, err 17877 } 17878 defer googleapi.CloseBody(res) 17879 if err := googleapi.CheckResponse(res); err != nil { 17880 return nil, gensupport.WrapError(err) 17881 } 17882 ret := &GoogleLongrunningOperation{ 17883 ServerResponse: googleapi.ServerResponse{ 17884 Header: res.Header, 17885 HTTPStatusCode: res.StatusCode, 17886 }, 17887 } 17888 target := &ret 17889 if err := gensupport.DecodeResponse(target, res); err != nil { 17890 return nil, err 17891 } 17892 return ret, nil 17893 } 17894 17895 type ProjectsOperationsListCall struct { 17896 s *Service 17897 name string 17898 urlParams_ gensupport.URLParams 17899 ifNoneMatch_ string 17900 ctx_ context.Context 17901 header_ http.Header 17902 } 17903 17904 // List: Lists operations that match the specified filter in the request. If 17905 // the server doesn't support this method, it returns `UNIMPLEMENTED`. 17906 // 17907 // - name: The name of the operation's parent resource. 17908 func (r *ProjectsOperationsService) List(name string) *ProjectsOperationsListCall { 17909 c := &ProjectsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 17910 c.name = name 17911 return c 17912 } 17913 17914 // Filter sets the optional parameter "filter": The standard list filter. 17915 func (c *ProjectsOperationsListCall) Filter(filter string) *ProjectsOperationsListCall { 17916 c.urlParams_.Set("filter", filter) 17917 return c 17918 } 17919 17920 // PageSize sets the optional parameter "pageSize": The standard list page 17921 // size. 17922 func (c *ProjectsOperationsListCall) PageSize(pageSize int64) *ProjectsOperationsListCall { 17923 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 17924 return c 17925 } 17926 17927 // PageToken sets the optional parameter "pageToken": The standard list page 17928 // token. 17929 func (c *ProjectsOperationsListCall) PageToken(pageToken string) *ProjectsOperationsListCall { 17930 c.urlParams_.Set("pageToken", pageToken) 17931 return c 17932 } 17933 17934 // Fields allows partial responses to be retrieved. See 17935 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 17936 // details. 17937 func (c *ProjectsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsOperationsListCall { 17938 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 17939 return c 17940 } 17941 17942 // IfNoneMatch sets an optional parameter which makes the operation fail if the 17943 // object's ETag matches the given value. This is useful for getting updates 17944 // only after the object has changed since the last request. 17945 func (c *ProjectsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsOperationsListCall { 17946 c.ifNoneMatch_ = entityTag 17947 return c 17948 } 17949 17950 // Context sets the context to be used in this call's Do method. 17951 func (c *ProjectsOperationsListCall) Context(ctx context.Context) *ProjectsOperationsListCall { 17952 c.ctx_ = ctx 17953 return c 17954 } 17955 17956 // Header returns a http.Header that can be modified by the caller to add 17957 // headers to the request. 17958 func (c *ProjectsOperationsListCall) Header() http.Header { 17959 if c.header_ == nil { 17960 c.header_ = make(http.Header) 17961 } 17962 return c.header_ 17963 } 17964 17965 func (c *ProjectsOperationsListCall) doRequest(alt string) (*http.Response, error) { 17966 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 17967 if c.ifNoneMatch_ != "" { 17968 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 17969 } 17970 var body io.Reader = nil 17971 c.urlParams_.Set("alt", alt) 17972 c.urlParams_.Set("prettyPrint", "false") 17973 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}/operations") 17974 urls += "?" + c.urlParams_.Encode() 17975 req, err := http.NewRequest("GET", urls, body) 17976 if err != nil { 17977 return nil, err 17978 } 17979 req.Header = reqHeaders 17980 googleapi.Expand(req.URL, map[string]string{ 17981 "name": c.name, 17982 }) 17983 return gensupport.SendRequest(c.ctx_, c.s.client, req) 17984 } 17985 17986 // Do executes the "retail.projects.operations.list" call. 17987 // Any non-2xx status code is an error. Response headers are in either 17988 // *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if a 17989 // response was returned at all) in error.(*googleapi.Error).Header. Use 17990 // googleapi.IsNotModified to check whether the returned error was because 17991 // http.StatusNotModified was returned. 17992 func (c *ProjectsOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { 17993 gensupport.SetOptions(c.urlParams_, opts...) 17994 res, err := c.doRequest("json") 17995 if res != nil && res.StatusCode == http.StatusNotModified { 17996 if res.Body != nil { 17997 res.Body.Close() 17998 } 17999 return nil, gensupport.WrapError(&googleapi.Error{ 18000 Code: res.StatusCode, 18001 Header: res.Header, 18002 }) 18003 } 18004 if err != nil { 18005 return nil, err 18006 } 18007 defer googleapi.CloseBody(res) 18008 if err := googleapi.CheckResponse(res); err != nil { 18009 return nil, gensupport.WrapError(err) 18010 } 18011 ret := &GoogleLongrunningListOperationsResponse{ 18012 ServerResponse: googleapi.ServerResponse{ 18013 Header: res.Header, 18014 HTTPStatusCode: res.StatusCode, 18015 }, 18016 } 18017 target := &ret 18018 if err := gensupport.DecodeResponse(target, res); err != nil { 18019 return nil, err 18020 } 18021 return ret, nil 18022 } 18023 18024 // Pages invokes f for each page of results. 18025 // A non-nil error returned from f will halt the iteration. 18026 // The provided context supersedes any context provided to the Context method. 18027 func (c *ProjectsOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { 18028 c.ctx_ = ctx 18029 defer c.PageToken(c.urlParams_.Get("pageToken")) 18030 for { 18031 x, err := c.Do() 18032 if err != nil { 18033 return err 18034 } 18035 if err := f(x); err != nil { 18036 return err 18037 } 18038 if x.NextPageToken == "" { 18039 return nil 18040 } 18041 c.PageToken(x.NextPageToken) 18042 } 18043 } 18044 18045 type ProjectsRetailProjectAcceptTermsCall struct { 18046 s *Service 18047 project string 18048 googlecloudretailv2alphaaccepttermsrequest *GoogleCloudRetailV2alphaAcceptTermsRequest 18049 urlParams_ gensupport.URLParams 18050 ctx_ context.Context 18051 header_ http.Header 18052 } 18053 18054 // AcceptTerms: Accepts service terms for this project. By making requests to 18055 // this API, you agree to the terms of service linked below. 18056 // https://cloud.google.com/retail/data-use-terms 18057 // 18058 // - project: Full resource name of the project. Format: 18059 // `projects/{project_number_or_id}/retailProject`. 18060 func (r *ProjectsRetailProjectService) AcceptTerms(project string, googlecloudretailv2alphaaccepttermsrequest *GoogleCloudRetailV2alphaAcceptTermsRequest) *ProjectsRetailProjectAcceptTermsCall { 18061 c := &ProjectsRetailProjectAcceptTermsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 18062 c.project = project 18063 c.googlecloudretailv2alphaaccepttermsrequest = googlecloudretailv2alphaaccepttermsrequest 18064 return c 18065 } 18066 18067 // Fields allows partial responses to be retrieved. See 18068 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 18069 // details. 18070 func (c *ProjectsRetailProjectAcceptTermsCall) Fields(s ...googleapi.Field) *ProjectsRetailProjectAcceptTermsCall { 18071 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 18072 return c 18073 } 18074 18075 // Context sets the context to be used in this call's Do method. 18076 func (c *ProjectsRetailProjectAcceptTermsCall) Context(ctx context.Context) *ProjectsRetailProjectAcceptTermsCall { 18077 c.ctx_ = ctx 18078 return c 18079 } 18080 18081 // Header returns a http.Header that can be modified by the caller to add 18082 // headers to the request. 18083 func (c *ProjectsRetailProjectAcceptTermsCall) Header() http.Header { 18084 if c.header_ == nil { 18085 c.header_ = make(http.Header) 18086 } 18087 return c.header_ 18088 } 18089 18090 func (c *ProjectsRetailProjectAcceptTermsCall) doRequest(alt string) (*http.Response, error) { 18091 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 18092 var body io.Reader = nil 18093 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphaaccepttermsrequest) 18094 if err != nil { 18095 return nil, err 18096 } 18097 c.urlParams_.Set("alt", alt) 18098 c.urlParams_.Set("prettyPrint", "false") 18099 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+project}:acceptTerms") 18100 urls += "?" + c.urlParams_.Encode() 18101 req, err := http.NewRequest("POST", urls, body) 18102 if err != nil { 18103 return nil, err 18104 } 18105 req.Header = reqHeaders 18106 googleapi.Expand(req.URL, map[string]string{ 18107 "project": c.project, 18108 }) 18109 return gensupport.SendRequest(c.ctx_, c.s.client, req) 18110 } 18111 18112 // Do executes the "retail.projects.retailProject.acceptTerms" call. 18113 // Any non-2xx status code is an error. Response headers are in either 18114 // *GoogleCloudRetailV2alphaProject.ServerResponse.Header or (if a response was 18115 // returned at all) in error.(*googleapi.Error).Header. Use 18116 // googleapi.IsNotModified to check whether the returned error was because 18117 // http.StatusNotModified was returned. 18118 func (c *ProjectsRetailProjectAcceptTermsCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2alphaProject, error) { 18119 gensupport.SetOptions(c.urlParams_, opts...) 18120 res, err := c.doRequest("json") 18121 if res != nil && res.StatusCode == http.StatusNotModified { 18122 if res.Body != nil { 18123 res.Body.Close() 18124 } 18125 return nil, gensupport.WrapError(&googleapi.Error{ 18126 Code: res.StatusCode, 18127 Header: res.Header, 18128 }) 18129 } 18130 if err != nil { 18131 return nil, err 18132 } 18133 defer googleapi.CloseBody(res) 18134 if err := googleapi.CheckResponse(res); err != nil { 18135 return nil, gensupport.WrapError(err) 18136 } 18137 ret := &GoogleCloudRetailV2alphaProject{ 18138 ServerResponse: googleapi.ServerResponse{ 18139 Header: res.Header, 18140 HTTPStatusCode: res.StatusCode, 18141 }, 18142 } 18143 target := &ret 18144 if err := gensupport.DecodeResponse(target, res); err != nil { 18145 return nil, err 18146 } 18147 return ret, nil 18148 } 18149