1// Copyright 2021 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 Retail API. 8// 9// For product documentation, see: https://cloud.google.com/recommendations 10// 11// Creating a client 12// 13// Usage example: 14// 15// import "google.golang.org/api/retail/v2alpha" 16// ... 17// ctx := context.Background() 18// retailService, err := retail.NewService(ctx) 19// 20// In this example, Google Application Default Credentials are used for authentication. 21// 22// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. 23// 24// Other authentication options 25// 26// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: 27// 28// retailService, err := retail.NewService(ctx, option.WithAPIKey("AIza...")) 29// 30// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: 31// 32// config := &oauth2.Config{...} 33// // ... 34// token, err := config.Exchange(ctx, ...) 35// retailService, err := retail.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 36// 37// See https://godoc.org/google.golang.org/api/option/ for details on options. 38package retail // import "google.golang.org/api/retail/v2alpha" 39 40import ( 41 "bytes" 42 "context" 43 "encoding/json" 44 "errors" 45 "fmt" 46 "io" 47 "net/http" 48 "net/url" 49 "strconv" 50 "strings" 51 52 googleapi "google.golang.org/api/googleapi" 53 gensupport "google.golang.org/api/internal/gensupport" 54 option "google.golang.org/api/option" 55 internaloption "google.golang.org/api/option/internaloption" 56 htransport "google.golang.org/api/transport/http" 57) 58 59// Always reference these packages, just in case the auto-generated code 60// below doesn't. 61var _ = bytes.NewBuffer 62var _ = strconv.Itoa 63var _ = fmt.Sprintf 64var _ = json.NewDecoder 65var _ = io.Copy 66var _ = url.Parse 67var _ = gensupport.MarshalJSON 68var _ = googleapi.Version 69var _ = errors.New 70var _ = strings.Replace 71var _ = context.Canceled 72var _ = internaloption.WithDefaultEndpoint 73 74const apiId = "retail:v2alpha" 75const apiName = "retail" 76const apiVersion = "v2alpha" 77const basePath = "https://retail.googleapis.com/" 78const mtlsBasePath = "https://retail.mtls.googleapis.com/" 79 80// OAuth2 scopes used by this API. 81const ( 82 // See, edit, configure, and delete your Google Cloud Platform data 83 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" 84) 85 86// NewService creates a new Service. 87func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 88 scopesOption := option.WithScopes( 89 "https://www.googleapis.com/auth/cloud-platform", 90 ) 91 // NOTE: prepend, so we don't override user-specified scopes. 92 opts = append([]option.ClientOption{scopesOption}, opts...) 93 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 94 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) 95 client, endpoint, err := htransport.NewClient(ctx, opts...) 96 if err != nil { 97 return nil, err 98 } 99 s, err := New(client) 100 if err != nil { 101 return nil, err 102 } 103 if endpoint != "" { 104 s.BasePath = endpoint 105 } 106 return s, nil 107} 108 109// New creates a new Service. It uses the provided http.Client for requests. 110// 111// Deprecated: please use NewService instead. 112// To provide a custom HTTP client, use option.WithHTTPClient. 113// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 114func New(client *http.Client) (*Service, error) { 115 if client == nil { 116 return nil, errors.New("client is nil") 117 } 118 s := &Service{client: client, BasePath: basePath} 119 s.Projects = NewProjectsService(s) 120 return s, nil 121} 122 123type Service struct { 124 client *http.Client 125 BasePath string // API endpoint base URL 126 UserAgent string // optional additional User-Agent fragment 127 128 Projects *ProjectsService 129} 130 131func (s *Service) userAgent() string { 132 if s.UserAgent == "" { 133 return googleapi.UserAgent 134 } 135 return googleapi.UserAgent + " " + s.UserAgent 136} 137 138func NewProjectsService(s *Service) *ProjectsService { 139 rs := &ProjectsService{s: s} 140 rs.Locations = NewProjectsLocationsService(s) 141 return rs 142} 143 144type ProjectsService struct { 145 s *Service 146 147 Locations *ProjectsLocationsService 148} 149 150func NewProjectsLocationsService(s *Service) *ProjectsLocationsService { 151 rs := &ProjectsLocationsService{s: s} 152 rs.Catalogs = NewProjectsLocationsCatalogsService(s) 153 rs.Operations = NewProjectsLocationsOperationsService(s) 154 return rs 155} 156 157type ProjectsLocationsService struct { 158 s *Service 159 160 Catalogs *ProjectsLocationsCatalogsService 161 162 Operations *ProjectsLocationsOperationsService 163} 164 165func NewProjectsLocationsCatalogsService(s *Service) *ProjectsLocationsCatalogsService { 166 rs := &ProjectsLocationsCatalogsService{s: s} 167 rs.Branches = NewProjectsLocationsCatalogsBranchesService(s) 168 rs.Operations = NewProjectsLocationsCatalogsOperationsService(s) 169 rs.Placements = NewProjectsLocationsCatalogsPlacementsService(s) 170 rs.UserEvents = NewProjectsLocationsCatalogsUserEventsService(s) 171 return rs 172} 173 174type ProjectsLocationsCatalogsService struct { 175 s *Service 176 177 Branches *ProjectsLocationsCatalogsBranchesService 178 179 Operations *ProjectsLocationsCatalogsOperationsService 180 181 Placements *ProjectsLocationsCatalogsPlacementsService 182 183 UserEvents *ProjectsLocationsCatalogsUserEventsService 184} 185 186func NewProjectsLocationsCatalogsBranchesService(s *Service) *ProjectsLocationsCatalogsBranchesService { 187 rs := &ProjectsLocationsCatalogsBranchesService{s: s} 188 rs.Operations = NewProjectsLocationsCatalogsBranchesOperationsService(s) 189 rs.Products = NewProjectsLocationsCatalogsBranchesProductsService(s) 190 return rs 191} 192 193type ProjectsLocationsCatalogsBranchesService struct { 194 s *Service 195 196 Operations *ProjectsLocationsCatalogsBranchesOperationsService 197 198 Products *ProjectsLocationsCatalogsBranchesProductsService 199} 200 201func NewProjectsLocationsCatalogsBranchesOperationsService(s *Service) *ProjectsLocationsCatalogsBranchesOperationsService { 202 rs := &ProjectsLocationsCatalogsBranchesOperationsService{s: s} 203 return rs 204} 205 206type ProjectsLocationsCatalogsBranchesOperationsService struct { 207 s *Service 208} 209 210func NewProjectsLocationsCatalogsBranchesProductsService(s *Service) *ProjectsLocationsCatalogsBranchesProductsService { 211 rs := &ProjectsLocationsCatalogsBranchesProductsService{s: s} 212 return rs 213} 214 215type ProjectsLocationsCatalogsBranchesProductsService struct { 216 s *Service 217} 218 219func NewProjectsLocationsCatalogsOperationsService(s *Service) *ProjectsLocationsCatalogsOperationsService { 220 rs := &ProjectsLocationsCatalogsOperationsService{s: s} 221 return rs 222} 223 224type ProjectsLocationsCatalogsOperationsService struct { 225 s *Service 226} 227 228func NewProjectsLocationsCatalogsPlacementsService(s *Service) *ProjectsLocationsCatalogsPlacementsService { 229 rs := &ProjectsLocationsCatalogsPlacementsService{s: s} 230 return rs 231} 232 233type ProjectsLocationsCatalogsPlacementsService struct { 234 s *Service 235} 236 237func NewProjectsLocationsCatalogsUserEventsService(s *Service) *ProjectsLocationsCatalogsUserEventsService { 238 rs := &ProjectsLocationsCatalogsUserEventsService{s: s} 239 return rs 240} 241 242type ProjectsLocationsCatalogsUserEventsService struct { 243 s *Service 244} 245 246func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService { 247 rs := &ProjectsLocationsOperationsService{s: s} 248 return rs 249} 250 251type ProjectsLocationsOperationsService struct { 252 s *Service 253} 254 255// GoogleApiHttpBody: Message that represents an arbitrary HTTP body. It 256// should only be used for payload formats that can't be represented as 257// JSON, such as raw binary or an HTML page. This message can be used 258// both in streaming and non-streaming API methods in the request as 259// well as the response. It can be used as a top-level request field, 260// which is convenient if one wants to extract parameters from either 261// the URL or HTTP template into the request fields and also want access 262// to the raw HTTP body. Example: message GetResourceRequest { // A 263// unique request id. string request_id = 1; // The raw HTTP body is 264// bound to this field. google.api.HttpBody http_body = 2; } service 265// ResourceService { rpc GetResource(GetResourceRequest) returns 266// (google.api.HttpBody); rpc UpdateResource(google.api.HttpBody) 267// returns (google.protobuf.Empty); } Example with streaming methods: 268// service CaldavService { rpc GetCalendar(stream google.api.HttpBody) 269// returns (stream google.api.HttpBody); rpc UpdateCalendar(stream 270// google.api.HttpBody) returns (stream google.api.HttpBody); } Use of 271// this type only changes how the request and response bodies are 272// handled, all other features will continue to work unchanged. 273type GoogleApiHttpBody struct { 274 // ContentType: The HTTP Content-Type header value specifying the 275 // content type of the body. 276 ContentType string `json:"contentType,omitempty"` 277 278 // Data: The HTTP request/response body as raw binary. 279 Data string `json:"data,omitempty"` 280 281 // Extensions: Application specific response metadata. Must be set in 282 // the first response for streaming APIs. 283 Extensions []googleapi.RawMessage `json:"extensions,omitempty"` 284 285 // ServerResponse contains the HTTP response code and headers from the 286 // server. 287 googleapi.ServerResponse `json:"-"` 288 289 // ForceSendFields is a list of field names (e.g. "ContentType") to 290 // unconditionally include in API requests. By default, fields with 291 // empty values are omitted from API requests. However, any non-pointer, 292 // non-interface field appearing in ForceSendFields will be sent to the 293 // server regardless of whether the field is empty or not. This may be 294 // used to include empty fields in Patch requests. 295 ForceSendFields []string `json:"-"` 296 297 // NullFields is a list of field names (e.g. "ContentType") to include 298 // in API requests with the JSON null value. By default, fields with 299 // empty values are omitted from API requests. However, any field with 300 // an empty value appearing in NullFields will be sent to the server as 301 // null. It is an error if a field in this list has a non-empty value. 302 // This may be used to include null fields in Patch requests. 303 NullFields []string `json:"-"` 304} 305 306func (s *GoogleApiHttpBody) MarshalJSON() ([]byte, error) { 307 type NoMethod GoogleApiHttpBody 308 raw := NoMethod(*s) 309 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 310} 311 312// GoogleCloudRetailLoggingErrorContext: A description of the context in 313// which an error occurred. 314type GoogleCloudRetailLoggingErrorContext struct { 315 // HttpRequest: The HTTP request which was processed when the error was 316 // triggered. 317 HttpRequest *GoogleCloudRetailLoggingHttpRequestContext `json:"httpRequest,omitempty"` 318 319 // ReportLocation: The location in the source code where the decision 320 // was made to report the error, usually the place where it was logged. 321 ReportLocation *GoogleCloudRetailLoggingSourceLocation `json:"reportLocation,omitempty"` 322 323 // ForceSendFields is a list of field names (e.g. "HttpRequest") to 324 // unconditionally include in API requests. By default, fields with 325 // empty values are omitted from API requests. However, any non-pointer, 326 // non-interface field appearing in ForceSendFields will be sent to the 327 // server regardless of whether the field is empty or not. This may be 328 // used to include empty fields in Patch requests. 329 ForceSendFields []string `json:"-"` 330 331 // NullFields is a list of field names (e.g. "HttpRequest") to include 332 // in API requests with the JSON null value. By default, fields with 333 // empty values are omitted from API requests. However, any field with 334 // an empty value appearing in NullFields will be sent to the server as 335 // null. It is an error if a field in this list has a non-empty value. 336 // This may be used to include null fields in Patch requests. 337 NullFields []string `json:"-"` 338} 339 340func (s *GoogleCloudRetailLoggingErrorContext) MarshalJSON() ([]byte, error) { 341 type NoMethod GoogleCloudRetailLoggingErrorContext 342 raw := NoMethod(*s) 343 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 344} 345 346// GoogleCloudRetailLoggingErrorLog: An error log which is reported to 347// the Error Reporting system. This proto a superset of 348// google.devtools.clouderrorreporting.v1beta1.ReportedErrorEvent. 349type GoogleCloudRetailLoggingErrorLog struct { 350 // Context: A description of the context in which the error occurred. 351 Context *GoogleCloudRetailLoggingErrorContext `json:"context,omitempty"` 352 353 // ImportPayload: The error payload that is populated on LRO import 354 // APIs. 355 ImportPayload *GoogleCloudRetailLoggingImportErrorContext `json:"importPayload,omitempty"` 356 357 // Message: A message describing the error. 358 Message string `json:"message,omitempty"` 359 360 // RequestPayload: The API request payload, represented as a protocol 361 // buffer. Most API request types are supported. For example: 362 // "type.googleapis.com/google.cloud.retail.v2.ProductService.CreateProdu 363 // ctRequest" 364 // "type.googleapis.com/google.cloud.retail.v2.UserEventService.WriteUser 365 // EventRequest" 366 RequestPayload googleapi.RawMessage `json:"requestPayload,omitempty"` 367 368 // ResponsePayload: The API response payload, represented as a protocol 369 // buffer. This is used to log some "soft errors", where the response is 370 // valid but we consider there are some quality issues like unjoined 371 // events. The following API responses are supported and no PII is 372 // included: "google.cloud.retail.v2.PredictionService.Predict" 373 // "google.cloud.retail.v2.UserEventService.WriteUserEvent" 374 // "google.cloud.retail.v2.UserEventService.CollectUserEvent" 375 ResponsePayload googleapi.RawMessage `json:"responsePayload,omitempty"` 376 377 // ServiceContext: The service context in which this error has occurred. 378 ServiceContext *GoogleCloudRetailLoggingServiceContext `json:"serviceContext,omitempty"` 379 380 // Status: The RPC status associated with the error log. 381 Status *GoogleRpcStatus `json:"status,omitempty"` 382 383 // ForceSendFields is a list of field names (e.g. "Context") to 384 // unconditionally include in API requests. By default, fields with 385 // empty values are omitted from API requests. However, any non-pointer, 386 // non-interface field appearing in ForceSendFields will be sent to the 387 // server regardless of whether the field is empty or not. This may be 388 // used to include empty fields in Patch requests. 389 ForceSendFields []string `json:"-"` 390 391 // NullFields is a list of field names (e.g. "Context") to include in 392 // API requests with the JSON null value. By default, fields with empty 393 // values are omitted from API requests. However, any field with an 394 // empty value appearing in NullFields will be sent to the server as 395 // null. It is an error if a field in this list has a non-empty value. 396 // This may be used to include null fields in Patch requests. 397 NullFields []string `json:"-"` 398} 399 400func (s *GoogleCloudRetailLoggingErrorLog) MarshalJSON() ([]byte, error) { 401 type NoMethod GoogleCloudRetailLoggingErrorLog 402 raw := NoMethod(*s) 403 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 404} 405 406// GoogleCloudRetailLoggingHttpRequestContext: HTTP request data that is 407// related to a reported error. 408type GoogleCloudRetailLoggingHttpRequestContext struct { 409 // ResponseStatusCode: The HTTP response status code for the request. 410 ResponseStatusCode int64 `json:"responseStatusCode,omitempty"` 411 412 // ForceSendFields is a list of field names (e.g. "ResponseStatusCode") 413 // to unconditionally include in API requests. By default, fields with 414 // empty values are omitted from API requests. However, any non-pointer, 415 // non-interface field appearing in ForceSendFields will be sent to the 416 // server regardless of whether the field is empty or not. This may be 417 // used to include empty fields in Patch requests. 418 ForceSendFields []string `json:"-"` 419 420 // NullFields is a list of field names (e.g. "ResponseStatusCode") to 421 // include in API requests with the JSON null value. By default, fields 422 // with empty values are omitted from API requests. However, any field 423 // with an empty value appearing in NullFields will be sent to the 424 // server as null. It is an error if a field in this list has a 425 // non-empty value. This may be used to include null fields in Patch 426 // requests. 427 NullFields []string `json:"-"` 428} 429 430func (s *GoogleCloudRetailLoggingHttpRequestContext) MarshalJSON() ([]byte, error) { 431 type NoMethod GoogleCloudRetailLoggingHttpRequestContext 432 raw := NoMethod(*s) 433 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 434} 435 436// GoogleCloudRetailLoggingImportErrorContext: The error payload that is 437// populated on LRO import APIs. Including: 438// "google.cloud.retail.v2.ProductService.ImportProducts" 439// "google.cloud.retail.v2.EventService.ImportUserEvents" 440type GoogleCloudRetailLoggingImportErrorContext struct { 441 // CatalogItem: The detailed content which caused the error on importing 442 // a catalog item. 443 CatalogItem string `json:"catalogItem,omitempty"` 444 445 // GcsPath: GCS file path of the import source. Can be set for batch 446 // operation error. 447 GcsPath string `json:"gcsPath,omitempty"` 448 449 // LineNumber: Line number of the content in file. Should be empty for 450 // permission or batch operation error. 451 LineNumber string `json:"lineNumber,omitempty"` 452 453 // OperationName: The operation resource name of the LRO. 454 OperationName string `json:"operationName,omitempty"` 455 456 // Product: The detailed content which caused the error on importing a 457 // product. 458 Product string `json:"product,omitempty"` 459 460 // UserEvent: The detailed content which caused the error on importing a 461 // user event. 462 UserEvent string `json:"userEvent,omitempty"` 463 464 // ForceSendFields is a list of field names (e.g. "CatalogItem") to 465 // unconditionally include in API requests. By default, fields with 466 // empty values are omitted from API requests. However, any non-pointer, 467 // non-interface field appearing in ForceSendFields will be sent to the 468 // server regardless of whether the field is empty or not. This may be 469 // used to include empty fields in Patch requests. 470 ForceSendFields []string `json:"-"` 471 472 // NullFields is a list of field names (e.g. "CatalogItem") to include 473 // in API requests with the JSON null value. By default, fields with 474 // empty values are omitted from API requests. However, any field with 475 // an empty value appearing in NullFields will be sent to the server as 476 // null. It is an error if a field in this list has a non-empty value. 477 // This may be used to include null fields in Patch requests. 478 NullFields []string `json:"-"` 479} 480 481func (s *GoogleCloudRetailLoggingImportErrorContext) MarshalJSON() ([]byte, error) { 482 type NoMethod GoogleCloudRetailLoggingImportErrorContext 483 raw := NoMethod(*s) 484 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 485} 486 487// GoogleCloudRetailLoggingServiceContext: Describes a running service 488// that sends errors. 489type GoogleCloudRetailLoggingServiceContext struct { 490 // Service: An identifier of the service. For example, 491 // "retail.googleapis.com". 492 Service string `json:"service,omitempty"` 493 494 // ForceSendFields is a list of field names (e.g. "Service") to 495 // unconditionally include in API requests. By default, fields with 496 // empty values are omitted from API requests. However, any non-pointer, 497 // non-interface field appearing in ForceSendFields will be sent to the 498 // server regardless of whether the field is empty or not. This may be 499 // used to include empty fields in Patch requests. 500 ForceSendFields []string `json:"-"` 501 502 // NullFields is a list of field names (e.g. "Service") to include in 503 // API requests with the JSON null value. By default, fields with empty 504 // values are omitted from API requests. However, any field with an 505 // empty value appearing in NullFields will be sent to the server as 506 // null. It is an error if a field in this list has a non-empty value. 507 // This may be used to include null fields in Patch requests. 508 NullFields []string `json:"-"` 509} 510 511func (s *GoogleCloudRetailLoggingServiceContext) MarshalJSON() ([]byte, error) { 512 type NoMethod GoogleCloudRetailLoggingServiceContext 513 raw := NoMethod(*s) 514 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 515} 516 517// GoogleCloudRetailLoggingSourceLocation: Indicates a location in the 518// source code of the service for which errors are reported. 519type GoogleCloudRetailLoggingSourceLocation struct { 520 // FunctionName: Human-readable name of a function or method. For 521 // example, "google.cloud.retail.v2.UserEventService.ImportUserEvents". 522 FunctionName string `json:"functionName,omitempty"` 523 524 // ForceSendFields is a list of field names (e.g. "FunctionName") to 525 // unconditionally include in API requests. By default, fields with 526 // empty values are omitted from API requests. However, any non-pointer, 527 // non-interface field appearing in ForceSendFields will be sent to the 528 // server regardless of whether the field is empty or not. This may be 529 // used to include empty fields in Patch requests. 530 ForceSendFields []string `json:"-"` 531 532 // NullFields is a list of field names (e.g. "FunctionName") to include 533 // in API requests with the JSON null value. By default, fields with 534 // empty values are omitted from API requests. However, any field with 535 // an empty value appearing in NullFields will be sent to the server as 536 // null. It is an error if a field in this list has a non-empty value. 537 // This may be used to include null fields in Patch requests. 538 NullFields []string `json:"-"` 539} 540 541func (s *GoogleCloudRetailLoggingSourceLocation) MarshalJSON() ([]byte, error) { 542 type NoMethod GoogleCloudRetailLoggingSourceLocation 543 raw := NoMethod(*s) 544 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 545} 546 547// GoogleCloudRetailV2ImportErrorsConfig: Configuration of destination 548// for Import related errors. 549type GoogleCloudRetailV2ImportErrorsConfig struct { 550 // GcsPrefix: Google Cloud Storage path for import errors. This must be 551 // an empty, existing Cloud Storage bucket. Import errors will be 552 // written to a file in this bucket, one per line, as a JSON-encoded 553 // `google.rpc.Status` message. 554 GcsPrefix string `json:"gcsPrefix,omitempty"` 555 556 // ForceSendFields is a list of field names (e.g. "GcsPrefix") to 557 // unconditionally include in API requests. By default, fields with 558 // empty values are omitted from API requests. However, any non-pointer, 559 // non-interface field appearing in ForceSendFields will be sent to the 560 // server regardless of whether the field is empty or not. This may be 561 // used to include empty fields in Patch requests. 562 ForceSendFields []string `json:"-"` 563 564 // NullFields is a list of field names (e.g. "GcsPrefix") to include in 565 // API requests with the JSON null value. By default, fields with empty 566 // values are omitted from API requests. However, any field with an 567 // empty value appearing in NullFields will be sent to the server as 568 // null. It is an error if a field in this list has a non-empty value. 569 // This may be used to include null fields in Patch requests. 570 NullFields []string `json:"-"` 571} 572 573func (s *GoogleCloudRetailV2ImportErrorsConfig) MarshalJSON() ([]byte, error) { 574 type NoMethod GoogleCloudRetailV2ImportErrorsConfig 575 raw := NoMethod(*s) 576 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 577} 578 579// GoogleCloudRetailV2ImportMetadata: Metadata related to the progress 580// of the Import operation. This will be returned by the 581// google.longrunning.Operation.metadata field. 582type GoogleCloudRetailV2ImportMetadata struct { 583 // CreateTime: Operation create time. 584 CreateTime string `json:"createTime,omitempty"` 585 586 // FailureCount: Count of entries that encountered errors while 587 // processing. 588 FailureCount int64 `json:"failureCount,omitempty,string"` 589 590 // SuccessCount: Count of entries that were processed successfully. 591 SuccessCount int64 `json:"successCount,omitempty,string"` 592 593 // UpdateTime: Operation last update time. If the operation is done, 594 // this is also the finish time. 595 UpdateTime string `json:"updateTime,omitempty"` 596 597 // ForceSendFields is a list of field names (e.g. "CreateTime") to 598 // unconditionally include in API requests. By default, fields with 599 // empty values are omitted from API requests. However, any non-pointer, 600 // non-interface field appearing in ForceSendFields will be sent to the 601 // server regardless of whether the field is empty or not. This may be 602 // used to include empty fields in Patch requests. 603 ForceSendFields []string `json:"-"` 604 605 // NullFields is a list of field names (e.g. "CreateTime") to include in 606 // API requests with the JSON null value. By default, fields with empty 607 // values are omitted from API requests. However, any field with an 608 // empty value appearing in NullFields will be sent to the server as 609 // null. It is an error if a field in this list has a non-empty value. 610 // This may be used to include null fields in Patch requests. 611 NullFields []string `json:"-"` 612} 613 614func (s *GoogleCloudRetailV2ImportMetadata) MarshalJSON() ([]byte, error) { 615 type NoMethod GoogleCloudRetailV2ImportMetadata 616 raw := NoMethod(*s) 617 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 618} 619 620// GoogleCloudRetailV2ImportProductsResponse: Response of the 621// ImportProductsRequest. If the long running operation is done, then 622// this message is returned by the 623// google.longrunning.Operations.response field if the operation was 624// successful. 625type GoogleCloudRetailV2ImportProductsResponse struct { 626 // ErrorSamples: A sample of errors encountered while processing the 627 // request. 628 ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` 629 630 // ErrorsConfig: Echoes the destination for the complete errors in the 631 // request if set. 632 ErrorsConfig *GoogleCloudRetailV2ImportErrorsConfig `json:"errorsConfig,omitempty"` 633 634 // ForceSendFields is a list of field names (e.g. "ErrorSamples") to 635 // unconditionally include in API requests. By default, fields with 636 // empty values are omitted from API requests. However, any non-pointer, 637 // non-interface field appearing in ForceSendFields will be sent to the 638 // server regardless of whether the field is empty or not. This may be 639 // used to include empty fields in Patch requests. 640 ForceSendFields []string `json:"-"` 641 642 // NullFields is a list of field names (e.g. "ErrorSamples") to include 643 // in API requests with the JSON null value. By default, fields with 644 // empty values are omitted from API requests. However, any field with 645 // an empty value appearing in NullFields will be sent to the server as 646 // null. It is an error if a field in this list has a non-empty value. 647 // This may be used to include null fields in Patch requests. 648 NullFields []string `json:"-"` 649} 650 651func (s *GoogleCloudRetailV2ImportProductsResponse) MarshalJSON() ([]byte, error) { 652 type NoMethod GoogleCloudRetailV2ImportProductsResponse 653 raw := NoMethod(*s) 654 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 655} 656 657// GoogleCloudRetailV2ImportUserEventsResponse: Response of the 658// ImportUserEventsRequest. If the long running operation was 659// successful, then this message is returned by the 660// google.longrunning.Operations.response field if the operation was 661// successful. 662type GoogleCloudRetailV2ImportUserEventsResponse struct { 663 // ErrorSamples: A sample of errors encountered while processing the 664 // request. 665 ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` 666 667 // ErrorsConfig: Echoes the destination for the complete errors if this 668 // field was set in the request. 669 ErrorsConfig *GoogleCloudRetailV2ImportErrorsConfig `json:"errorsConfig,omitempty"` 670 671 // ImportSummary: Aggregated statistics of user event import status. 672 ImportSummary *GoogleCloudRetailV2UserEventImportSummary `json:"importSummary,omitempty"` 673 674 // ForceSendFields is a list of field names (e.g. "ErrorSamples") to 675 // unconditionally include in API requests. By default, fields with 676 // empty values are omitted from API requests. However, any non-pointer, 677 // non-interface field appearing in ForceSendFields will be sent to the 678 // server regardless of whether the field is empty or not. This may be 679 // used to include empty fields in Patch requests. 680 ForceSendFields []string `json:"-"` 681 682 // NullFields is a list of field names (e.g. "ErrorSamples") to include 683 // in API requests with the JSON null value. By default, fields with 684 // empty values are omitted from API requests. However, any field with 685 // an empty value appearing in NullFields will be sent to the server as 686 // null. It is an error if a field in this list has a non-empty value. 687 // This may be used to include null fields in Patch requests. 688 NullFields []string `json:"-"` 689} 690 691func (s *GoogleCloudRetailV2ImportUserEventsResponse) MarshalJSON() ([]byte, error) { 692 type NoMethod GoogleCloudRetailV2ImportUserEventsResponse 693 raw := NoMethod(*s) 694 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 695} 696 697// GoogleCloudRetailV2PurgeMetadata: Metadata related to the progress of 698// the Purge operation. This will be returned by the 699// google.longrunning.Operation.metadata field. 700type GoogleCloudRetailV2PurgeMetadata struct { 701} 702 703// GoogleCloudRetailV2PurgeUserEventsResponse: Response of the 704// PurgeUserEventsRequest. If the long running operation is successfully 705// done, then this message is returned by the 706// google.longrunning.Operations.response field. 707type GoogleCloudRetailV2PurgeUserEventsResponse struct { 708 // PurgedEventsCount: The total count of events purged as a result of 709 // the operation. 710 PurgedEventsCount int64 `json:"purgedEventsCount,omitempty,string"` 711 712 // ForceSendFields is a list of field names (e.g. "PurgedEventsCount") 713 // to unconditionally include in API requests. By default, fields with 714 // empty values are omitted from API requests. However, any non-pointer, 715 // non-interface field appearing in ForceSendFields will be sent to the 716 // server regardless of whether the field is empty or not. This may be 717 // used to include empty fields in Patch requests. 718 ForceSendFields []string `json:"-"` 719 720 // NullFields is a list of field names (e.g. "PurgedEventsCount") to 721 // include in API requests with the JSON null value. By default, fields 722 // with empty values are omitted from API requests. However, any field 723 // with an empty value appearing in NullFields will be sent to the 724 // server as null. It is an error if a field in this list has a 725 // non-empty value. This may be used to include null fields in Patch 726 // requests. 727 NullFields []string `json:"-"` 728} 729 730func (s *GoogleCloudRetailV2PurgeUserEventsResponse) MarshalJSON() ([]byte, error) { 731 type NoMethod GoogleCloudRetailV2PurgeUserEventsResponse 732 raw := NoMethod(*s) 733 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 734} 735 736// GoogleCloudRetailV2RejoinUserEventsMetadata: Metadata for 737// RejoinUserEvents method. 738type GoogleCloudRetailV2RejoinUserEventsMetadata struct { 739} 740 741// GoogleCloudRetailV2RejoinUserEventsResponse: Response message for 742// RejoinUserEvents method. 743type GoogleCloudRetailV2RejoinUserEventsResponse struct { 744 // RejoinedUserEventsCount: Number of user events that were joined with 745 // latest product catalog. 746 RejoinedUserEventsCount int64 `json:"rejoinedUserEventsCount,omitempty,string"` 747 748 // ForceSendFields is a list of field names (e.g. 749 // "RejoinedUserEventsCount") to unconditionally include in API 750 // requests. By default, fields with empty values are omitted from API 751 // requests. However, any non-pointer, non-interface field appearing in 752 // ForceSendFields will be sent to the server regardless of whether the 753 // field is empty or not. This may be used to include empty fields in 754 // Patch requests. 755 ForceSendFields []string `json:"-"` 756 757 // NullFields is a list of field names (e.g. "RejoinedUserEventsCount") 758 // to include in API requests with the JSON null value. By default, 759 // fields with empty values are omitted from API requests. However, any 760 // field with an empty value appearing in NullFields will be sent to the 761 // server as null. It is an error if a field in this list has a 762 // non-empty value. This may be used to include null fields in Patch 763 // requests. 764 NullFields []string `json:"-"` 765} 766 767func (s *GoogleCloudRetailV2RejoinUserEventsResponse) MarshalJSON() ([]byte, error) { 768 type NoMethod GoogleCloudRetailV2RejoinUserEventsResponse 769 raw := NoMethod(*s) 770 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 771} 772 773// GoogleCloudRetailV2UserEventImportSummary: A summary of import 774// result. The UserEventImportSummary summarizes the import status for 775// user events. 776type GoogleCloudRetailV2UserEventImportSummary struct { 777 // JoinedEventsCount: Count of user events imported with complete 778 // existing catalog information. 779 JoinedEventsCount int64 `json:"joinedEventsCount,omitempty,string"` 780 781 // UnjoinedEventsCount: Count of user events imported, but with catalog 782 // information not found in the imported catalog. 783 UnjoinedEventsCount int64 `json:"unjoinedEventsCount,omitempty,string"` 784 785 // ForceSendFields is a list of field names (e.g. "JoinedEventsCount") 786 // to unconditionally include in API requests. By default, fields with 787 // empty values are omitted from API requests. However, any non-pointer, 788 // non-interface field appearing in ForceSendFields will be sent to the 789 // server regardless of whether the field is empty or not. This may be 790 // used to include empty fields in Patch requests. 791 ForceSendFields []string `json:"-"` 792 793 // NullFields is a list of field names (e.g. "JoinedEventsCount") to 794 // include in API requests with the JSON null value. By default, fields 795 // with empty values are omitted from API requests. However, any field 796 // with an empty value appearing in NullFields will be sent to the 797 // server as null. It is an error if a field in this list has a 798 // non-empty value. This may be used to include null fields in Patch 799 // requests. 800 NullFields []string `json:"-"` 801} 802 803func (s *GoogleCloudRetailV2UserEventImportSummary) MarshalJSON() ([]byte, error) { 804 type NoMethod GoogleCloudRetailV2UserEventImportSummary 805 raw := NoMethod(*s) 806 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 807} 808 809// GoogleCloudRetailV2alphaBigQuerySource: BigQuery source import data 810// from. 811type GoogleCloudRetailV2alphaBigQuerySource struct { 812 // DataSchema: The schema to use when parsing the data from the source. 813 // Supported values for product imports: * `product` (default): One JSON 814 // Product per line. Each product must have a valid Product.id. * 815 // `product_merchant_center`: See Importing catalog data from Merchant 816 // Center 817 // (https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mc). 818 // Supported values for user events imports: * `user_event` (default): 819 // One JSON UserEvent per line. * `user_event_ga360`: Using 820 // https://support.google.com/analytics/answer/3437719?hl=en. 821 DataSchema string `json:"dataSchema,omitempty"` 822 823 // DatasetId: Required. The BigQuery data set to copy the data from with 824 // a length limit of 1,024 characters. 825 DatasetId string `json:"datasetId,omitempty"` 826 827 // GcsStagingDir: Intermediate Cloud Storage directory used for the 828 // import with a length limit of 2,000 characters. Can be specified if 829 // one wants to have the BigQuery export to a specific Cloud Storage 830 // directory. 831 GcsStagingDir string `json:"gcsStagingDir,omitempty"` 832 833 // ProjectId: The project id (can be project # or id) that the BigQuery 834 // source is in with a length limit of 128 characters. If not specified, 835 // inherits the project id from the parent request. 836 ProjectId string `json:"projectId,omitempty"` 837 838 // TableId: Required. The BigQuery table to copy the data from with a 839 // length limit of 1,024 characters. 840 TableId string `json:"tableId,omitempty"` 841 842 // ForceSendFields is a list of field names (e.g. "DataSchema") to 843 // unconditionally include in API requests. By default, fields with 844 // empty values are omitted from API requests. However, any non-pointer, 845 // non-interface field appearing in ForceSendFields will be sent to the 846 // server regardless of whether the field is empty or not. This may be 847 // used to include empty fields in Patch requests. 848 ForceSendFields []string `json:"-"` 849 850 // NullFields is a list of field names (e.g. "DataSchema") to include in 851 // API requests with the JSON null value. By default, fields with empty 852 // values are omitted from API requests. However, any field with an 853 // empty value appearing in NullFields will be sent to the server as 854 // null. It is an error if a field in this list has a non-empty value. 855 // This may be used to include null fields in Patch requests. 856 NullFields []string `json:"-"` 857} 858 859func (s *GoogleCloudRetailV2alphaBigQuerySource) MarshalJSON() ([]byte, error) { 860 type NoMethod GoogleCloudRetailV2alphaBigQuerySource 861 raw := NoMethod(*s) 862 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 863} 864 865// GoogleCloudRetailV2alphaCatalog: The catalog configuration. 866type GoogleCloudRetailV2alphaCatalog struct { 867 // DisplayName: Required. Immutable. The catalog display name. This 868 // field must be a UTF-8 encoded string with a length limit of 128 869 // characters. Otherwise, an INVALID_ARGUMENT error is returned. 870 DisplayName string `json:"displayName,omitempty"` 871 872 // Name: Required. Immutable. The fully qualified resource name of the 873 // catalog. 874 Name string `json:"name,omitempty"` 875 876 // ProductLevelConfig: Required. The product level configuration. 877 ProductLevelConfig *GoogleCloudRetailV2alphaProductLevelConfig `json:"productLevelConfig,omitempty"` 878 879 // ServerResponse contains the HTTP response code and headers from the 880 // server. 881 googleapi.ServerResponse `json:"-"` 882 883 // ForceSendFields is a list of field names (e.g. "DisplayName") to 884 // unconditionally include in API requests. By default, fields with 885 // empty values are omitted from API requests. However, any non-pointer, 886 // non-interface field appearing in ForceSendFields will be sent to the 887 // server regardless of whether the field is empty or not. This may be 888 // used to include empty fields in Patch requests. 889 ForceSendFields []string `json:"-"` 890 891 // NullFields is a list of field names (e.g. "DisplayName") to include 892 // in API requests with the JSON null value. By default, fields with 893 // empty values are omitted from API requests. However, any field with 894 // an empty value appearing in NullFields will be sent to the server as 895 // null. It is an error if a field in this list has a non-empty value. 896 // This may be used to include null fields in Patch requests. 897 NullFields []string `json:"-"` 898} 899 900func (s *GoogleCloudRetailV2alphaCatalog) MarshalJSON() ([]byte, error) { 901 type NoMethod GoogleCloudRetailV2alphaCatalog 902 raw := NoMethod(*s) 903 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 904} 905 906// GoogleCloudRetailV2alphaCustomAttribute: A custom attribute that is 907// not explicitly modeled in Product. 908type GoogleCloudRetailV2alphaCustomAttribute struct { 909 // Numbers: The numerical values of this custom attribute. For example, 910 // `[2.3, 15.4]` when the key is "lengths_cm". At most 400 values are 911 // allowed.Otherwise, an INVALID_ARGUMENT error is returned. Exactly one 912 // of text or numbers should be set. Otherwise, an INVALID_ARGUMENT 913 // error is returned. 914 Numbers []float64 `json:"numbers,omitempty"` 915 916 // Text: The textual values of this custom attribute. For example, 917 // `["yellow", "green"]` when the key is "color". At most 400 values are 918 // allowed. Empty values are not allowed. Each value must be a UTF-8 919 // encoded string with a length limit of 256 characters. Otherwise, an 920 // INVALID_ARGUMENT error is returned. Exactly one of text or numbers 921 // should be set. Otherwise, an INVALID_ARGUMENT error is returned. 922 Text []string `json:"text,omitempty"` 923 924 // ForceSendFields is a list of field names (e.g. "Numbers") to 925 // unconditionally include in API requests. By default, fields with 926 // empty values are omitted from API requests. However, any non-pointer, 927 // non-interface field appearing in ForceSendFields will be sent to the 928 // server regardless of whether the field is empty or not. This may be 929 // used to include empty fields in Patch requests. 930 ForceSendFields []string `json:"-"` 931 932 // NullFields is a list of field names (e.g. "Numbers") to include in 933 // API requests with the JSON null value. By default, fields with empty 934 // values are omitted from API requests. However, any field with an 935 // empty value appearing in NullFields will be sent to the server as 936 // null. It is an error if a field in this list has a non-empty value. 937 // This may be used to include null fields in Patch requests. 938 NullFields []string `json:"-"` 939} 940 941func (s *GoogleCloudRetailV2alphaCustomAttribute) MarshalJSON() ([]byte, error) { 942 type NoMethod GoogleCloudRetailV2alphaCustomAttribute 943 raw := NoMethod(*s) 944 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 945} 946 947// GoogleCloudRetailV2alphaExportErrorsConfig: Configuration of 948// destination for Export related errors. 949type GoogleCloudRetailV2alphaExportErrorsConfig struct { 950 // GcsPrefix: Google Cloud Storage path for import errors. This must be 951 // an empty, existing Cloud Storage bucket. Export errors will be 952 // written to a file in this bucket, one per line, as a JSON-encoded 953 // `google.rpc.Status` message. 954 GcsPrefix string `json:"gcsPrefix,omitempty"` 955 956 // ForceSendFields is a list of field names (e.g. "GcsPrefix") to 957 // unconditionally include in API requests. By default, fields with 958 // empty values are omitted from API requests. However, any non-pointer, 959 // non-interface field appearing in ForceSendFields will be sent to the 960 // server regardless of whether the field is empty or not. This may be 961 // used to include empty fields in Patch requests. 962 ForceSendFields []string `json:"-"` 963 964 // NullFields is a list of field names (e.g. "GcsPrefix") to include in 965 // API requests with the JSON null value. By default, fields with empty 966 // values are omitted from API requests. However, any field with an 967 // empty value appearing in NullFields will be sent to the server as 968 // null. It is an error if a field in this list has a non-empty value. 969 // This may be used to include null fields in Patch requests. 970 NullFields []string `json:"-"` 971} 972 973func (s *GoogleCloudRetailV2alphaExportErrorsConfig) MarshalJSON() ([]byte, error) { 974 type NoMethod GoogleCloudRetailV2alphaExportErrorsConfig 975 raw := NoMethod(*s) 976 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 977} 978 979// GoogleCloudRetailV2alphaExportMetadata: Metadata related to the 980// progress of the Export operation. This will be returned by the 981// google.longrunning.Operation.metadata field. 982type GoogleCloudRetailV2alphaExportMetadata struct { 983 // CreateTime: Operation create time. 984 CreateTime string `json:"createTime,omitempty"` 985 986 // UpdateTime: Operation last update time. If the operation is done, 987 // this is also the finish time. 988 UpdateTime string `json:"updateTime,omitempty"` 989 990 // ForceSendFields is a list of field names (e.g. "CreateTime") to 991 // unconditionally include in API requests. By default, fields with 992 // empty values are omitted from API requests. However, any non-pointer, 993 // non-interface field appearing in ForceSendFields will be sent to the 994 // server regardless of whether the field is empty or not. This may be 995 // used to include empty fields in Patch requests. 996 ForceSendFields []string `json:"-"` 997 998 // NullFields is a list of field names (e.g. "CreateTime") to include in 999 // API requests with the JSON null value. By default, fields with empty 1000 // values are omitted from API requests. However, any field with an 1001 // empty value appearing in NullFields will be sent to the server as 1002 // null. It is an error if a field in this list has a non-empty value. 1003 // This may be used to include null fields in Patch requests. 1004 NullFields []string `json:"-"` 1005} 1006 1007func (s *GoogleCloudRetailV2alphaExportMetadata) MarshalJSON() ([]byte, error) { 1008 type NoMethod GoogleCloudRetailV2alphaExportMetadata 1009 raw := NoMethod(*s) 1010 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1011} 1012 1013// GoogleCloudRetailV2alphaExportProductsResponse: Response of the 1014// ExportProductsRequest. If the long running operation is done, then 1015// this message is returned by the 1016// google.longrunning.Operations.response field if the operation was 1017// successful. 1018type GoogleCloudRetailV2alphaExportProductsResponse struct { 1019 // ErrorSamples: A sample of errors encountered while processing the 1020 // request. 1021 ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` 1022 1023 // ErrorsConfig: Echoes the destination for the complete errors in the 1024 // request if set. 1025 ErrorsConfig *GoogleCloudRetailV2alphaExportErrorsConfig `json:"errorsConfig,omitempty"` 1026 1027 // ForceSendFields is a list of field names (e.g. "ErrorSamples") to 1028 // unconditionally include in API requests. By default, fields with 1029 // empty values are omitted from API requests. However, any non-pointer, 1030 // non-interface field appearing in ForceSendFields will be sent to the 1031 // server regardless of whether the field is empty or not. This may be 1032 // used to include empty fields in Patch requests. 1033 ForceSendFields []string `json:"-"` 1034 1035 // NullFields is a list of field names (e.g. "ErrorSamples") to include 1036 // in API requests with the JSON null value. By default, fields with 1037 // empty values are omitted from API requests. However, any field with 1038 // an empty value appearing in NullFields will be sent to the server as 1039 // null. It is an error if a field in this list has a non-empty value. 1040 // This may be used to include null fields in Patch requests. 1041 NullFields []string `json:"-"` 1042} 1043 1044func (s *GoogleCloudRetailV2alphaExportProductsResponse) MarshalJSON() ([]byte, error) { 1045 type NoMethod GoogleCloudRetailV2alphaExportProductsResponse 1046 raw := NoMethod(*s) 1047 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1048} 1049 1050// GoogleCloudRetailV2alphaExportUserEventsResponse: Response of the 1051// ExportUserEventsRequest. If the long running operation was 1052// successful, then this message is returned by the 1053// google.longrunning.Operations.response field if the operation was 1054// successful. 1055type GoogleCloudRetailV2alphaExportUserEventsResponse struct { 1056 // ErrorSamples: A sample of errors encountered while processing the 1057 // request. 1058 ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` 1059 1060 // ErrorsConfig: Echoes the destination for the complete errors if this 1061 // field was set in the request. 1062 ErrorsConfig *GoogleCloudRetailV2alphaExportErrorsConfig `json:"errorsConfig,omitempty"` 1063 1064 // ForceSendFields is a list of field names (e.g. "ErrorSamples") to 1065 // unconditionally include in API requests. By default, fields with 1066 // empty values are omitted from API requests. However, any non-pointer, 1067 // non-interface field appearing in ForceSendFields will be sent to the 1068 // server regardless of whether the field is empty or not. This may be 1069 // used to include empty fields in Patch requests. 1070 ForceSendFields []string `json:"-"` 1071 1072 // NullFields is a list of field names (e.g. "ErrorSamples") to include 1073 // in API requests with the JSON null value. By default, fields with 1074 // empty values are omitted from API requests. However, any field with 1075 // an empty value appearing in NullFields will be sent to the server as 1076 // null. It is an error if a field in this list has a non-empty value. 1077 // This may be used to include null fields in Patch requests. 1078 NullFields []string `json:"-"` 1079} 1080 1081func (s *GoogleCloudRetailV2alphaExportUserEventsResponse) MarshalJSON() ([]byte, error) { 1082 type NoMethod GoogleCloudRetailV2alphaExportUserEventsResponse 1083 raw := NoMethod(*s) 1084 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1085} 1086 1087// GoogleCloudRetailV2alphaGcsSource: Google Cloud Storage location for 1088// input content. format. 1089type GoogleCloudRetailV2alphaGcsSource struct { 1090 // DataSchema: The schema to use when parsing the data from the source. 1091 // Supported values for product imports: * `product` (default): One JSON 1092 // Product per line. Each product must have a valid Product.id. * 1093 // `product_merchant_center`: See Importing catalog data from Merchant 1094 // Center 1095 // (https://cloud.google.com/retail/recommendations-ai/docs/upload-catalog#mcc). 1096 // Supported values for user events imports: * `user_event` (default): 1097 // One JSON UserEvent per line. * `user_event_ga360`: Using 1098 // https://support.google.com/analytics/answer/3437719?hl=en. 1099 DataSchema string `json:"dataSchema,omitempty"` 1100 1101 // InputUris: Required. Google Cloud Storage URIs to input files. URI 1102 // can be up to 2000 characters long. URIs can match the full object 1103 // path (for example, `gs://bucket/directory/object.json`) or a pattern 1104 // matching one or more files, such as `gs://bucket/directory/*.json`. A 1105 // request can contain at most 100 files, and each file can be up to 2 1106 // GB. See Importing product information 1107 // (https://cloud.google.com/recommendations-ai/docs/upload-catalog) for 1108 // the expected file format and setup instructions. 1109 InputUris []string `json:"inputUris,omitempty"` 1110 1111 // ForceSendFields is a list of field names (e.g. "DataSchema") to 1112 // unconditionally include in API requests. By default, fields with 1113 // empty values are omitted from API requests. However, any non-pointer, 1114 // non-interface field appearing in ForceSendFields will be sent to the 1115 // server regardless of whether the field is empty or not. This may be 1116 // used to include empty fields in Patch requests. 1117 ForceSendFields []string `json:"-"` 1118 1119 // NullFields is a list of field names (e.g. "DataSchema") to include in 1120 // API requests with the JSON null value. By default, fields with empty 1121 // values are omitted from API requests. However, any field with an 1122 // empty value appearing in NullFields will be sent to the server as 1123 // null. It is an error if a field in this list has a non-empty value. 1124 // This may be used to include null fields in Patch requests. 1125 NullFields []string `json:"-"` 1126} 1127 1128func (s *GoogleCloudRetailV2alphaGcsSource) MarshalJSON() ([]byte, error) { 1129 type NoMethod GoogleCloudRetailV2alphaGcsSource 1130 raw := NoMethod(*s) 1131 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1132} 1133 1134// GoogleCloudRetailV2alphaImage: Product thumbnail/detail image. 1135type GoogleCloudRetailV2alphaImage struct { 1136 // Height: Height of the image in number of pixels. This field must be 1137 // nonnegative. Otherwise, an INVALID_ARGUMENT error is returned. 1138 Height int64 `json:"height,omitempty"` 1139 1140 // Uri: Required. URI of the image. This field must be a valid UTF-8 1141 // encoded URI with a length limit of 5,000 characters. Otherwise, an 1142 // INVALID_ARGUMENT error is returned. Google Merchant Center property 1143 // image_link (https://support.google.com/merchants/answer/6324350). 1144 // Schema.org property Product.image (https://schema.org/image). 1145 Uri string `json:"uri,omitempty"` 1146 1147 // Width: Width of the image in number of pixels. This field must be 1148 // nonnegative. Otherwise, an INVALID_ARGUMENT error is returned. 1149 Width int64 `json:"width,omitempty"` 1150 1151 // ForceSendFields is a list of field names (e.g. "Height") to 1152 // unconditionally include in API requests. By default, fields with 1153 // empty values are omitted from API requests. However, any non-pointer, 1154 // non-interface field appearing in ForceSendFields will be sent to the 1155 // server regardless of whether the field is empty or not. This may be 1156 // used to include empty fields in Patch requests. 1157 ForceSendFields []string `json:"-"` 1158 1159 // NullFields is a list of field names (e.g. "Height") to include in API 1160 // requests with the JSON null value. By default, fields with empty 1161 // values are omitted from API requests. However, any field with an 1162 // empty value appearing in NullFields will be sent to the server as 1163 // null. It is an error if a field in this list has a non-empty value. 1164 // This may be used to include null fields in Patch requests. 1165 NullFields []string `json:"-"` 1166} 1167 1168func (s *GoogleCloudRetailV2alphaImage) MarshalJSON() ([]byte, error) { 1169 type NoMethod GoogleCloudRetailV2alphaImage 1170 raw := NoMethod(*s) 1171 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1172} 1173 1174// GoogleCloudRetailV2alphaImportErrorsConfig: Configuration of 1175// destination for Import related errors. 1176type GoogleCloudRetailV2alphaImportErrorsConfig struct { 1177 // GcsPrefix: Google Cloud Storage path for import errors. This must be 1178 // an empty, existing Cloud Storage bucket. Import errors will be 1179 // written to a file in this bucket, one per line, as a JSON-encoded 1180 // `google.rpc.Status` message. 1181 GcsPrefix string `json:"gcsPrefix,omitempty"` 1182 1183 // ForceSendFields is a list of field names (e.g. "GcsPrefix") to 1184 // unconditionally include in API requests. By default, fields with 1185 // empty values are omitted from API requests. However, any non-pointer, 1186 // non-interface field appearing in ForceSendFields will be sent to the 1187 // server regardless of whether the field is empty or not. This may be 1188 // used to include empty fields in Patch requests. 1189 ForceSendFields []string `json:"-"` 1190 1191 // NullFields is a list of field names (e.g. "GcsPrefix") to include in 1192 // API requests with the JSON null value. By default, fields with empty 1193 // values are omitted from API requests. However, any field with an 1194 // empty value appearing in NullFields will be sent to the server as 1195 // null. It is an error if a field in this list has a non-empty value. 1196 // This may be used to include null fields in Patch requests. 1197 NullFields []string `json:"-"` 1198} 1199 1200func (s *GoogleCloudRetailV2alphaImportErrorsConfig) MarshalJSON() ([]byte, error) { 1201 type NoMethod GoogleCloudRetailV2alphaImportErrorsConfig 1202 raw := NoMethod(*s) 1203 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1204} 1205 1206// GoogleCloudRetailV2alphaImportMetadata: Metadata related to the 1207// progress of the Import operation. This will be returned by the 1208// google.longrunning.Operation.metadata field. 1209type GoogleCloudRetailV2alphaImportMetadata struct { 1210 // CreateTime: Operation create time. 1211 CreateTime string `json:"createTime,omitempty"` 1212 1213 // FailureCount: Count of entries that encountered errors while 1214 // processing. 1215 FailureCount int64 `json:"failureCount,omitempty,string"` 1216 1217 // SuccessCount: Count of entries that were processed successfully. 1218 SuccessCount int64 `json:"successCount,omitempty,string"` 1219 1220 // UpdateTime: Operation last update time. If the operation is done, 1221 // this is also the finish time. 1222 UpdateTime string `json:"updateTime,omitempty"` 1223 1224 // ForceSendFields is a list of field names (e.g. "CreateTime") to 1225 // unconditionally include in API requests. By default, fields with 1226 // empty values are omitted from API requests. However, any non-pointer, 1227 // non-interface field appearing in ForceSendFields will be sent to the 1228 // server regardless of whether the field is empty or not. This may be 1229 // used to include empty fields in Patch requests. 1230 ForceSendFields []string `json:"-"` 1231 1232 // NullFields is a list of field names (e.g. "CreateTime") to include in 1233 // API requests with the JSON null value. By default, fields with empty 1234 // values are omitted from API requests. However, any field with an 1235 // empty value appearing in NullFields will be sent to the server as 1236 // null. It is an error if a field in this list has a non-empty value. 1237 // This may be used to include null fields in Patch requests. 1238 NullFields []string `json:"-"` 1239} 1240 1241func (s *GoogleCloudRetailV2alphaImportMetadata) MarshalJSON() ([]byte, error) { 1242 type NoMethod GoogleCloudRetailV2alphaImportMetadata 1243 raw := NoMethod(*s) 1244 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1245} 1246 1247// GoogleCloudRetailV2alphaImportProductsRequest: Request message for 1248// Import methods. 1249type GoogleCloudRetailV2alphaImportProductsRequest struct { 1250 // ErrorsConfig: The desired location of errors incurred during the 1251 // Import. 1252 ErrorsConfig *GoogleCloudRetailV2alphaImportErrorsConfig `json:"errorsConfig,omitempty"` 1253 1254 // InputConfig: Required. The desired input location of the data. 1255 InputConfig *GoogleCloudRetailV2alphaProductInputConfig `json:"inputConfig,omitempty"` 1256 1257 // UpdateMask: Indicates which fields in the provided imported 1258 // 'products' to update. If not set, will by default update all fields. 1259 UpdateMask string `json:"updateMask,omitempty"` 1260 1261 // ForceSendFields is a list of field names (e.g. "ErrorsConfig") to 1262 // unconditionally include in API requests. By default, fields with 1263 // empty values are omitted from API requests. However, any non-pointer, 1264 // non-interface field appearing in ForceSendFields will be sent to the 1265 // server regardless of whether the field is empty or not. This may be 1266 // used to include empty fields in Patch requests. 1267 ForceSendFields []string `json:"-"` 1268 1269 // NullFields is a list of field names (e.g. "ErrorsConfig") to include 1270 // in API requests with the JSON null value. By default, fields with 1271 // empty values are omitted from API requests. However, any field with 1272 // an empty value appearing in NullFields will be sent to the server as 1273 // null. It is an error if a field in this list has a non-empty value. 1274 // This may be used to include null fields in Patch requests. 1275 NullFields []string `json:"-"` 1276} 1277 1278func (s *GoogleCloudRetailV2alphaImportProductsRequest) MarshalJSON() ([]byte, error) { 1279 type NoMethod GoogleCloudRetailV2alphaImportProductsRequest 1280 raw := NoMethod(*s) 1281 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1282} 1283 1284// GoogleCloudRetailV2alphaImportProductsResponse: Response of the 1285// ImportProductsRequest. If the long running operation is done, then 1286// this message is returned by the 1287// google.longrunning.Operations.response field if the operation was 1288// successful. 1289type GoogleCloudRetailV2alphaImportProductsResponse struct { 1290 // ErrorSamples: A sample of errors encountered while processing the 1291 // request. 1292 ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` 1293 1294 // ErrorsConfig: Echoes the destination for the complete errors in the 1295 // request if set. 1296 ErrorsConfig *GoogleCloudRetailV2alphaImportErrorsConfig `json:"errorsConfig,omitempty"` 1297 1298 // ForceSendFields is a list of field names (e.g. "ErrorSamples") to 1299 // unconditionally include in API requests. By default, fields with 1300 // empty values are omitted from API requests. However, any non-pointer, 1301 // non-interface field appearing in ForceSendFields will be sent to the 1302 // server regardless of whether the field is empty or not. This may be 1303 // used to include empty fields in Patch requests. 1304 ForceSendFields []string `json:"-"` 1305 1306 // NullFields is a list of field names (e.g. "ErrorSamples") to include 1307 // in API requests with the JSON null value. By default, fields with 1308 // empty values are omitted from API requests. However, any field with 1309 // an empty value appearing in NullFields will be sent to the server as 1310 // null. It is an error if a field in this list has a non-empty value. 1311 // This may be used to include null fields in Patch requests. 1312 NullFields []string `json:"-"` 1313} 1314 1315func (s *GoogleCloudRetailV2alphaImportProductsResponse) MarshalJSON() ([]byte, error) { 1316 type NoMethod GoogleCloudRetailV2alphaImportProductsResponse 1317 raw := NoMethod(*s) 1318 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1319} 1320 1321// GoogleCloudRetailV2alphaImportUserEventsRequest: Request message for 1322// the ImportUserEvents request. 1323type GoogleCloudRetailV2alphaImportUserEventsRequest struct { 1324 // ErrorsConfig: The desired location of errors incurred during the 1325 // Import. Cannot be set for inline user event imports. 1326 ErrorsConfig *GoogleCloudRetailV2alphaImportErrorsConfig `json:"errorsConfig,omitempty"` 1327 1328 // InputConfig: Required. The desired input location of the data. 1329 InputConfig *GoogleCloudRetailV2alphaUserEventInputConfig `json:"inputConfig,omitempty"` 1330 1331 // ForceSendFields is a list of field names (e.g. "ErrorsConfig") to 1332 // unconditionally include in API requests. By default, fields with 1333 // empty values are omitted from API requests. However, any non-pointer, 1334 // non-interface field appearing in ForceSendFields will be sent to the 1335 // server regardless of whether the field is empty or not. This may be 1336 // used to include empty fields in Patch requests. 1337 ForceSendFields []string `json:"-"` 1338 1339 // NullFields is a list of field names (e.g. "ErrorsConfig") to include 1340 // in API requests with the JSON null value. By default, fields with 1341 // empty values are omitted from API requests. However, any field with 1342 // an empty value appearing in NullFields will be sent to the server as 1343 // null. It is an error if a field in this list has a non-empty value. 1344 // This may be used to include null fields in Patch requests. 1345 NullFields []string `json:"-"` 1346} 1347 1348func (s *GoogleCloudRetailV2alphaImportUserEventsRequest) MarshalJSON() ([]byte, error) { 1349 type NoMethod GoogleCloudRetailV2alphaImportUserEventsRequest 1350 raw := NoMethod(*s) 1351 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1352} 1353 1354// GoogleCloudRetailV2alphaImportUserEventsResponse: Response of the 1355// ImportUserEventsRequest. If the long running operation was 1356// successful, then this message is returned by the 1357// google.longrunning.Operations.response field if the operation was 1358// successful. 1359type GoogleCloudRetailV2alphaImportUserEventsResponse struct { 1360 // ErrorSamples: A sample of errors encountered while processing the 1361 // request. 1362 ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` 1363 1364 // ErrorsConfig: Echoes the destination for the complete errors if this 1365 // field was set in the request. 1366 ErrorsConfig *GoogleCloudRetailV2alphaImportErrorsConfig `json:"errorsConfig,omitempty"` 1367 1368 // ImportSummary: Aggregated statistics of user event import status. 1369 ImportSummary *GoogleCloudRetailV2alphaUserEventImportSummary `json:"importSummary,omitempty"` 1370 1371 // ForceSendFields is a list of field names (e.g. "ErrorSamples") to 1372 // unconditionally include in API requests. By default, fields with 1373 // empty values are omitted from API requests. However, any non-pointer, 1374 // non-interface field appearing in ForceSendFields will be sent to the 1375 // server regardless of whether the field is empty or not. This may be 1376 // used to include empty fields in Patch requests. 1377 ForceSendFields []string `json:"-"` 1378 1379 // NullFields is a list of field names (e.g. "ErrorSamples") to include 1380 // in API requests with the JSON null value. By default, fields with 1381 // empty values are omitted from API requests. However, any field with 1382 // an empty value appearing in NullFields will be sent to the server as 1383 // null. It is an error if a field in this list has a non-empty value. 1384 // This may be used to include null fields in Patch requests. 1385 NullFields []string `json:"-"` 1386} 1387 1388func (s *GoogleCloudRetailV2alphaImportUserEventsResponse) MarshalJSON() ([]byte, error) { 1389 type NoMethod GoogleCloudRetailV2alphaImportUserEventsResponse 1390 raw := NoMethod(*s) 1391 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1392} 1393 1394// GoogleCloudRetailV2alphaListCatalogsResponse: Response for 1395// CatalogService.ListCatalogs method. 1396type GoogleCloudRetailV2alphaListCatalogsResponse struct { 1397 // Catalogs: All the customer's Catalogs. 1398 Catalogs []*GoogleCloudRetailV2alphaCatalog `json:"catalogs,omitempty"` 1399 1400 // NextPageToken: A token that can be sent as 1401 // ListCatalogsRequest.page_token to retrieve the next page. If this 1402 // field is omitted, there are no subsequent pages. 1403 NextPageToken string `json:"nextPageToken,omitempty"` 1404 1405 // ServerResponse contains the HTTP response code and headers from the 1406 // server. 1407 googleapi.ServerResponse `json:"-"` 1408 1409 // ForceSendFields is a list of field names (e.g. "Catalogs") to 1410 // unconditionally include in API requests. By default, fields with 1411 // empty values are omitted from API requests. However, any non-pointer, 1412 // non-interface field appearing in ForceSendFields will be sent to the 1413 // server regardless of whether the field is empty or not. This may be 1414 // used to include empty fields in Patch requests. 1415 ForceSendFields []string `json:"-"` 1416 1417 // NullFields is a list of field names (e.g. "Catalogs") to include in 1418 // API requests with the JSON null value. By default, fields with empty 1419 // values are omitted from API requests. However, any field with an 1420 // empty value appearing in NullFields will be sent to the server as 1421 // null. It is an error if a field in this list has a non-empty value. 1422 // This may be used to include null fields in Patch requests. 1423 NullFields []string `json:"-"` 1424} 1425 1426func (s *GoogleCloudRetailV2alphaListCatalogsResponse) MarshalJSON() ([]byte, error) { 1427 type NoMethod GoogleCloudRetailV2alphaListCatalogsResponse 1428 raw := NoMethod(*s) 1429 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1430} 1431 1432// GoogleCloudRetailV2alphaPredictRequest: Request message for Predict 1433// method. 1434type GoogleCloudRetailV2alphaPredictRequest struct { 1435 // Filter: Filter for restricting prediction results with a length limit 1436 // of 5,000 characters. Accepts values for tags and the 1437 // `filterOutOfStockItems` flag. * Tag expressions. Restricts 1438 // predictions to products that match all of the specified tags. Boolean 1439 // operators `OR` and `NOT` are supported if the expression is enclosed 1440 // in parentheses, and must be separated from the tag values by a space. 1441 // `-"tagA" is also supported and is equivalent to `NOT "tagA". Tag 1442 // values must be double quoted UTF-8 encoded strings with a size limit 1443 // of 1,000 characters. Note: "Recently viewed" models don't support tag 1444 // filtering at the moment. * filterOutOfStockItems. Restricts 1445 // predictions to products that do not have a stockState value of 1446 // OUT_OF_STOCK. Examples: * tag=("Red" OR "Blue") tag="New-Arrival" 1447 // tag=(NOT "promotional") * filterOutOfStockItems tag=(-"promotional") 1448 // * filterOutOfStockItems If your filter blocks all prediction results, 1449 // nothing will be returned. If you want generic (unfiltered) popular 1450 // products to be returned instead, set `strictFiltering` to false in 1451 // `PredictRequest.params`. 1452 Filter string `json:"filter,omitempty"` 1453 1454 // Labels: The labels for the predict request. * Label keys can contain 1455 // lowercase letters, digits and hyphens, must start with a letter, and 1456 // must end with a letter or digit. * Non-zero label values can contain 1457 // lowercase letters, digits and hyphens, must start with a letter, and 1458 // must end with a letter or digit. * No more than 64 labels can be 1459 // associated with a given request. See https://goo.gl/xmQnxf for more 1460 // information on and examples of labels. 1461 Labels map[string]string `json:"labels,omitempty"` 1462 1463 // PageSize: Maximum number of results to return per page. Set this 1464 // property to the number of prediction results needed. If zero, the 1465 // service will choose a reasonable default. The maximum allowed value 1466 // is 100. Values above 100 will be coerced to 100. 1467 PageSize int64 `json:"pageSize,omitempty"` 1468 1469 // PageToken: The previous PredictResponse.next_page_token. 1470 PageToken string `json:"pageToken,omitempty"` 1471 1472 // Params: Additional domain specific parameters for the predictions. 1473 // Allowed values: * `returnProduct`: Boolean. If set to true, the 1474 // associated product object will be returned in the `results.metadata` 1475 // field in the prediction response. * `returnScore`: Boolean. If set to 1476 // true, the prediction 'score' corresponding to each returned product 1477 // will be set in the `results.metadata` field in the prediction 1478 // response. The given 'score' indicates the probability of an product 1479 // being clicked/purchased given the user's context and history. * 1480 // `strictFiltering`: Boolean. True by default. If set to false, the 1481 // service will return generic (unfiltered) popular products instead of 1482 // empty if your filter blocks all prediction results. 1483 Params googleapi.RawMessage `json:"params,omitempty"` 1484 1485 // UserEvent: Required. Context about the user, what they are looking at 1486 // and what action they took to trigger the predict request. Note that 1487 // this user event detail won't be ingested to userEvent logs. Thus, a 1488 // separate userEvent write request is required for event logging. 1489 UserEvent *GoogleCloudRetailV2alphaUserEvent `json:"userEvent,omitempty"` 1490 1491 // ValidateOnly: Use validate only mode for this prediction query. If 1492 // set to true, a dummy model will be used that returns arbitrary 1493 // products. Note that the validate only mode should only be used for 1494 // testing the API, or if the model is not ready. 1495 ValidateOnly bool `json:"validateOnly,omitempty"` 1496 1497 // ForceSendFields is a list of field names (e.g. "Filter") to 1498 // unconditionally include in API requests. By default, fields with 1499 // empty values are omitted from API requests. However, any non-pointer, 1500 // non-interface field appearing in ForceSendFields will be sent to the 1501 // server regardless of whether the field is empty or not. This may be 1502 // used to include empty fields in Patch requests. 1503 ForceSendFields []string `json:"-"` 1504 1505 // NullFields is a list of field names (e.g. "Filter") to include in API 1506 // requests with the JSON null value. By default, fields with empty 1507 // values are omitted from API requests. However, any field with an 1508 // empty value appearing in NullFields will be sent to the server as 1509 // null. It is an error if a field in this list has a non-empty value. 1510 // This may be used to include null fields in Patch requests. 1511 NullFields []string `json:"-"` 1512} 1513 1514func (s *GoogleCloudRetailV2alphaPredictRequest) MarshalJSON() ([]byte, error) { 1515 type NoMethod GoogleCloudRetailV2alphaPredictRequest 1516 raw := NoMethod(*s) 1517 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1518} 1519 1520// GoogleCloudRetailV2alphaPredictResponse: Response message for predict 1521// method. 1522type GoogleCloudRetailV2alphaPredictResponse struct { 1523 // AttributionToken: A unique attribution token. This should be included 1524 // in the UserEvent logs resulting from this recommendation, which 1525 // enables accurate attribution of recommendation model performance. 1526 AttributionToken string `json:"attributionToken,omitempty"` 1527 1528 // MissingIds: IDs of products in the request that were missing from the 1529 // inventory. 1530 MissingIds []string `json:"missingIds,omitempty"` 1531 1532 // Results: A list of recommended products. The order represents the 1533 // ranking (from the most relevant product to the least). 1534 Results []*GoogleCloudRetailV2alphaPredictResponsePredictionResult `json:"results,omitempty"` 1535 1536 // ValidateOnly: True if the validateOnly property was set in the 1537 // request. 1538 ValidateOnly bool `json:"validateOnly,omitempty"` 1539 1540 // ServerResponse contains the HTTP response code and headers from the 1541 // server. 1542 googleapi.ServerResponse `json:"-"` 1543 1544 // ForceSendFields is a list of field names (e.g. "AttributionToken") to 1545 // unconditionally include in API requests. By default, fields with 1546 // empty values are omitted from API requests. However, any non-pointer, 1547 // non-interface field appearing in ForceSendFields will be sent to the 1548 // server regardless of whether the field is empty or not. This may be 1549 // used to include empty fields in Patch requests. 1550 ForceSendFields []string `json:"-"` 1551 1552 // NullFields is a list of field names (e.g. "AttributionToken") to 1553 // include in API requests with the JSON null value. By default, fields 1554 // with empty values are omitted from API requests. However, any field 1555 // with an empty value appearing in NullFields will be sent to the 1556 // server as null. It is an error if a field in this list has a 1557 // non-empty value. This may be used to include null fields in Patch 1558 // requests. 1559 NullFields []string `json:"-"` 1560} 1561 1562func (s *GoogleCloudRetailV2alphaPredictResponse) MarshalJSON() ([]byte, error) { 1563 type NoMethod GoogleCloudRetailV2alphaPredictResponse 1564 raw := NoMethod(*s) 1565 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1566} 1567 1568// GoogleCloudRetailV2alphaPredictResponsePredictionResult: 1569// PredictionResult represents the recommendation prediction results. 1570type GoogleCloudRetailV2alphaPredictResponsePredictionResult struct { 1571 // Id: ID of the recommended product 1572 Id string `json:"id,omitempty"` 1573 1574 // Metadata: Additional product metadata / annotations. Possible values: 1575 // * `product`: JSON representation of the product. Will be set if 1576 // `returnProduct` is set to true in `PredictRequest.params`. * `score`: 1577 // Prediction score in double value. Will be set if `returnScore` is set 1578 // to true in `PredictRequest.params`. 1579 Metadata googleapi.RawMessage `json:"metadata,omitempty"` 1580 1581 // ForceSendFields is a list of field names (e.g. "Id") to 1582 // unconditionally include in API requests. By default, fields with 1583 // empty values are omitted from API requests. However, any non-pointer, 1584 // non-interface field appearing in ForceSendFields will be sent to the 1585 // server regardless of whether the field is empty or not. This may be 1586 // used to include empty fields in Patch requests. 1587 ForceSendFields []string `json:"-"` 1588 1589 // NullFields is a list of field names (e.g. "Id") to include in API 1590 // requests with the JSON null value. By default, fields with empty 1591 // values are omitted from API requests. However, any field with an 1592 // empty value appearing in NullFields will be sent to the server as 1593 // null. It is an error if a field in this list has a non-empty value. 1594 // This may be used to include null fields in Patch requests. 1595 NullFields []string `json:"-"` 1596} 1597 1598func (s *GoogleCloudRetailV2alphaPredictResponsePredictionResult) MarshalJSON() ([]byte, error) { 1599 type NoMethod GoogleCloudRetailV2alphaPredictResponsePredictionResult 1600 raw := NoMethod(*s) 1601 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1602} 1603 1604// GoogleCloudRetailV2alphaPriceInfo: The price information of a 1605// Product. 1606type GoogleCloudRetailV2alphaPriceInfo struct { 1607 // Cost: The costs associated with the sale of a particular product. 1608 // Used for gross profit reporting. * Profit = price - cost Google 1609 // Merchant Center property cost_of_goods_sold 1610 // (https://support.google.com/merchants/answer/9017895). 1611 Cost float64 `json:"cost,omitempty"` 1612 1613 // CurrencyCode: The 3-letter currency code defined in ISO 4217 1614 // (https://www.iso.org/iso-4217-currency-codes.html). If this field is 1615 // an unrecognizable currency code, an INVALID_ARGUMENT error is 1616 // returned. 1617 CurrencyCode string `json:"currencyCode,omitempty"` 1618 1619 // OriginalPrice: Price of the product without any discount. If zero, by 1620 // default set to be the price. 1621 OriginalPrice float64 `json:"originalPrice,omitempty"` 1622 1623 // Price: Price of the product. Google Merchant Center property price 1624 // (https://support.google.com/merchants/answer/6324371). Schema.org 1625 // property Offer.priceSpecification 1626 // (https://schema.org/priceSpecification). 1627 Price float64 `json:"price,omitempty"` 1628 1629 // ForceSendFields is a list of field names (e.g. "Cost") to 1630 // unconditionally include in API requests. By default, fields with 1631 // empty values are omitted from API requests. However, any non-pointer, 1632 // non-interface field appearing in ForceSendFields will be sent to the 1633 // server regardless of whether the field is empty or not. This may be 1634 // used to include empty fields in Patch requests. 1635 ForceSendFields []string `json:"-"` 1636 1637 // NullFields is a list of field names (e.g. "Cost") to include in API 1638 // requests with the JSON null value. By default, fields with empty 1639 // values are omitted from API requests. However, any field with an 1640 // empty value appearing in NullFields will be sent to the server as 1641 // null. It is an error if a field in this list has a non-empty value. 1642 // This may be used to include null fields in Patch requests. 1643 NullFields []string `json:"-"` 1644} 1645 1646func (s *GoogleCloudRetailV2alphaPriceInfo) MarshalJSON() ([]byte, error) { 1647 type NoMethod GoogleCloudRetailV2alphaPriceInfo 1648 raw := NoMethod(*s) 1649 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1650} 1651 1652func (s *GoogleCloudRetailV2alphaPriceInfo) UnmarshalJSON(data []byte) error { 1653 type NoMethod GoogleCloudRetailV2alphaPriceInfo 1654 var s1 struct { 1655 Cost gensupport.JSONFloat64 `json:"cost"` 1656 OriginalPrice gensupport.JSONFloat64 `json:"originalPrice"` 1657 Price gensupport.JSONFloat64 `json:"price"` 1658 *NoMethod 1659 } 1660 s1.NoMethod = (*NoMethod)(s) 1661 if err := json.Unmarshal(data, &s1); err != nil { 1662 return err 1663 } 1664 s.Cost = float64(s1.Cost) 1665 s.OriginalPrice = float64(s1.OriginalPrice) 1666 s.Price = float64(s1.Price) 1667 return nil 1668} 1669 1670// GoogleCloudRetailV2alphaProduct: Product captures all metadata 1671// information of items to be recommended or searched. 1672type GoogleCloudRetailV2alphaProduct struct { 1673 // Attributes: Highly encouraged. Extra product attributes to be 1674 // included. For example, for products, this could include the store 1675 // name, vendor, style, color, etc. These are very strong signals for 1676 // recommendation model, thus we highly recommend providing the 1677 // attributes here. Features that can take on one of a limited number of 1678 // possible values. Two types of features can be set are: Textual 1679 // features. some examples would be the brand/maker of a product, or 1680 // country of a customer. Numerical features. Some examples would be the 1681 // height/weight of a product, or age of a customer. For example: `{ 1682 // "vendor": {"text": ["vendor123", "vendor456"]}, "lengths_cm": 1683 // {"numbers":[2.3, 15.4]}, "heights_cm": {"numbers":[8.1, 6.4]} }`. 1684 // This field needs to pass all below criteria, otherwise an 1685 // INVALID_ARGUMENT error is returned: * Max entries count: 150 by 1686 // default; 100 for Type.VARIANT. * The key must be a UTF-8 encoded 1687 // string with a length limit of 128 characters. 1688 Attributes map[string]GoogleCloudRetailV2alphaCustomAttribute `json:"attributes,omitempty"` 1689 1690 // Availability: The online availability of the Product. Default to 1691 // Availability.IN_STOCK. Google Merchant Center Property availability 1692 // (https://support.google.com/merchants/answer/6324448). Schema.org 1693 // Property Offer.availability (https://schema.org/availability). 1694 // 1695 // Possible values: 1696 // "AVAILABILITY_UNSPECIFIED" - Default product availability. Default 1697 // to Availability.IN_STOCK if unset. 1698 // "IN_STOCK" - Product in stock. 1699 // "OUT_OF_STOCK" - Product out of stock. 1700 // "PREORDER" - Product that is in pre-order state. 1701 // "BACKORDER" - Product that is back-ordered (i.e. temporarily out of 1702 // stock). 1703 Availability string `json:"availability,omitempty"` 1704 1705 // AvailableQuantity: The available quantity of the item. 1706 AvailableQuantity int64 `json:"availableQuantity,omitempty"` 1707 1708 // AvailableTime: The timestamp when this Product becomes available for 1709 // recommendation. 1710 AvailableTime string `json:"availableTime,omitempty"` 1711 1712 // Categories: Product categories. This field is repeated for supporting 1713 // one product belonging to several parallel categories. Strongly 1714 // recommended using the full path for better search / recommendation 1715 // quality. To represent full path of category, use '>' sign to separate 1716 // different hierarchies. If '>' is part of the category name, please 1717 // replace it with other character(s). For example, if a shoes product 1718 // belongs to both ["Shoes & Accessories" -> "Shoes"] and ["Sports & 1719 // Fitness" -> "Athletic Clothing" -> "Shoes"], it could be represented 1720 // as: "categories": [ "Shoes & Accessories > Shoes", "Sports & Fitness 1721 // > Athletic Clothing > Shoes" ] Must be set for Type.PRIMARY Product 1722 // otherwise an INVALID_ARGUMENT error is returned. At most 250 values 1723 // are allowed per Product. Empty values are not allowed. Each value 1724 // must be a UTF-8 encoded string with a length limit of 5,000 1725 // characters. Otherwise, an INVALID_ARGUMENT error is returned. Google 1726 // Merchant Center property google_product_category. Schema.org property 1727 // [Product.category] (https://schema.org/category). 1728 // [mc_google_product_category]: 1729 // https://support.google.com/merchants/answer/6324436 1730 Categories []string `json:"categories,omitempty"` 1731 1732 // Description: Product description. This field must be a UTF-8 encoded 1733 // string with a length limit of 5,000 characters. Otherwise, an 1734 // INVALID_ARGUMENT error is returned. Google Merchant Center property 1735 // description (https://support.google.com/merchants/answer/6324468). 1736 // schema.org property Product.description 1737 // (https://schema.org/description). 1738 Description string `json:"description,omitempty"` 1739 1740 // Id: Immutable. Product identifier, which is the final component of 1741 // name. For example, this field is "id_1", if name is 1742 // `projects/*/locations/global/catalogs/default_catalog/branches/default 1743 // _branch/products/id_1`. This field must be a UTF-8 encoded string 1744 // with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT 1745 // error is returned. Google Merchant Center property id 1746 // (https://support.google.com/merchants/answer/6324405). Schema.org 1747 // Property Product.sku (https://schema.org/sku). 1748 Id string `json:"id,omitempty"` 1749 1750 // Images: Product images for the product.Highly recommended to put the 1751 // main image to the first. A maximum of 300 images are allowed. Google 1752 // Merchant Center property image_link 1753 // (https://support.google.com/merchants/answer/6324350). Schema.org 1754 // property Product.image (https://schema.org/image). 1755 Images []*GoogleCloudRetailV2alphaImage `json:"images,omitempty"` 1756 1757 // Name: Immutable. Full resource name of the product, such as 1758 // `projects/*/locations/global/catalogs/default_catalog/branches/default 1759 // _branch/products/product_id`. The branch ID must be "default_branch". 1760 Name string `json:"name,omitempty"` 1761 1762 // PriceInfo: Product price and cost information. Google Merchant Center 1763 // property price (https://support.google.com/merchants/answer/6324371). 1764 PriceInfo *GoogleCloudRetailV2alphaPriceInfo `json:"priceInfo,omitempty"` 1765 1766 // PrimaryProductId: Variant group identifier. Must be an id, with the 1767 // same parent branch with this product. Otherwise, an error is thrown. 1768 // For Type.PRIMARY Products, this field can only be empty or set to the 1769 // same value as id. For VARIANT Products, this field cannot be empty. A 1770 // maximum of 2,000 products are allowed to share the same Type.PRIMARY 1771 // Product. Otherwise, an INVALID_ARGUMENT error is returned. Google 1772 // Merchant Center Property item_group_id 1773 // (https://support.google.com/merchants/answer/6324507). Schema.org 1774 // Property Product.inProductGroupWithID 1775 // (https://schema.org/inProductGroupWithID). This field must be enabled 1776 // before it can be used. Learn more 1777 // (/recommendations-ai/docs/catalog#item-group-id). 1778 PrimaryProductId string `json:"primaryProductId,omitempty"` 1779 1780 // Tags: Custom tags associated with the product. At most 250 values are 1781 // allowed per Product. This value must be a UTF-8 encoded string with a 1782 // length limit of 1,000 characters. Otherwise, an INVALID_ARGUMENT 1783 // error is returned. This tag can be used for filtering recommendation 1784 // results by passing the tag as part of the PredictRequest.filter. 1785 // Google Merchant Center property custom_label_0–4 1786 // (https://support.google.com/merchants/answer/6324473). 1787 Tags []string `json:"tags,omitempty"` 1788 1789 // Title: Required. Product title. This field must be a UTF-8 encoded 1790 // string with a length limit of 1,000 characters. Otherwise, an 1791 // INVALID_ARGUMENT error is returned. Google Merchant Center property 1792 // title (https://support.google.com/merchants/answer/6324415). 1793 // Schema.org property Product.name (https://schema.org/name). 1794 Title string `json:"title,omitempty"` 1795 1796 // Type: Immutable. The type of the product. This field is output-only. 1797 // Default to Catalog.product_level_config.ingestion_product_type if 1798 // unset. 1799 // 1800 // Possible values: 1801 // "TYPE_UNSPECIFIED" - Default value. Default to 1802 // Catalog.product_level_config.ingestion_product_type if unset. 1803 // "PRIMARY" - The primary type. As the primary unit for predicting, 1804 // indexing and search serving, a Type.PRIMARY Product is grouped with 1805 // multiple Type.VARIANT Products. 1806 // "VARIANT" - The variant type. Type.VARIANT Products usually share 1807 // some common attributes on the same Type.PRIMARY Products, but they 1808 // have variant attributes like different colors, sizes and prices, etc. 1809 // "COLLECTION" - The collection type. Collection products are bundled 1810 // Type.PRIMARY Products or Type.VARIANT Products that are sold 1811 // together, such as a jewelry set with necklaces, earrings and rings, 1812 // etc. 1813 Type string `json:"type,omitempty"` 1814 1815 // Uri: Canonical URL directly linking to the product detail page. It is 1816 // strongly recommended to provide a valid uri for the product, 1817 // otherwise the service performance could be significantly degraded. 1818 // This field must be a UTF-8 encoded string with a length limit of 1819 // 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. 1820 // Google Merchant Center property link 1821 // (https://support.google.com/merchants/answer/6324416). Schema.org 1822 // property Offer.url (https://schema.org/url). 1823 Uri string `json:"uri,omitempty"` 1824 1825 // ServerResponse contains the HTTP response code and headers from the 1826 // server. 1827 googleapi.ServerResponse `json:"-"` 1828 1829 // ForceSendFields is a list of field names (e.g. "Attributes") to 1830 // unconditionally include in API requests. By default, fields with 1831 // empty values are omitted from API requests. However, any non-pointer, 1832 // non-interface field appearing in ForceSendFields will be sent to the 1833 // server regardless of whether the field is empty or not. This may be 1834 // used to include empty fields in Patch requests. 1835 ForceSendFields []string `json:"-"` 1836 1837 // NullFields is a list of field names (e.g. "Attributes") to include in 1838 // API requests with the JSON null value. By default, fields with empty 1839 // values are omitted from API requests. However, any field with an 1840 // empty value appearing in NullFields will be sent to the server as 1841 // null. It is an error if a field in this list has a non-empty value. 1842 // This may be used to include null fields in Patch requests. 1843 NullFields []string `json:"-"` 1844} 1845 1846func (s *GoogleCloudRetailV2alphaProduct) MarshalJSON() ([]byte, error) { 1847 type NoMethod GoogleCloudRetailV2alphaProduct 1848 raw := NoMethod(*s) 1849 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1850} 1851 1852// GoogleCloudRetailV2alphaProductDetail: Detailed product information 1853// associated with a user event. 1854type GoogleCloudRetailV2alphaProductDetail struct { 1855 // Product: Required. Product information. Only Product.id field is used 1856 // when ingesting an event, all other product fields are ignored as we 1857 // will look them up from the catalog. 1858 Product *GoogleCloudRetailV2alphaProduct `json:"product,omitempty"` 1859 1860 // Quantity: Quantity of the product associated with the user event. For 1861 // example, this field will be 2 if two products are added to the 1862 // shopping cart for `purchase-complete` event. Required for 1863 // `add-to-cart` and `purchase-complete` event types. 1864 Quantity int64 `json:"quantity,omitempty"` 1865 1866 // ForceSendFields is a list of field names (e.g. "Product") to 1867 // unconditionally include in API requests. By default, fields with 1868 // empty values are omitted from API requests. However, any non-pointer, 1869 // non-interface field appearing in ForceSendFields will be sent to the 1870 // server regardless of whether the field is empty or not. This may be 1871 // used to include empty fields in Patch requests. 1872 ForceSendFields []string `json:"-"` 1873 1874 // NullFields is a list of field names (e.g. "Product") to include in 1875 // API requests with the JSON null value. By default, fields with empty 1876 // values are omitted from API requests. However, any field with an 1877 // empty value appearing in NullFields will be sent to the server as 1878 // null. It is an error if a field in this list has a non-empty value. 1879 // This may be used to include null fields in Patch requests. 1880 NullFields []string `json:"-"` 1881} 1882 1883func (s *GoogleCloudRetailV2alphaProductDetail) MarshalJSON() ([]byte, error) { 1884 type NoMethod GoogleCloudRetailV2alphaProductDetail 1885 raw := NoMethod(*s) 1886 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1887} 1888 1889// GoogleCloudRetailV2alphaProductInlineSource: The inline source for 1890// the input config for ImportProducts method. 1891type GoogleCloudRetailV2alphaProductInlineSource struct { 1892 // Products: Required. A list of products to update/create. Each product 1893 // must have a valid Product.id. Recommended max of 10k items. 1894 Products []*GoogleCloudRetailV2alphaProduct `json:"products,omitempty"` 1895 1896 // ForceSendFields is a list of field names (e.g. "Products") to 1897 // unconditionally include in API requests. By default, fields with 1898 // empty values are omitted from API requests. However, any non-pointer, 1899 // non-interface field appearing in ForceSendFields will be sent to the 1900 // server regardless of whether the field is empty or not. This may be 1901 // used to include empty fields in Patch requests. 1902 ForceSendFields []string `json:"-"` 1903 1904 // NullFields is a list of field names (e.g. "Products") to include in 1905 // API requests with the JSON null value. By default, fields with empty 1906 // values are omitted from API requests. However, any field with an 1907 // empty value appearing in NullFields will be sent to the server as 1908 // null. It is an error if a field in this list has a non-empty value. 1909 // This may be used to include null fields in Patch requests. 1910 NullFields []string `json:"-"` 1911} 1912 1913func (s *GoogleCloudRetailV2alphaProductInlineSource) MarshalJSON() ([]byte, error) { 1914 type NoMethod GoogleCloudRetailV2alphaProductInlineSource 1915 raw := NoMethod(*s) 1916 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1917} 1918 1919// GoogleCloudRetailV2alphaProductInputConfig: The input config source 1920// for products. 1921type GoogleCloudRetailV2alphaProductInputConfig struct { 1922 // BigQuerySource: BigQuery input source. 1923 BigQuerySource *GoogleCloudRetailV2alphaBigQuerySource `json:"bigQuerySource,omitempty"` 1924 1925 // GcsSource: Google Cloud Storage location for the input content. 1926 GcsSource *GoogleCloudRetailV2alphaGcsSource `json:"gcsSource,omitempty"` 1927 1928 // ProductInlineSource: The Inline source for the input content for 1929 // products. 1930 ProductInlineSource *GoogleCloudRetailV2alphaProductInlineSource `json:"productInlineSource,omitempty"` 1931 1932 // ForceSendFields is a list of field names (e.g. "BigQuerySource") to 1933 // unconditionally include in API requests. By default, fields with 1934 // empty values are omitted from API requests. However, any non-pointer, 1935 // non-interface field appearing in ForceSendFields will be sent to the 1936 // server regardless of whether the field is empty or not. This may be 1937 // used to include empty fields in Patch requests. 1938 ForceSendFields []string `json:"-"` 1939 1940 // NullFields is a list of field names (e.g. "BigQuerySource") to 1941 // include in API requests with the JSON null value. By default, fields 1942 // with empty values are omitted from API requests. However, any field 1943 // with an empty value appearing in NullFields will be sent to the 1944 // server as null. It is an error if a field in this list has a 1945 // non-empty value. This may be used to include null fields in Patch 1946 // requests. 1947 NullFields []string `json:"-"` 1948} 1949 1950func (s *GoogleCloudRetailV2alphaProductInputConfig) MarshalJSON() ([]byte, error) { 1951 type NoMethod GoogleCloudRetailV2alphaProductInputConfig 1952 raw := NoMethod(*s) 1953 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1954} 1955 1956// GoogleCloudRetailV2alphaProductLevelConfig: Configures what level the 1957// product should be uploaded with regards to how users will be send 1958// events and how predictions will be made. 1959type GoogleCloudRetailV2alphaProductLevelConfig struct { 1960 // IngestionProductType: The type of Products allowed to be ingested 1961 // into the catalog. Acceptable values are: * `primary` (default): You 1962 // can only ingest Product.Type.PRIMARY Products. This means 1963 // Product.primary_product_id can only be empty or set to the same value 1964 // as Product.id. * `variant`: You can only ingest Product.Type.VARIANT 1965 // Products. This means Product.primary_product_id cannot be empty. If 1966 // this field is set to an invalid value other than these, an 1967 // INVALID_ARGUMENT error is returned. If this field is `variant` and 1968 // merchant_center_product_id_field is `itemGroupId`, an 1969 // INVALID_ARGUMENT error is returned. See Using product levels 1970 // (https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels) 1971 // for more details. 1972 IngestionProductType string `json:"ingestionProductType,omitempty"` 1973 1974 // MerchantCenterProductIdField: Which field of Merchant Center Product 1975 // (/bigquery-transfer/docs/merchant-center-products-schema) should be 1976 // imported as Product.id. Acceptable values are: * `offerId` (default): 1977 // Import `offerId` as the product ID. * `itemGroupId`: Import 1978 // `itemGroupId` as the product ID. Notice that Retail API will choose 1979 // one item from the ones with the same `itemGroupId`, and use it to 1980 // represent the item group. If this field is set to an invalid value 1981 // other than these, an INVALID_ARGUMENT error is returned. If this 1982 // field is `itemGroupId` and ingestion_product_type is `variant`, an 1983 // INVALID_ARGUMENT error is returned. See Using product levels 1984 // (https://cloud.google.com/retail/recommendations-ai/docs/catalog#product-levels) 1985 // for more details. 1986 MerchantCenterProductIdField string `json:"merchantCenterProductIdField,omitempty"` 1987 1988 // ForceSendFields is a list of field names (e.g. 1989 // "IngestionProductType") to unconditionally include in API requests. 1990 // By default, fields with empty values are omitted from API requests. 1991 // However, any non-pointer, non-interface field appearing in 1992 // ForceSendFields will be sent to the server regardless of whether the 1993 // field is empty or not. This may be used to include empty fields in 1994 // Patch requests. 1995 ForceSendFields []string `json:"-"` 1996 1997 // NullFields is a list of field names (e.g. "IngestionProductType") to 1998 // include in API requests with the JSON null value. By default, fields 1999 // with empty values are omitted from API requests. However, any field 2000 // with an empty value appearing in NullFields will be sent to the 2001 // server as null. It is an error if a field in this list has a 2002 // non-empty value. This may be used to include null fields in Patch 2003 // requests. 2004 NullFields []string `json:"-"` 2005} 2006 2007func (s *GoogleCloudRetailV2alphaProductLevelConfig) MarshalJSON() ([]byte, error) { 2008 type NoMethod GoogleCloudRetailV2alphaProductLevelConfig 2009 raw := NoMethod(*s) 2010 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2011} 2012 2013// GoogleCloudRetailV2alphaPurchaseTransaction: A transaction represents 2014// the entire purchase transaction. 2015type GoogleCloudRetailV2alphaPurchaseTransaction struct { 2016 // Cost: All the costs associated with the products. These can be 2017 // manufacturing costs, shipping expenses not borne by the end user, or 2018 // any other costs, such that: * Profit = revenue - tax - cost 2019 Cost float64 `json:"cost,omitempty"` 2020 2021 // CurrencyCode: Required. Currency code. Use three-character ISO-4217 2022 // code. 2023 CurrencyCode string `json:"currencyCode,omitempty"` 2024 2025 // Id: The transaction ID with a length limit of 128 characters. 2026 Id string `json:"id,omitempty"` 2027 2028 // Revenue: Required. Total non-zero revenue or grand total associated 2029 // with the transaction. This value include shipping, tax, or other 2030 // adjustments to total revenue that you want to include as part of your 2031 // revenue calculations. 2032 Revenue float64 `json:"revenue,omitempty"` 2033 2034 // Tax: All the taxes associated with the transaction. 2035 Tax float64 `json:"tax,omitempty"` 2036 2037 // ForceSendFields is a list of field names (e.g. "Cost") to 2038 // unconditionally include in API requests. By default, fields with 2039 // empty values are omitted from API requests. However, any non-pointer, 2040 // non-interface field appearing in ForceSendFields will be sent to the 2041 // server regardless of whether the field is empty or not. This may be 2042 // used to include empty fields in Patch requests. 2043 ForceSendFields []string `json:"-"` 2044 2045 // NullFields is a list of field names (e.g. "Cost") to include in API 2046 // requests with the JSON null value. By default, fields with empty 2047 // values are omitted from API requests. However, any field with an 2048 // empty value appearing in NullFields will be sent to the server as 2049 // null. It is an error if a field in this list has a non-empty value. 2050 // This may be used to include null fields in Patch requests. 2051 NullFields []string `json:"-"` 2052} 2053 2054func (s *GoogleCloudRetailV2alphaPurchaseTransaction) MarshalJSON() ([]byte, error) { 2055 type NoMethod GoogleCloudRetailV2alphaPurchaseTransaction 2056 raw := NoMethod(*s) 2057 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2058} 2059 2060func (s *GoogleCloudRetailV2alphaPurchaseTransaction) UnmarshalJSON(data []byte) error { 2061 type NoMethod GoogleCloudRetailV2alphaPurchaseTransaction 2062 var s1 struct { 2063 Cost gensupport.JSONFloat64 `json:"cost"` 2064 Revenue gensupport.JSONFloat64 `json:"revenue"` 2065 Tax gensupport.JSONFloat64 `json:"tax"` 2066 *NoMethod 2067 } 2068 s1.NoMethod = (*NoMethod)(s) 2069 if err := json.Unmarshal(data, &s1); err != nil { 2070 return err 2071 } 2072 s.Cost = float64(s1.Cost) 2073 s.Revenue = float64(s1.Revenue) 2074 s.Tax = float64(s1.Tax) 2075 return nil 2076} 2077 2078// GoogleCloudRetailV2alphaPurgeMetadata: Metadata related to the 2079// progress of the Purge operation. This will be returned by the 2080// google.longrunning.Operation.metadata field. 2081type GoogleCloudRetailV2alphaPurgeMetadata struct { 2082} 2083 2084// GoogleCloudRetailV2alphaPurgeUserEventsRequest: Request message for 2085// PurgeUserEvents method. 2086type GoogleCloudRetailV2alphaPurgeUserEventsRequest struct { 2087 // Filter: Required. The filter string to specify the events to be 2088 // deleted with a length limit of 5,000 characters. Empty string filter 2089 // is not allowed. The eligible fields for filtering are: * `eventType`: 2090 // Double quoted UserEvent.event_type string. * `eventTime`: in ISO 8601 2091 // "zulu" format. * `visitorId`: Double quoted string. Specifying this 2092 // will delete all events associated with a visitor. * `userId`: Double 2093 // quoted string. Specifying this will delete all events associated with 2094 // a user. Examples: * Deleting all events in a time range: `eventTime > 2095 // "2012-04-23T18:25:43.511Z" eventTime < "2012-04-23T18:30:43.511Z" * 2096 // Deleting specific eventType in time range: `eventTime > 2097 // "2012-04-23T18:25:43.511Z" eventType = "detail-page-view" * Deleting 2098 // all events for a specific visitor: `visitorId = "visitor1024" The 2099 // filtering fields are assumed to have an implicit AND. 2100 Filter string `json:"filter,omitempty"` 2101 2102 // Force: Actually perform the purge. If `force` is set to false, the 2103 // method will return the expected purge count without deleting any user 2104 // events. 2105 Force bool `json:"force,omitempty"` 2106 2107 // ForceSendFields is a list of field names (e.g. "Filter") to 2108 // unconditionally include in API requests. By default, fields with 2109 // empty values are omitted from API requests. However, any non-pointer, 2110 // non-interface field appearing in ForceSendFields will be sent to the 2111 // server regardless of whether the field is empty or not. This may be 2112 // used to include empty fields in Patch requests. 2113 ForceSendFields []string `json:"-"` 2114 2115 // NullFields is a list of field names (e.g. "Filter") to include in API 2116 // requests with the JSON null value. By default, fields with empty 2117 // values are omitted from API requests. However, any field with an 2118 // empty value appearing in NullFields will be sent to the server as 2119 // null. It is an error if a field in this list has a non-empty value. 2120 // This may be used to include null fields in Patch requests. 2121 NullFields []string `json:"-"` 2122} 2123 2124func (s *GoogleCloudRetailV2alphaPurgeUserEventsRequest) MarshalJSON() ([]byte, error) { 2125 type NoMethod GoogleCloudRetailV2alphaPurgeUserEventsRequest 2126 raw := NoMethod(*s) 2127 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2128} 2129 2130// GoogleCloudRetailV2alphaPurgeUserEventsResponse: Response of the 2131// PurgeUserEventsRequest. If the long running operation is successfully 2132// done, then this message is returned by the 2133// google.longrunning.Operations.response field. 2134type GoogleCloudRetailV2alphaPurgeUserEventsResponse struct { 2135 // PurgedEventsCount: The total count of events purged as a result of 2136 // the operation. 2137 PurgedEventsCount int64 `json:"purgedEventsCount,omitempty,string"` 2138 2139 // ForceSendFields is a list of field names (e.g. "PurgedEventsCount") 2140 // to unconditionally include in API requests. By default, fields with 2141 // empty values are omitted from API requests. However, any non-pointer, 2142 // non-interface field appearing in ForceSendFields will be sent to the 2143 // server regardless of whether the field is empty or not. This may be 2144 // used to include empty fields in Patch requests. 2145 ForceSendFields []string `json:"-"` 2146 2147 // NullFields is a list of field names (e.g. "PurgedEventsCount") to 2148 // include in API requests with the JSON null value. By default, fields 2149 // with empty values are omitted from API requests. However, any field 2150 // with an empty value appearing in NullFields will be sent to the 2151 // server as null. It is an error if a field in this list has a 2152 // non-empty value. This may be used to include null fields in Patch 2153 // requests. 2154 NullFields []string `json:"-"` 2155} 2156 2157func (s *GoogleCloudRetailV2alphaPurgeUserEventsResponse) MarshalJSON() ([]byte, error) { 2158 type NoMethod GoogleCloudRetailV2alphaPurgeUserEventsResponse 2159 raw := NoMethod(*s) 2160 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2161} 2162 2163// GoogleCloudRetailV2alphaRejoinUserEventsMetadata: Metadata for 2164// RejoinUserEvents method. 2165type GoogleCloudRetailV2alphaRejoinUserEventsMetadata struct { 2166} 2167 2168// GoogleCloudRetailV2alphaRejoinUserEventsRequest: Request message for 2169// RejoinUserEvents method. 2170type GoogleCloudRetailV2alphaRejoinUserEventsRequest struct { 2171 // UserEventRejoinScope: The type of the user event rejoin to define the 2172 // scope and range of the user events to be rejoined with the latest 2173 // product catalog. Defaults to USER_EVENT_REJOIN_SCOPE_UNSPECIFIED if 2174 // this field is not set, or set to an invalid integer value. 2175 // 2176 // Possible values: 2177 // "USER_EVENT_REJOIN_SCOPE_UNSPECIFIED" - Rejoin all events with the 2178 // latest product catalog, including both joined events and unjoined 2179 // events. 2180 // "JOINED_EVENTS" - Only rejoin joined events with the latest product 2181 // catalog. 2182 // "UNJOINED_EVENTS" - Only rejoin unjoined events with the latest 2183 // product catalog. 2184 UserEventRejoinScope string `json:"userEventRejoinScope,omitempty"` 2185 2186 // ForceSendFields is a list of field names (e.g. 2187 // "UserEventRejoinScope") to unconditionally include in API requests. 2188 // By default, fields with empty values are omitted from API requests. 2189 // However, any non-pointer, non-interface field appearing in 2190 // ForceSendFields will be sent to the server regardless of whether the 2191 // field is empty or not. This may be used to include empty fields in 2192 // Patch requests. 2193 ForceSendFields []string `json:"-"` 2194 2195 // NullFields is a list of field names (e.g. "UserEventRejoinScope") to 2196 // include in API requests with the JSON null value. By default, fields 2197 // with empty values are omitted from API requests. However, any field 2198 // with an empty value appearing in NullFields will be sent to the 2199 // server as null. It is an error if a field in this list has a 2200 // non-empty value. This may be used to include null fields in Patch 2201 // requests. 2202 NullFields []string `json:"-"` 2203} 2204 2205func (s *GoogleCloudRetailV2alphaRejoinUserEventsRequest) MarshalJSON() ([]byte, error) { 2206 type NoMethod GoogleCloudRetailV2alphaRejoinUserEventsRequest 2207 raw := NoMethod(*s) 2208 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2209} 2210 2211// GoogleCloudRetailV2alphaRejoinUserEventsResponse: Response message 2212// for RejoinUserEvents method. 2213type GoogleCloudRetailV2alphaRejoinUserEventsResponse struct { 2214 // RejoinedUserEventsCount: Number of user events that were joined with 2215 // latest product catalog. 2216 RejoinedUserEventsCount int64 `json:"rejoinedUserEventsCount,omitempty,string"` 2217 2218 // ForceSendFields is a list of field names (e.g. 2219 // "RejoinedUserEventsCount") to unconditionally include in API 2220 // requests. By default, fields with empty values are omitted from API 2221 // requests. However, any non-pointer, non-interface field appearing in 2222 // ForceSendFields will be sent to the server regardless of whether the 2223 // field is empty or not. This may be used to include empty fields in 2224 // Patch requests. 2225 ForceSendFields []string `json:"-"` 2226 2227 // NullFields is a list of field names (e.g. "RejoinedUserEventsCount") 2228 // to include in API requests with the JSON null value. By default, 2229 // fields with empty values are omitted from API requests. However, any 2230 // field with an empty value appearing in NullFields will be sent to the 2231 // server as null. It is an error if a field in this list has a 2232 // non-empty value. This may be used to include null fields in Patch 2233 // requests. 2234 NullFields []string `json:"-"` 2235} 2236 2237func (s *GoogleCloudRetailV2alphaRejoinUserEventsResponse) MarshalJSON() ([]byte, error) { 2238 type NoMethod GoogleCloudRetailV2alphaRejoinUserEventsResponse 2239 raw := NoMethod(*s) 2240 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2241} 2242 2243// GoogleCloudRetailV2alphaUserEvent: UserEvent captures all metadata 2244// information Retail API needs to know about how end users interact 2245// with customers' website. 2246type GoogleCloudRetailV2alphaUserEvent struct { 2247 // Attributes: Extra user event features to include in the 2248 // recommendation model. The key must be a UTF-8 encoded string with a 2249 // length limit of 5,000 characters. Otherwise, an INVALID_ARGUMENT 2250 // error is returned. For product recommendation, an example of extra 2251 // user information is traffic_channel, i.e. how user arrives at the 2252 // site. Users can arrive at the site by coming to the site directly, or 2253 // coming through Google search, and etc. 2254 Attributes map[string]GoogleCloudRetailV2alphaCustomAttribute `json:"attributes,omitempty"` 2255 2256 // AttributionToken: Highly recommended for user events that are the 2257 // result of PredictionService.Predict. This field enables accurate 2258 // attribution of recommendation model performance. The value must be a 2259 // valid PredictResponse.attribution_token for user events that are the 2260 // result of PredictionService.Predict. This token enables us to 2261 // accurately attribute page view or purchase back to the event and the 2262 // particular predict response containing this clicked/purchased 2263 // product. If user clicks on product K in the recommendation results, 2264 // pass PredictResponse.attribution_token as a URL parameter to product 2265 // K's page. When recording events on product K's page, log the 2266 // PredictResponse.attribution_token to this field. 2267 AttributionToken string `json:"attributionToken,omitempty"` 2268 2269 // CartId: The id or name of the associated shopping cart. This id is 2270 // used to associate multiple items added or present in the cart before 2271 // purchase. This can only be set for `add-to-cart`, 2272 // `purchase-complete`, or `shopping-cart-page-view` events. 2273 CartId string `json:"cartId,omitempty"` 2274 2275 // EventTime: Only required for UserEventService.ImportUserEvents 2276 // method. Timestamp of when the user event happened. 2277 EventTime string `json:"eventTime,omitempty"` 2278 2279 // EventType: Required. User event type. Allowed values are: * 2280 // `add-to-cart`: Products being added to cart. * `category-page-view`: 2281 // Special pages such as sale or promotion pages viewed. * 2282 // `detail-page-view`: Products detail page viewed. * `home-page-view`: 2283 // Homepage viewed. * `promotion-offered`: Promotion is offered to a 2284 // user. * `promotion-not-offered`: Promotion is not offered to a user. 2285 // * `purchase-complete`: User finishing a purchase. * `search`: Product 2286 // search. * `shopping-cart-page-view`: User viewing a shopping cart. 2287 EventType string `json:"eventType,omitempty"` 2288 2289 // ExperimentIds: A list of identifiers for the independent experiment 2290 // groups this user event belongs to. This is used to distinguish 2291 // between user events associated with different experiment setups (e.g. 2292 // using Retail API, using different recommendation models). 2293 ExperimentIds []string `json:"experimentIds,omitempty"` 2294 2295 // PageCategories: The categories associated with a category page. To 2296 // represent full path of category, use '>' sign to separate different 2297 // hierarchies. If '>' is part of the category name, please replace it 2298 // with other character(s). Category pages include special pages such as 2299 // sales or promotions. For instance, a special sale page may have the 2300 // category hierarchy: "pageCategories" : ["Sales > 2017 Black Friday 2301 // Deals"]. Required for `category-page-view` events. At least one of 2302 // search_query or page_categories is required for `search` events. 2303 // Other event types should not set this field. Otherwise, an 2304 // INVALID_ARGUMENT error is returned. 2305 PageCategories []string `json:"pageCategories,omitempty"` 2306 2307 // PageViewId: A unique id of a web page view. This should be kept the 2308 // same for all user events triggered from the same pageview. For 2309 // example, an item detail page view could trigger multiple events as 2310 // the user is browsing the page. The `pageViewId` property should be 2311 // kept the same for all these events so that they can be grouped 2312 // together properly. When using the client side event reporting with 2313 // JavaScript pixel and Google Tag Manager, this value is filled in 2314 // automatically. 2315 PageViewId string `json:"pageViewId,omitempty"` 2316 2317 // ProductDetails: The main product details related to the event. This 2318 // field is required for the following event types: * `add-to-cart` * 2319 // `detail-page-view` * `purchase-complete` In a `search` event, this 2320 // field represents the products returned to the end user on the current 2321 // page (the end user may have not finished broswing the whole page 2322 // yet). When a new page is returned to the end user, after 2323 // pagination/filtering/ordering even for the same query, a new `search` 2324 // event with different product_details is desired. The end user may 2325 // have not finished broswing the whole page yet. 2326 ProductDetails []*GoogleCloudRetailV2alphaProductDetail `json:"productDetails,omitempty"` 2327 2328 // PurchaseTransaction: A transaction represents the entire purchase 2329 // transaction. Required for `purchase-complete` events. Other event 2330 // types should not set this field. Otherwise, an INVALID_ARGUMENT error 2331 // is returned. 2332 PurchaseTransaction *GoogleCloudRetailV2alphaPurchaseTransaction `json:"purchaseTransaction,omitempty"` 2333 2334 // ReferrerUri: The referrer URL of the current page. When using the 2335 // client side event reporting with JavaScript pixel and Google Tag 2336 // Manager, this value is filled in automatically. 2337 ReferrerUri string `json:"referrerUri,omitempty"` 2338 2339 // SearchQuery: The user's search query. The value must be a UTF-8 2340 // encoded string with a length limit of 5,000 characters. Otherwise, an 2341 // INVALID_ARGUMENT error is returned. At least one of search_query or 2342 // page_categories is required for `search` events. Other event types 2343 // should not set this field. Otherwise, an INVALID_ARGUMENT error is 2344 // returned. 2345 SearchQuery string `json:"searchQuery,omitempty"` 2346 2347 // Uri: Complete URL (window.location.href) of the user's current page. 2348 // When using the client side event reporting with JavaScript pixel and 2349 // Google Tag Manager, this value is filled in automatically. Maximum 2350 // length 5,000 characters. 2351 Uri string `json:"uri,omitempty"` 2352 2353 // UserInfo: User information. 2354 UserInfo *GoogleCloudRetailV2alphaUserInfo `json:"userInfo,omitempty"` 2355 2356 // VisitorId: Required. A unique identifier for tracking visitors. For 2357 // example, this could be implemented with an HTTP cookie, which should 2358 // be able to uniquely identify a visitor on a single device. This 2359 // unique identifier should not change if the visitor log in/out of the 2360 // website. The field must be a UTF-8 encoded string with a length limit 2361 // of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. 2362 VisitorId string `json:"visitorId,omitempty"` 2363 2364 // ServerResponse contains the HTTP response code and headers from the 2365 // server. 2366 googleapi.ServerResponse `json:"-"` 2367 2368 // ForceSendFields is a list of field names (e.g. "Attributes") to 2369 // unconditionally include in API requests. By default, fields with 2370 // empty values are omitted from API requests. However, any non-pointer, 2371 // non-interface field appearing in ForceSendFields will be sent to the 2372 // server regardless of whether the field is empty or not. This may be 2373 // used to include empty fields in Patch requests. 2374 ForceSendFields []string `json:"-"` 2375 2376 // NullFields is a list of field names (e.g. "Attributes") to include in 2377 // API requests with the JSON null value. By default, fields with empty 2378 // values are omitted from API requests. However, any field with an 2379 // empty value appearing in NullFields will be sent to the server as 2380 // null. It is an error if a field in this list has a non-empty value. 2381 // This may be used to include null fields in Patch requests. 2382 NullFields []string `json:"-"` 2383} 2384 2385func (s *GoogleCloudRetailV2alphaUserEvent) MarshalJSON() ([]byte, error) { 2386 type NoMethod GoogleCloudRetailV2alphaUserEvent 2387 raw := NoMethod(*s) 2388 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2389} 2390 2391// GoogleCloudRetailV2alphaUserEventImportSummary: A summary of import 2392// result. The UserEventImportSummary summarizes the import status for 2393// user events. 2394type GoogleCloudRetailV2alphaUserEventImportSummary struct { 2395 // JoinedEventsCount: Count of user events imported with complete 2396 // existing catalog information. 2397 JoinedEventsCount int64 `json:"joinedEventsCount,omitempty,string"` 2398 2399 // UnjoinedEventsCount: Count of user events imported, but with catalog 2400 // information not found in the imported catalog. 2401 UnjoinedEventsCount int64 `json:"unjoinedEventsCount,omitempty,string"` 2402 2403 // ForceSendFields is a list of field names (e.g. "JoinedEventsCount") 2404 // to unconditionally include in API requests. By default, fields with 2405 // empty values are omitted from API requests. However, any non-pointer, 2406 // non-interface field appearing in ForceSendFields will be sent to the 2407 // server regardless of whether the field is empty or not. This may be 2408 // used to include empty fields in Patch requests. 2409 ForceSendFields []string `json:"-"` 2410 2411 // NullFields is a list of field names (e.g. "JoinedEventsCount") to 2412 // include in API requests with the JSON null value. By default, fields 2413 // with empty values are omitted from API requests. However, any field 2414 // with an empty value appearing in NullFields will be sent to the 2415 // server as null. It is an error if a field in this list has a 2416 // non-empty value. This may be used to include null fields in Patch 2417 // requests. 2418 NullFields []string `json:"-"` 2419} 2420 2421func (s *GoogleCloudRetailV2alphaUserEventImportSummary) MarshalJSON() ([]byte, error) { 2422 type NoMethod GoogleCloudRetailV2alphaUserEventImportSummary 2423 raw := NoMethod(*s) 2424 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2425} 2426 2427// GoogleCloudRetailV2alphaUserEventInlineSource: The inline source for 2428// the input config for ImportUserEvents method. 2429type GoogleCloudRetailV2alphaUserEventInlineSource struct { 2430 // UserEvents: Required. A list of user events to import. Recommended 2431 // max of 10k items. 2432 UserEvents []*GoogleCloudRetailV2alphaUserEvent `json:"userEvents,omitempty"` 2433 2434 // ForceSendFields is a list of field names (e.g. "UserEvents") to 2435 // unconditionally include in API requests. By default, fields with 2436 // empty values are omitted from API requests. However, any non-pointer, 2437 // non-interface field appearing in ForceSendFields will be sent to the 2438 // server regardless of whether the field is empty or not. This may be 2439 // used to include empty fields in Patch requests. 2440 ForceSendFields []string `json:"-"` 2441 2442 // NullFields is a list of field names (e.g. "UserEvents") to include in 2443 // API requests with the JSON null value. By default, fields with empty 2444 // values are omitted from API requests. However, any field with an 2445 // empty value appearing in NullFields will be sent to the server as 2446 // null. It is an error if a field in this list has a non-empty value. 2447 // This may be used to include null fields in Patch requests. 2448 NullFields []string `json:"-"` 2449} 2450 2451func (s *GoogleCloudRetailV2alphaUserEventInlineSource) MarshalJSON() ([]byte, error) { 2452 type NoMethod GoogleCloudRetailV2alphaUserEventInlineSource 2453 raw := NoMethod(*s) 2454 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2455} 2456 2457// GoogleCloudRetailV2alphaUserEventInputConfig: The input config source 2458// for user events. 2459type GoogleCloudRetailV2alphaUserEventInputConfig struct { 2460 // BigQuerySource: Required. BigQuery input source. 2461 BigQuerySource *GoogleCloudRetailV2alphaBigQuerySource `json:"bigQuerySource,omitempty"` 2462 2463 // GcsSource: Required. Google Cloud Storage location for the input 2464 // content. 2465 GcsSource *GoogleCloudRetailV2alphaGcsSource `json:"gcsSource,omitempty"` 2466 2467 // UserEventInlineSource: Required. The Inline source for the input 2468 // content for UserEvents. 2469 UserEventInlineSource *GoogleCloudRetailV2alphaUserEventInlineSource `json:"userEventInlineSource,omitempty"` 2470 2471 // ForceSendFields is a list of field names (e.g. "BigQuerySource") to 2472 // unconditionally include in API requests. By default, fields with 2473 // empty values are omitted from API requests. However, any non-pointer, 2474 // non-interface field appearing in ForceSendFields will be sent to the 2475 // server regardless of whether the field is empty or not. This may be 2476 // used to include empty fields in Patch requests. 2477 ForceSendFields []string `json:"-"` 2478 2479 // NullFields is a list of field names (e.g. "BigQuerySource") to 2480 // include in API requests with the JSON null value. By default, fields 2481 // with empty values are omitted from API requests. However, any field 2482 // with an empty value appearing in NullFields will be sent to the 2483 // server as null. It is an error if a field in this list has a 2484 // non-empty value. This may be used to include null fields in Patch 2485 // requests. 2486 NullFields []string `json:"-"` 2487} 2488 2489func (s *GoogleCloudRetailV2alphaUserEventInputConfig) MarshalJSON() ([]byte, error) { 2490 type NoMethod GoogleCloudRetailV2alphaUserEventInputConfig 2491 raw := NoMethod(*s) 2492 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2493} 2494 2495// GoogleCloudRetailV2alphaUserInfo: Information of an end user. 2496type GoogleCloudRetailV2alphaUserInfo struct { 2497 // DirectUserRequest: True if the request is made directly from the end 2498 // user, in which case the ip_address and user_agent can be populated 2499 // from the HTTP request. This flag should be set only if the API 2500 // request is made directly from the end user such as a mobile app (and 2501 // not if a gateway or a server is processing and pushing the user 2502 // events). This should not be set when using the JavaScript tag in 2503 // UserEventService.CollectUserEvent. 2504 DirectUserRequest bool `json:"directUserRequest,omitempty"` 2505 2506 // IpAddress: The end user's IP address. This field is used to extract 2507 // location information for personalization. This field must be either 2508 // an IPv4 address (e.g. "104.133.9.80") or an IPv6 address (e.g. 2509 // "2001:0db8:85a3:0000:0000:8a2e:0370:7334"). Otherwise, an 2510 // INVALID_ARGUMENT error is returned. This should not be set when using 2511 // the JavaScript tag in UserEventService.CollectUserEvent or if 2512 // direct_user_request is set. 2513 IpAddress string `json:"ipAddress,omitempty"` 2514 2515 // UserAgent: User agent as included in the HTTP header. The field must 2516 // be a UTF-8 encoded string with a length limit of 1,000 characters. 2517 // Otherwise, an INVALID_ARGUMENT error is returned. This should not be 2518 // set when using the client side event reporting with GTM or JavaScript 2519 // tag in UserEventService.CollectUserEvent or if direct_user_request is 2520 // set. 2521 UserAgent string `json:"userAgent,omitempty"` 2522 2523 // UserId: Highly recommended for logged-in users. Unique identifier for 2524 // logged-in user, such as a user name. The field must be a UTF-8 2525 // encoded string with a length limit of 128 characters. Otherwise, an 2526 // INVALID_ARGUMENT error is returned. 2527 UserId string `json:"userId,omitempty"` 2528 2529 // ForceSendFields is a list of field names (e.g. "DirectUserRequest") 2530 // to unconditionally include in API requests. By default, fields with 2531 // empty values are omitted from API requests. However, any non-pointer, 2532 // non-interface field appearing in ForceSendFields will be sent to the 2533 // server regardless of whether the field is empty or not. This may be 2534 // used to include empty fields in Patch requests. 2535 ForceSendFields []string `json:"-"` 2536 2537 // NullFields is a list of field names (e.g. "DirectUserRequest") to 2538 // include in API requests with the JSON null value. By default, fields 2539 // with empty values are omitted from API requests. However, any field 2540 // with an empty value appearing in NullFields will be sent to the 2541 // server as null. It is an error if a field in this list has a 2542 // non-empty value. This may be used to include null fields in Patch 2543 // requests. 2544 NullFields []string `json:"-"` 2545} 2546 2547func (s *GoogleCloudRetailV2alphaUserInfo) MarshalJSON() ([]byte, error) { 2548 type NoMethod GoogleCloudRetailV2alphaUserInfo 2549 raw := NoMethod(*s) 2550 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2551} 2552 2553// GoogleCloudRetailV2betaExportErrorsConfig: Configuration of 2554// destination for Export related errors. 2555type GoogleCloudRetailV2betaExportErrorsConfig struct { 2556 // GcsPrefix: Google Cloud Storage path for import errors. This must be 2557 // an empty, existing Cloud Storage bucket. Export errors will be 2558 // written to a file in this bucket, one per line, as a JSON-encoded 2559 // `google.rpc.Status` message. 2560 GcsPrefix string `json:"gcsPrefix,omitempty"` 2561 2562 // ForceSendFields is a list of field names (e.g. "GcsPrefix") to 2563 // unconditionally include in API requests. By default, fields with 2564 // empty values are omitted from API requests. However, any non-pointer, 2565 // non-interface field appearing in ForceSendFields will be sent to the 2566 // server regardless of whether the field is empty or not. This may be 2567 // used to include empty fields in Patch requests. 2568 ForceSendFields []string `json:"-"` 2569 2570 // NullFields is a list of field names (e.g. "GcsPrefix") to include in 2571 // API requests with the JSON null value. By default, fields with empty 2572 // values are omitted from API requests. However, any field with an 2573 // empty value appearing in NullFields will be sent to the server as 2574 // null. It is an error if a field in this list has a non-empty value. 2575 // This may be used to include null fields in Patch requests. 2576 NullFields []string `json:"-"` 2577} 2578 2579func (s *GoogleCloudRetailV2betaExportErrorsConfig) MarshalJSON() ([]byte, error) { 2580 type NoMethod GoogleCloudRetailV2betaExportErrorsConfig 2581 raw := NoMethod(*s) 2582 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2583} 2584 2585// GoogleCloudRetailV2betaExportMetadata: Metadata related to the 2586// progress of the Export operation. This will be returned by the 2587// google.longrunning.Operation.metadata field. 2588type GoogleCloudRetailV2betaExportMetadata struct { 2589 // CreateTime: Operation create time. 2590 CreateTime string `json:"createTime,omitempty"` 2591 2592 // UpdateTime: Operation last update time. If the operation is done, 2593 // this is also the finish time. 2594 UpdateTime string `json:"updateTime,omitempty"` 2595 2596 // ForceSendFields is a list of field names (e.g. "CreateTime") to 2597 // unconditionally include in API requests. By default, fields with 2598 // empty values are omitted from API requests. However, any non-pointer, 2599 // non-interface field appearing in ForceSendFields will be sent to the 2600 // server regardless of whether the field is empty or not. This may be 2601 // used to include empty fields in Patch requests. 2602 ForceSendFields []string `json:"-"` 2603 2604 // NullFields is a list of field names (e.g. "CreateTime") to include in 2605 // API requests with the JSON null value. By default, fields with empty 2606 // values are omitted from API requests. However, any field with an 2607 // empty value appearing in NullFields will be sent to the server as 2608 // null. It is an error if a field in this list has a non-empty value. 2609 // This may be used to include null fields in Patch requests. 2610 NullFields []string `json:"-"` 2611} 2612 2613func (s *GoogleCloudRetailV2betaExportMetadata) MarshalJSON() ([]byte, error) { 2614 type NoMethod GoogleCloudRetailV2betaExportMetadata 2615 raw := NoMethod(*s) 2616 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2617} 2618 2619// GoogleCloudRetailV2betaExportProductsResponse: Response of the 2620// ExportProductsRequest. If the long running operation is done, then 2621// this message is returned by the 2622// google.longrunning.Operations.response field if the operation was 2623// successful. 2624type GoogleCloudRetailV2betaExportProductsResponse struct { 2625 // ErrorSamples: A sample of errors encountered while processing the 2626 // request. 2627 ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` 2628 2629 // ErrorsConfig: Echoes the destination for the complete errors in the 2630 // request if set. 2631 ErrorsConfig *GoogleCloudRetailV2betaExportErrorsConfig `json:"errorsConfig,omitempty"` 2632 2633 // ForceSendFields is a list of field names (e.g. "ErrorSamples") to 2634 // unconditionally include in API requests. By default, fields with 2635 // empty values are omitted from API requests. However, any non-pointer, 2636 // non-interface field appearing in ForceSendFields will be sent to the 2637 // server regardless of whether the field is empty or not. This may be 2638 // used to include empty fields in Patch requests. 2639 ForceSendFields []string `json:"-"` 2640 2641 // NullFields is a list of field names (e.g. "ErrorSamples") to include 2642 // in API requests with the JSON null value. By default, fields with 2643 // empty values are omitted from API requests. However, any field with 2644 // an empty value appearing in NullFields will be sent to the server as 2645 // null. It is an error if a field in this list has a non-empty value. 2646 // This may be used to include null fields in Patch requests. 2647 NullFields []string `json:"-"` 2648} 2649 2650func (s *GoogleCloudRetailV2betaExportProductsResponse) MarshalJSON() ([]byte, error) { 2651 type NoMethod GoogleCloudRetailV2betaExportProductsResponse 2652 raw := NoMethod(*s) 2653 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2654} 2655 2656// GoogleCloudRetailV2betaExportUserEventsResponse: Response of the 2657// ExportUserEventsRequest. If the long running operation was 2658// successful, then this message is returned by the 2659// google.longrunning.Operations.response field if the operation was 2660// successful. 2661type GoogleCloudRetailV2betaExportUserEventsResponse struct { 2662 // ErrorSamples: A sample of errors encountered while processing the 2663 // request. 2664 ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` 2665 2666 // ErrorsConfig: Echoes the destination for the complete errors if this 2667 // field was set in the request. 2668 ErrorsConfig *GoogleCloudRetailV2betaExportErrorsConfig `json:"errorsConfig,omitempty"` 2669 2670 // ForceSendFields is a list of field names (e.g. "ErrorSamples") to 2671 // unconditionally include in API requests. By default, fields with 2672 // empty values are omitted from API requests. However, any non-pointer, 2673 // non-interface field appearing in ForceSendFields will be sent to the 2674 // server regardless of whether the field is empty or not. This may be 2675 // used to include empty fields in Patch requests. 2676 ForceSendFields []string `json:"-"` 2677 2678 // NullFields is a list of field names (e.g. "ErrorSamples") to include 2679 // in API requests with the JSON null value. By default, fields with 2680 // empty values are omitted from API requests. However, any field with 2681 // an empty value appearing in NullFields will be sent to the server as 2682 // null. It is an error if a field in this list has a non-empty value. 2683 // This may be used to include null fields in Patch requests. 2684 NullFields []string `json:"-"` 2685} 2686 2687func (s *GoogleCloudRetailV2betaExportUserEventsResponse) MarshalJSON() ([]byte, error) { 2688 type NoMethod GoogleCloudRetailV2betaExportUserEventsResponse 2689 raw := NoMethod(*s) 2690 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2691} 2692 2693// GoogleCloudRetailV2betaImportErrorsConfig: Configuration of 2694// destination for Import related errors. 2695type GoogleCloudRetailV2betaImportErrorsConfig struct { 2696 // GcsPrefix: Google Cloud Storage path for import errors. This must be 2697 // an empty, existing Cloud Storage bucket. Import errors will be 2698 // written to a file in this bucket, one per line, as a JSON-encoded 2699 // `google.rpc.Status` message. 2700 GcsPrefix string `json:"gcsPrefix,omitempty"` 2701 2702 // ForceSendFields is a list of field names (e.g. "GcsPrefix") to 2703 // unconditionally include in API requests. By default, fields with 2704 // empty values are omitted from API requests. However, any non-pointer, 2705 // non-interface field appearing in ForceSendFields will be sent to the 2706 // server regardless of whether the field is empty or not. This may be 2707 // used to include empty fields in Patch requests. 2708 ForceSendFields []string `json:"-"` 2709 2710 // NullFields is a list of field names (e.g. "GcsPrefix") to include in 2711 // API requests with the JSON null value. By default, fields with empty 2712 // values are omitted from API requests. However, any field with an 2713 // empty value appearing in NullFields will be sent to the server as 2714 // null. It is an error if a field in this list has a non-empty value. 2715 // This may be used to include null fields in Patch requests. 2716 NullFields []string `json:"-"` 2717} 2718 2719func (s *GoogleCloudRetailV2betaImportErrorsConfig) MarshalJSON() ([]byte, error) { 2720 type NoMethod GoogleCloudRetailV2betaImportErrorsConfig 2721 raw := NoMethod(*s) 2722 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2723} 2724 2725// GoogleCloudRetailV2betaImportMetadata: Metadata related to the 2726// progress of the Import operation. This will be returned by the 2727// google.longrunning.Operation.metadata field. 2728type GoogleCloudRetailV2betaImportMetadata struct { 2729 // CreateTime: Operation create time. 2730 CreateTime string `json:"createTime,omitempty"` 2731 2732 // FailureCount: Count of entries that encountered errors while 2733 // processing. 2734 FailureCount int64 `json:"failureCount,omitempty,string"` 2735 2736 // SuccessCount: Count of entries that were processed successfully. 2737 SuccessCount int64 `json:"successCount,omitempty,string"` 2738 2739 // UpdateTime: Operation last update time. If the operation is done, 2740 // this is also the finish time. 2741 UpdateTime string `json:"updateTime,omitempty"` 2742 2743 // ForceSendFields is a list of field names (e.g. "CreateTime") to 2744 // unconditionally include in API requests. By default, fields with 2745 // empty values are omitted from API requests. However, any non-pointer, 2746 // non-interface field appearing in ForceSendFields will be sent to the 2747 // server regardless of whether the field is empty or not. This may be 2748 // used to include empty fields in Patch requests. 2749 ForceSendFields []string `json:"-"` 2750 2751 // NullFields is a list of field names (e.g. "CreateTime") to include in 2752 // API requests with the JSON null value. By default, fields with empty 2753 // values are omitted from API requests. However, any field with an 2754 // empty value appearing in NullFields will be sent to the server as 2755 // null. It is an error if a field in this list has a non-empty value. 2756 // This may be used to include null fields in Patch requests. 2757 NullFields []string `json:"-"` 2758} 2759 2760func (s *GoogleCloudRetailV2betaImportMetadata) MarshalJSON() ([]byte, error) { 2761 type NoMethod GoogleCloudRetailV2betaImportMetadata 2762 raw := NoMethod(*s) 2763 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2764} 2765 2766// GoogleCloudRetailV2betaImportProductsResponse: Response of the 2767// ImportProductsRequest. If the long running operation is done, then 2768// this message is returned by the 2769// google.longrunning.Operations.response field if the operation was 2770// successful. 2771type GoogleCloudRetailV2betaImportProductsResponse struct { 2772 // ErrorSamples: A sample of errors encountered while processing the 2773 // request. 2774 ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` 2775 2776 // ErrorsConfig: Echoes the destination for the complete errors in the 2777 // request if set. 2778 ErrorsConfig *GoogleCloudRetailV2betaImportErrorsConfig `json:"errorsConfig,omitempty"` 2779 2780 // ForceSendFields is a list of field names (e.g. "ErrorSamples") to 2781 // unconditionally include in API requests. By default, fields with 2782 // empty values are omitted from API requests. However, any non-pointer, 2783 // non-interface field appearing in ForceSendFields will be sent to the 2784 // server regardless of whether the field is empty or not. This may be 2785 // used to include empty fields in Patch requests. 2786 ForceSendFields []string `json:"-"` 2787 2788 // NullFields is a list of field names (e.g. "ErrorSamples") to include 2789 // in API requests with the JSON null value. By default, fields with 2790 // empty values are omitted from API requests. However, any field with 2791 // an empty value appearing in NullFields will be sent to the server as 2792 // null. It is an error if a field in this list has a non-empty value. 2793 // This may be used to include null fields in Patch requests. 2794 NullFields []string `json:"-"` 2795} 2796 2797func (s *GoogleCloudRetailV2betaImportProductsResponse) MarshalJSON() ([]byte, error) { 2798 type NoMethod GoogleCloudRetailV2betaImportProductsResponse 2799 raw := NoMethod(*s) 2800 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2801} 2802 2803// GoogleCloudRetailV2betaImportUserEventsResponse: Response of the 2804// ImportUserEventsRequest. If the long running operation was 2805// successful, then this message is returned by the 2806// google.longrunning.Operations.response field if the operation was 2807// successful. 2808type GoogleCloudRetailV2betaImportUserEventsResponse struct { 2809 // ErrorSamples: A sample of errors encountered while processing the 2810 // request. 2811 ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` 2812 2813 // ErrorsConfig: Echoes the destination for the complete errors if this 2814 // field was set in the request. 2815 ErrorsConfig *GoogleCloudRetailV2betaImportErrorsConfig `json:"errorsConfig,omitempty"` 2816 2817 // ImportSummary: Aggregated statistics of user event import status. 2818 ImportSummary *GoogleCloudRetailV2betaUserEventImportSummary `json:"importSummary,omitempty"` 2819 2820 // ForceSendFields is a list of field names (e.g. "ErrorSamples") to 2821 // unconditionally include in API requests. By default, fields with 2822 // empty values are omitted from API requests. However, any non-pointer, 2823 // non-interface field appearing in ForceSendFields will be sent to the 2824 // server regardless of whether the field is empty or not. This may be 2825 // used to include empty fields in Patch requests. 2826 ForceSendFields []string `json:"-"` 2827 2828 // NullFields is a list of field names (e.g. "ErrorSamples") to include 2829 // in API requests with the JSON null value. By default, fields with 2830 // empty values are omitted from API requests. However, any field with 2831 // an empty value appearing in NullFields will be sent to the server as 2832 // null. It is an error if a field in this list has a non-empty value. 2833 // This may be used to include null fields in Patch requests. 2834 NullFields []string `json:"-"` 2835} 2836 2837func (s *GoogleCloudRetailV2betaImportUserEventsResponse) MarshalJSON() ([]byte, error) { 2838 type NoMethod GoogleCloudRetailV2betaImportUserEventsResponse 2839 raw := NoMethod(*s) 2840 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2841} 2842 2843// GoogleCloudRetailV2betaPurgeMetadata: Metadata related to the 2844// progress of the Purge operation. This will be returned by the 2845// google.longrunning.Operation.metadata field. 2846type GoogleCloudRetailV2betaPurgeMetadata struct { 2847} 2848 2849// GoogleCloudRetailV2betaPurgeUserEventsResponse: Response of the 2850// PurgeUserEventsRequest. If the long running operation is successfully 2851// done, then this message is returned by the 2852// google.longrunning.Operations.response field. 2853type GoogleCloudRetailV2betaPurgeUserEventsResponse struct { 2854 // PurgedEventsCount: The total count of events purged as a result of 2855 // the operation. 2856 PurgedEventsCount int64 `json:"purgedEventsCount,omitempty,string"` 2857 2858 // ForceSendFields is a list of field names (e.g. "PurgedEventsCount") 2859 // to unconditionally include in API requests. By default, fields with 2860 // empty values are omitted from API requests. However, any non-pointer, 2861 // non-interface field appearing in ForceSendFields will be sent to the 2862 // server regardless of whether the field is empty or not. This may be 2863 // used to include empty fields in Patch requests. 2864 ForceSendFields []string `json:"-"` 2865 2866 // NullFields is a list of field names (e.g. "PurgedEventsCount") to 2867 // include in API requests with the JSON null value. By default, fields 2868 // with empty values are omitted from API requests. However, any field 2869 // with an empty value appearing in NullFields will be sent to the 2870 // server as null. It is an error if a field in this list has a 2871 // non-empty value. This may be used to include null fields in Patch 2872 // requests. 2873 NullFields []string `json:"-"` 2874} 2875 2876func (s *GoogleCloudRetailV2betaPurgeUserEventsResponse) MarshalJSON() ([]byte, error) { 2877 type NoMethod GoogleCloudRetailV2betaPurgeUserEventsResponse 2878 raw := NoMethod(*s) 2879 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2880} 2881 2882// GoogleCloudRetailV2betaRejoinUserEventsMetadata: Metadata for 2883// RejoinUserEvents method. 2884type GoogleCloudRetailV2betaRejoinUserEventsMetadata struct { 2885} 2886 2887// GoogleCloudRetailV2betaRejoinUserEventsResponse: Response message for 2888// RejoinUserEvents method. 2889type GoogleCloudRetailV2betaRejoinUserEventsResponse struct { 2890 // RejoinedUserEventsCount: Number of user events that were joined with 2891 // latest product catalog. 2892 RejoinedUserEventsCount int64 `json:"rejoinedUserEventsCount,omitempty,string"` 2893 2894 // ForceSendFields is a list of field names (e.g. 2895 // "RejoinedUserEventsCount") to unconditionally include in API 2896 // requests. By default, fields with empty values are omitted from API 2897 // requests. However, any non-pointer, non-interface field appearing in 2898 // ForceSendFields will be sent to the server regardless of whether the 2899 // field is empty or not. This may be used to include empty fields in 2900 // Patch requests. 2901 ForceSendFields []string `json:"-"` 2902 2903 // NullFields is a list of field names (e.g. "RejoinedUserEventsCount") 2904 // to include in API requests with the JSON null value. By default, 2905 // fields with empty values are omitted from API requests. However, any 2906 // field with an empty value appearing in NullFields will be sent to the 2907 // server as null. It is an error if a field in this list has a 2908 // non-empty value. This may be used to include null fields in Patch 2909 // requests. 2910 NullFields []string `json:"-"` 2911} 2912 2913func (s *GoogleCloudRetailV2betaRejoinUserEventsResponse) MarshalJSON() ([]byte, error) { 2914 type NoMethod GoogleCloudRetailV2betaRejoinUserEventsResponse 2915 raw := NoMethod(*s) 2916 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2917} 2918 2919// GoogleCloudRetailV2betaUserEventImportSummary: A summary of import 2920// result. The UserEventImportSummary summarizes the import status for 2921// user events. 2922type GoogleCloudRetailV2betaUserEventImportSummary struct { 2923 // JoinedEventsCount: Count of user events imported with complete 2924 // existing catalog information. 2925 JoinedEventsCount int64 `json:"joinedEventsCount,omitempty,string"` 2926 2927 // UnjoinedEventsCount: Count of user events imported, but with catalog 2928 // information not found in the imported catalog. 2929 UnjoinedEventsCount int64 `json:"unjoinedEventsCount,omitempty,string"` 2930 2931 // ForceSendFields is a list of field names (e.g. "JoinedEventsCount") 2932 // to unconditionally include in API requests. By default, fields with 2933 // empty values are omitted from API requests. However, any non-pointer, 2934 // non-interface field appearing in ForceSendFields will be sent to the 2935 // server regardless of whether the field is empty or not. This may be 2936 // used to include empty fields in Patch requests. 2937 ForceSendFields []string `json:"-"` 2938 2939 // NullFields is a list of field names (e.g. "JoinedEventsCount") to 2940 // include in API requests with the JSON null value. By default, fields 2941 // with empty values are omitted from API requests. However, any field 2942 // with an empty value appearing in NullFields will be sent to the 2943 // server as null. It is an error if a field in this list has a 2944 // non-empty value. This may be used to include null fields in Patch 2945 // requests. 2946 NullFields []string `json:"-"` 2947} 2948 2949func (s *GoogleCloudRetailV2betaUserEventImportSummary) MarshalJSON() ([]byte, error) { 2950 type NoMethod GoogleCloudRetailV2betaUserEventImportSummary 2951 raw := NoMethod(*s) 2952 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2953} 2954 2955// GoogleLongrunningListOperationsResponse: The response message for 2956// Operations.ListOperations. 2957type GoogleLongrunningListOperationsResponse struct { 2958 // NextPageToken: The standard List next-page token. 2959 NextPageToken string `json:"nextPageToken,omitempty"` 2960 2961 // Operations: A list of operations that matches the specified filter in 2962 // the request. 2963 Operations []*GoogleLongrunningOperation `json:"operations,omitempty"` 2964 2965 // ServerResponse contains the HTTP response code and headers from the 2966 // server. 2967 googleapi.ServerResponse `json:"-"` 2968 2969 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 2970 // unconditionally include in API requests. By default, fields with 2971 // empty values are omitted from API requests. However, any non-pointer, 2972 // non-interface field appearing in ForceSendFields will be sent to the 2973 // server regardless of whether the field is empty or not. This may be 2974 // used to include empty fields in Patch requests. 2975 ForceSendFields []string `json:"-"` 2976 2977 // NullFields is a list of field names (e.g. "NextPageToken") to include 2978 // in API requests with the JSON null value. By default, fields with 2979 // empty values are omitted from API requests. However, any field with 2980 // an empty value appearing in NullFields will be sent to the server as 2981 // null. It is an error if a field in this list has a non-empty value. 2982 // This may be used to include null fields in Patch requests. 2983 NullFields []string `json:"-"` 2984} 2985 2986func (s *GoogleLongrunningListOperationsResponse) MarshalJSON() ([]byte, error) { 2987 type NoMethod GoogleLongrunningListOperationsResponse 2988 raw := NoMethod(*s) 2989 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2990} 2991 2992// GoogleLongrunningOperation: This resource represents a long-running 2993// operation that is the result of a network API call. 2994type GoogleLongrunningOperation struct { 2995 // Done: If the value is `false`, it means the operation is still in 2996 // progress. If `true`, the operation is completed, and either `error` 2997 // or `response` is available. 2998 Done bool `json:"done,omitempty"` 2999 3000 // Error: The error result of the operation in case of failure or 3001 // cancellation. 3002 Error *GoogleRpcStatus `json:"error,omitempty"` 3003 3004 // Metadata: Service-specific metadata associated with the operation. It 3005 // typically contains progress information and common metadata such as 3006 // create time. Some services might not provide such metadata. Any 3007 // method that returns a long-running operation should document the 3008 // metadata type, if any. 3009 Metadata googleapi.RawMessage `json:"metadata,omitempty"` 3010 3011 // Name: The server-assigned name, which is only unique within the same 3012 // service that originally returns it. If you use the default HTTP 3013 // mapping, the `name` should be a resource name ending with 3014 // `operations/{unique_id}`. 3015 Name string `json:"name,omitempty"` 3016 3017 // Response: The normal response of the operation in case of success. If 3018 // the original method returns no data on success, such as `Delete`, the 3019 // response is `google.protobuf.Empty`. If the original method is 3020 // standard `Get`/`Create`/`Update`, the response should be the 3021 // resource. For other methods, the response should have the type 3022 // `XxxResponse`, where `Xxx` is the original method name. For example, 3023 // if the original method name is `TakeSnapshot()`, the inferred 3024 // response type is `TakeSnapshotResponse`. 3025 Response googleapi.RawMessage `json:"response,omitempty"` 3026 3027 // ServerResponse contains the HTTP response code and headers from the 3028 // server. 3029 googleapi.ServerResponse `json:"-"` 3030 3031 // ForceSendFields is a list of field names (e.g. "Done") to 3032 // unconditionally include in API requests. By default, fields with 3033 // empty values are omitted from API requests. However, any non-pointer, 3034 // non-interface field appearing in ForceSendFields will be sent to the 3035 // server regardless of whether the field is empty or not. This may be 3036 // used to include empty fields in Patch requests. 3037 ForceSendFields []string `json:"-"` 3038 3039 // NullFields is a list of field names (e.g. "Done") to include in API 3040 // requests with the JSON null value. By default, fields with empty 3041 // values are omitted from API requests. However, any field with an 3042 // empty value appearing in NullFields will be sent to the server as 3043 // null. It is an error if a field in this list has a non-empty value. 3044 // This may be used to include null fields in Patch requests. 3045 NullFields []string `json:"-"` 3046} 3047 3048func (s *GoogleLongrunningOperation) MarshalJSON() ([]byte, error) { 3049 type NoMethod GoogleLongrunningOperation 3050 raw := NoMethod(*s) 3051 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3052} 3053 3054// GoogleProtobufEmpty: A generic empty message that you can re-use to 3055// avoid defining duplicated empty messages in your APIs. A typical 3056// example is to use it as the request or the response type of an API 3057// method. For instance: service Foo { rpc Bar(google.protobuf.Empty) 3058// returns (google.protobuf.Empty); } The JSON representation for 3059// `Empty` is empty JSON object `{}`. 3060type GoogleProtobufEmpty struct { 3061 // ServerResponse contains the HTTP response code and headers from the 3062 // server. 3063 googleapi.ServerResponse `json:"-"` 3064} 3065 3066// GoogleRpcStatus: The `Status` type defines a logical error model that 3067// is suitable for different programming environments, including REST 3068// APIs and RPC APIs. It is used by gRPC (https://github.com/grpc). Each 3069// `Status` message contains three pieces of data: error code, error 3070// message, and error details. You can find out more about this error 3071// model and how to work with it in the API Design Guide 3072// (https://cloud.google.com/apis/design/errors). 3073type GoogleRpcStatus struct { 3074 // Code: The status code, which should be an enum value of 3075 // google.rpc.Code. 3076 Code int64 `json:"code,omitempty"` 3077 3078 // Details: A list of messages that carry the error details. There is a 3079 // common set of message types for APIs to use. 3080 Details []googleapi.RawMessage `json:"details,omitempty"` 3081 3082 // Message: A developer-facing error message, which should be in 3083 // English. Any user-facing error message should be localized and sent 3084 // in the google.rpc.Status.details field, or localized by the client. 3085 Message string `json:"message,omitempty"` 3086 3087 // ForceSendFields is a list of field names (e.g. "Code") to 3088 // unconditionally include in API requests. By default, fields with 3089 // empty values are omitted from API requests. However, any non-pointer, 3090 // non-interface field appearing in ForceSendFields will be sent to the 3091 // server regardless of whether the field is empty or not. This may be 3092 // used to include empty fields in Patch requests. 3093 ForceSendFields []string `json:"-"` 3094 3095 // NullFields is a list of field names (e.g. "Code") to include in API 3096 // requests with the JSON null value. By default, fields with empty 3097 // values are omitted from API requests. However, any field with an 3098 // empty value appearing in NullFields will be sent to the server as 3099 // null. It is an error if a field in this list has a non-empty value. 3100 // This may be used to include null fields in Patch requests. 3101 NullFields []string `json:"-"` 3102} 3103 3104func (s *GoogleRpcStatus) MarshalJSON() ([]byte, error) { 3105 type NoMethod GoogleRpcStatus 3106 raw := NoMethod(*s) 3107 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3108} 3109 3110// method id "retail.projects.locations.catalogs.list": 3111 3112type ProjectsLocationsCatalogsListCall struct { 3113 s *Service 3114 parent string 3115 urlParams_ gensupport.URLParams 3116 ifNoneMatch_ string 3117 ctx_ context.Context 3118 header_ http.Header 3119} 3120 3121// List: Lists all the Catalogs associated with the project. 3122// 3123// - parent: The account resource name with an associated location. If 3124// the caller does not have permission to list Catalogs under this 3125// location, regardless of whether or not this location exists, a 3126// PERMISSION_DENIED error is returned. 3127func (r *ProjectsLocationsCatalogsService) List(parent string) *ProjectsLocationsCatalogsListCall { 3128 c := &ProjectsLocationsCatalogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3129 c.parent = parent 3130 return c 3131} 3132 3133// PageSize sets the optional parameter "pageSize": Maximum number of 3134// Catalogs to return. If unspecified, defaults to 50. The maximum 3135// allowed value is 1000. Values above 1000 will be coerced to 1000. If 3136// this field is negative, an INVALID_ARGUMENT is returned. 3137func (c *ProjectsLocationsCatalogsListCall) PageSize(pageSize int64) *ProjectsLocationsCatalogsListCall { 3138 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 3139 return c 3140} 3141 3142// PageToken sets the optional parameter "pageToken": A page token 3143// ListCatalogsResponse.next_page_token, received from a previous 3144// CatalogService.ListCatalogs call. Provide this to retrieve the 3145// subsequent page. When paginating, all other parameters provided to 3146// CatalogService.ListCatalogs must match the call that provided the 3147// page token. Otherwise, an INVALID_ARGUMENT error is returned. 3148func (c *ProjectsLocationsCatalogsListCall) PageToken(pageToken string) *ProjectsLocationsCatalogsListCall { 3149 c.urlParams_.Set("pageToken", pageToken) 3150 return c 3151} 3152 3153// Fields allows partial responses to be retrieved. See 3154// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3155// for more information. 3156func (c *ProjectsLocationsCatalogsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsListCall { 3157 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3158 return c 3159} 3160 3161// IfNoneMatch sets the optional parameter which makes the operation 3162// fail if the object's ETag matches the given value. This is useful for 3163// getting updates only after the object has changed since the last 3164// request. Use googleapi.IsNotModified to check whether the response 3165// error from Do is the result of In-None-Match. 3166func (c *ProjectsLocationsCatalogsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsListCall { 3167 c.ifNoneMatch_ = entityTag 3168 return c 3169} 3170 3171// Context sets the context to be used in this call's Do method. Any 3172// pending HTTP request will be aborted if the provided context is 3173// canceled. 3174func (c *ProjectsLocationsCatalogsListCall) Context(ctx context.Context) *ProjectsLocationsCatalogsListCall { 3175 c.ctx_ = ctx 3176 return c 3177} 3178 3179// Header returns an http.Header that can be modified by the caller to 3180// add HTTP headers to the request. 3181func (c *ProjectsLocationsCatalogsListCall) Header() http.Header { 3182 if c.header_ == nil { 3183 c.header_ = make(http.Header) 3184 } 3185 return c.header_ 3186} 3187 3188func (c *ProjectsLocationsCatalogsListCall) doRequest(alt string) (*http.Response, error) { 3189 reqHeaders := make(http.Header) 3190 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 3191 for k, v := range c.header_ { 3192 reqHeaders[k] = v 3193 } 3194 reqHeaders.Set("User-Agent", c.s.userAgent()) 3195 if c.ifNoneMatch_ != "" { 3196 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3197 } 3198 var body io.Reader = nil 3199 c.urlParams_.Set("alt", alt) 3200 c.urlParams_.Set("prettyPrint", "false") 3201 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+parent}/catalogs") 3202 urls += "?" + c.urlParams_.Encode() 3203 req, err := http.NewRequest("GET", urls, body) 3204 if err != nil { 3205 return nil, err 3206 } 3207 req.Header = reqHeaders 3208 googleapi.Expand(req.URL, map[string]string{ 3209 "parent": c.parent, 3210 }) 3211 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3212} 3213 3214// Do executes the "retail.projects.locations.catalogs.list" call. 3215// Exactly one of *GoogleCloudRetailV2alphaListCatalogsResponse or error 3216// will be non-nil. Any non-2xx status code is an error. Response 3217// headers are in either 3218// *GoogleCloudRetailV2alphaListCatalogsResponse.ServerResponse.Header 3219// or (if a response was returned at all) in 3220// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 3221// whether the returned error was because http.StatusNotModified was 3222// returned. 3223func (c *ProjectsLocationsCatalogsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2alphaListCatalogsResponse, error) { 3224 gensupport.SetOptions(c.urlParams_, opts...) 3225 res, err := c.doRequest("json") 3226 if res != nil && res.StatusCode == http.StatusNotModified { 3227 if res.Body != nil { 3228 res.Body.Close() 3229 } 3230 return nil, &googleapi.Error{ 3231 Code: res.StatusCode, 3232 Header: res.Header, 3233 } 3234 } 3235 if err != nil { 3236 return nil, err 3237 } 3238 defer googleapi.CloseBody(res) 3239 if err := googleapi.CheckResponse(res); err != nil { 3240 return nil, err 3241 } 3242 ret := &GoogleCloudRetailV2alphaListCatalogsResponse{ 3243 ServerResponse: googleapi.ServerResponse{ 3244 Header: res.Header, 3245 HTTPStatusCode: res.StatusCode, 3246 }, 3247 } 3248 target := &ret 3249 if err := gensupport.DecodeResponse(target, res); err != nil { 3250 return nil, err 3251 } 3252 return ret, nil 3253 // { 3254 // "description": "Lists all the Catalogs associated with the project.", 3255 // "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/catalogs", 3256 // "httpMethod": "GET", 3257 // "id": "retail.projects.locations.catalogs.list", 3258 // "parameterOrder": [ 3259 // "parent" 3260 // ], 3261 // "parameters": { 3262 // "pageSize": { 3263 // "description": "Maximum number of Catalogs to return. If unspecified, defaults to 50. The maximum allowed value is 1000. Values above 1000 will be coerced to 1000. If this field is negative, an INVALID_ARGUMENT is returned.", 3264 // "format": "int32", 3265 // "location": "query", 3266 // "type": "integer" 3267 // }, 3268 // "pageToken": { 3269 // "description": "A page token ListCatalogsResponse.next_page_token, received from a previous CatalogService.ListCatalogs call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to CatalogService.ListCatalogs must match the call that provided the page token. Otherwise, an INVALID_ARGUMENT error is returned.", 3270 // "location": "query", 3271 // "type": "string" 3272 // }, 3273 // "parent": { 3274 // "description": "Required. The account resource name with an associated location. If the caller does not have permission to list Catalogs under this location, regardless of whether or not this location exists, a PERMISSION_DENIED error is returned.", 3275 // "location": "path", 3276 // "pattern": "^projects/[^/]+/locations/[^/]+$", 3277 // "required": true, 3278 // "type": "string" 3279 // } 3280 // }, 3281 // "path": "v2alpha/{+parent}/catalogs", 3282 // "response": { 3283 // "$ref": "GoogleCloudRetailV2alphaListCatalogsResponse" 3284 // }, 3285 // "scopes": [ 3286 // "https://www.googleapis.com/auth/cloud-platform" 3287 // ] 3288 // } 3289 3290} 3291 3292// Pages invokes f for each page of results. 3293// A non-nil error returned from f will halt the iteration. 3294// The provided context supersedes any context provided to the Context method. 3295func (c *ProjectsLocationsCatalogsListCall) Pages(ctx context.Context, f func(*GoogleCloudRetailV2alphaListCatalogsResponse) error) error { 3296 c.ctx_ = ctx 3297 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 3298 for { 3299 x, err := c.Do() 3300 if err != nil { 3301 return err 3302 } 3303 if err := f(x); err != nil { 3304 return err 3305 } 3306 if x.NextPageToken == "" { 3307 return nil 3308 } 3309 c.PageToken(x.NextPageToken) 3310 } 3311} 3312 3313// method id "retail.projects.locations.catalogs.patch": 3314 3315type ProjectsLocationsCatalogsPatchCall struct { 3316 s *Service 3317 name string 3318 googlecloudretailv2alphacatalog *GoogleCloudRetailV2alphaCatalog 3319 urlParams_ gensupport.URLParams 3320 ctx_ context.Context 3321 header_ http.Header 3322} 3323 3324// Patch: Updates the Catalogs. 3325// 3326// - name: Immutable. The fully qualified resource name of the catalog. 3327func (r *ProjectsLocationsCatalogsService) Patch(name string, googlecloudretailv2alphacatalog *GoogleCloudRetailV2alphaCatalog) *ProjectsLocationsCatalogsPatchCall { 3328 c := &ProjectsLocationsCatalogsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3329 c.name = name 3330 c.googlecloudretailv2alphacatalog = googlecloudretailv2alphacatalog 3331 return c 3332} 3333 3334// UpdateMask sets the optional parameter "updateMask": Indicates which 3335// fields in the provided Catalog to update. If an unsupported or 3336// unknown field is provided, an INVALID_ARGUMENT error is returned. 3337func (c *ProjectsLocationsCatalogsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsCatalogsPatchCall { 3338 c.urlParams_.Set("updateMask", updateMask) 3339 return c 3340} 3341 3342// Fields allows partial responses to be retrieved. See 3343// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3344// for more information. 3345func (c *ProjectsLocationsCatalogsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsPatchCall { 3346 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3347 return c 3348} 3349 3350// Context sets the context to be used in this call's Do method. Any 3351// pending HTTP request will be aborted if the provided context is 3352// canceled. 3353func (c *ProjectsLocationsCatalogsPatchCall) Context(ctx context.Context) *ProjectsLocationsCatalogsPatchCall { 3354 c.ctx_ = ctx 3355 return c 3356} 3357 3358// Header returns an http.Header that can be modified by the caller to 3359// add HTTP headers to the request. 3360func (c *ProjectsLocationsCatalogsPatchCall) Header() http.Header { 3361 if c.header_ == nil { 3362 c.header_ = make(http.Header) 3363 } 3364 return c.header_ 3365} 3366 3367func (c *ProjectsLocationsCatalogsPatchCall) doRequest(alt string) (*http.Response, error) { 3368 reqHeaders := make(http.Header) 3369 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 3370 for k, v := range c.header_ { 3371 reqHeaders[k] = v 3372 } 3373 reqHeaders.Set("User-Agent", c.s.userAgent()) 3374 var body io.Reader = nil 3375 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphacatalog) 3376 if err != nil { 3377 return nil, err 3378 } 3379 reqHeaders.Set("Content-Type", "application/json") 3380 c.urlParams_.Set("alt", alt) 3381 c.urlParams_.Set("prettyPrint", "false") 3382 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") 3383 urls += "?" + c.urlParams_.Encode() 3384 req, err := http.NewRequest("PATCH", urls, body) 3385 if err != nil { 3386 return nil, err 3387 } 3388 req.Header = reqHeaders 3389 googleapi.Expand(req.URL, map[string]string{ 3390 "name": c.name, 3391 }) 3392 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3393} 3394 3395// Do executes the "retail.projects.locations.catalogs.patch" call. 3396// Exactly one of *GoogleCloudRetailV2alphaCatalog or error will be 3397// non-nil. Any non-2xx status code is an error. Response headers are in 3398// either *GoogleCloudRetailV2alphaCatalog.ServerResponse.Header or (if 3399// a response was returned at all) in error.(*googleapi.Error).Header. 3400// Use googleapi.IsNotModified to check whether the returned error was 3401// because http.StatusNotModified was returned. 3402func (c *ProjectsLocationsCatalogsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2alphaCatalog, error) { 3403 gensupport.SetOptions(c.urlParams_, opts...) 3404 res, err := c.doRequest("json") 3405 if res != nil && res.StatusCode == http.StatusNotModified { 3406 if res.Body != nil { 3407 res.Body.Close() 3408 } 3409 return nil, &googleapi.Error{ 3410 Code: res.StatusCode, 3411 Header: res.Header, 3412 } 3413 } 3414 if err != nil { 3415 return nil, err 3416 } 3417 defer googleapi.CloseBody(res) 3418 if err := googleapi.CheckResponse(res); err != nil { 3419 return nil, err 3420 } 3421 ret := &GoogleCloudRetailV2alphaCatalog{ 3422 ServerResponse: googleapi.ServerResponse{ 3423 Header: res.Header, 3424 HTTPStatusCode: res.StatusCode, 3425 }, 3426 } 3427 target := &ret 3428 if err := gensupport.DecodeResponse(target, res); err != nil { 3429 return nil, err 3430 } 3431 return ret, nil 3432 // { 3433 // "description": "Updates the Catalogs.", 3434 // "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}", 3435 // "httpMethod": "PATCH", 3436 // "id": "retail.projects.locations.catalogs.patch", 3437 // "parameterOrder": [ 3438 // "name" 3439 // ], 3440 // "parameters": { 3441 // "name": { 3442 // "description": "Required. Immutable. The fully qualified resource name of the catalog.", 3443 // "location": "path", 3444 // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+$", 3445 // "required": true, 3446 // "type": "string" 3447 // }, 3448 // "updateMask": { 3449 // "description": "Indicates which fields in the provided Catalog to update. If an unsupported or unknown field is provided, an INVALID_ARGUMENT error is returned.", 3450 // "format": "google-fieldmask", 3451 // "location": "query", 3452 // "type": "string" 3453 // } 3454 // }, 3455 // "path": "v2alpha/{+name}", 3456 // "request": { 3457 // "$ref": "GoogleCloudRetailV2alphaCatalog" 3458 // }, 3459 // "response": { 3460 // "$ref": "GoogleCloudRetailV2alphaCatalog" 3461 // }, 3462 // "scopes": [ 3463 // "https://www.googleapis.com/auth/cloud-platform" 3464 // ] 3465 // } 3466 3467} 3468 3469// method id "retail.projects.locations.catalogs.branches.operations.get": 3470 3471type ProjectsLocationsCatalogsBranchesOperationsGetCall struct { 3472 s *Service 3473 name string 3474 urlParams_ gensupport.URLParams 3475 ifNoneMatch_ string 3476 ctx_ context.Context 3477 header_ http.Header 3478} 3479 3480// Get: Gets the latest state of a long-running operation. Clients can 3481// use this method to poll the operation result at intervals as 3482// recommended by the API service. 3483// 3484// - name: The name of the operation resource. 3485func (r *ProjectsLocationsCatalogsBranchesOperationsService) Get(name string) *ProjectsLocationsCatalogsBranchesOperationsGetCall { 3486 c := &ProjectsLocationsCatalogsBranchesOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3487 c.name = name 3488 return c 3489} 3490 3491// Fields allows partial responses to be retrieved. See 3492// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3493// for more information. 3494func (c *ProjectsLocationsCatalogsBranchesOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesOperationsGetCall { 3495 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3496 return c 3497} 3498 3499// IfNoneMatch sets the optional parameter which makes the operation 3500// fail if the object's ETag matches the given value. This is useful for 3501// getting updates only after the object has changed since the last 3502// request. Use googleapi.IsNotModified to check whether the response 3503// error from Do is the result of In-None-Match. 3504func (c *ProjectsLocationsCatalogsBranchesOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsBranchesOperationsGetCall { 3505 c.ifNoneMatch_ = entityTag 3506 return c 3507} 3508 3509// Context sets the context to be used in this call's Do method. Any 3510// pending HTTP request will be aborted if the provided context is 3511// canceled. 3512func (c *ProjectsLocationsCatalogsBranchesOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesOperationsGetCall { 3513 c.ctx_ = ctx 3514 return c 3515} 3516 3517// Header returns an http.Header that can be modified by the caller to 3518// add HTTP headers to the request. 3519func (c *ProjectsLocationsCatalogsBranchesOperationsGetCall) Header() http.Header { 3520 if c.header_ == nil { 3521 c.header_ = make(http.Header) 3522 } 3523 return c.header_ 3524} 3525 3526func (c *ProjectsLocationsCatalogsBranchesOperationsGetCall) doRequest(alt string) (*http.Response, error) { 3527 reqHeaders := make(http.Header) 3528 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 3529 for k, v := range c.header_ { 3530 reqHeaders[k] = v 3531 } 3532 reqHeaders.Set("User-Agent", c.s.userAgent()) 3533 if c.ifNoneMatch_ != "" { 3534 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3535 } 3536 var body io.Reader = nil 3537 c.urlParams_.Set("alt", alt) 3538 c.urlParams_.Set("prettyPrint", "false") 3539 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") 3540 urls += "?" + c.urlParams_.Encode() 3541 req, err := http.NewRequest("GET", urls, body) 3542 if err != nil { 3543 return nil, err 3544 } 3545 req.Header = reqHeaders 3546 googleapi.Expand(req.URL, map[string]string{ 3547 "name": c.name, 3548 }) 3549 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3550} 3551 3552// Do executes the "retail.projects.locations.catalogs.branches.operations.get" call. 3553// Exactly one of *GoogleLongrunningOperation or error will be non-nil. 3554// Any non-2xx status code is an error. Response headers are in either 3555// *GoogleLongrunningOperation.ServerResponse.Header or (if a response 3556// was returned at all) in error.(*googleapi.Error).Header. Use 3557// googleapi.IsNotModified to check whether the returned error was 3558// because http.StatusNotModified was returned. 3559func (c *ProjectsLocationsCatalogsBranchesOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 3560 gensupport.SetOptions(c.urlParams_, opts...) 3561 res, err := c.doRequest("json") 3562 if res != nil && res.StatusCode == http.StatusNotModified { 3563 if res.Body != nil { 3564 res.Body.Close() 3565 } 3566 return nil, &googleapi.Error{ 3567 Code: res.StatusCode, 3568 Header: res.Header, 3569 } 3570 } 3571 if err != nil { 3572 return nil, err 3573 } 3574 defer googleapi.CloseBody(res) 3575 if err := googleapi.CheckResponse(res); err != nil { 3576 return nil, err 3577 } 3578 ret := &GoogleLongrunningOperation{ 3579 ServerResponse: googleapi.ServerResponse{ 3580 Header: res.Header, 3581 HTTPStatusCode: res.StatusCode, 3582 }, 3583 } 3584 target := &ret 3585 if err := gensupport.DecodeResponse(target, res); err != nil { 3586 return nil, err 3587 } 3588 return ret, nil 3589 // { 3590 // "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", 3591 // "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/operations/{operationsId}", 3592 // "httpMethod": "GET", 3593 // "id": "retail.projects.locations.catalogs.branches.operations.get", 3594 // "parameterOrder": [ 3595 // "name" 3596 // ], 3597 // "parameters": { 3598 // "name": { 3599 // "description": "The name of the operation resource.", 3600 // "location": "path", 3601 // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+/operations/[^/]+$", 3602 // "required": true, 3603 // "type": "string" 3604 // } 3605 // }, 3606 // "path": "v2alpha/{+name}", 3607 // "response": { 3608 // "$ref": "GoogleLongrunningOperation" 3609 // }, 3610 // "scopes": [ 3611 // "https://www.googleapis.com/auth/cloud-platform" 3612 // ] 3613 // } 3614 3615} 3616 3617// method id "retail.projects.locations.catalogs.branches.products.create": 3618 3619type ProjectsLocationsCatalogsBranchesProductsCreateCall struct { 3620 s *Service 3621 parent string 3622 googlecloudretailv2alphaproduct *GoogleCloudRetailV2alphaProduct 3623 urlParams_ gensupport.URLParams 3624 ctx_ context.Context 3625 header_ http.Header 3626} 3627 3628// Create: Creates a Product. 3629// 3630// - parent: The parent catalog resource name, such as 3631// `projects/*/locations/global/catalogs/default_catalog/branches/defau 3632// lt_branch`. 3633func (r *ProjectsLocationsCatalogsBranchesProductsService) Create(parent string, googlecloudretailv2alphaproduct *GoogleCloudRetailV2alphaProduct) *ProjectsLocationsCatalogsBranchesProductsCreateCall { 3634 c := &ProjectsLocationsCatalogsBranchesProductsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3635 c.parent = parent 3636 c.googlecloudretailv2alphaproduct = googlecloudretailv2alphaproduct 3637 return c 3638} 3639 3640// ProductId sets the optional parameter "productId": Required. The ID 3641// to use for the Product, which will become the final component of the 3642// Product.name. If the caller does not have permission to create the 3643// Product, regardless of whether or not it exists, a PERMISSION_DENIED 3644// error is returned. This field must be unique among all Products with 3645// the same parent. Otherwise, an ALREADY_EXISTS error is returned. This 3646// field must be a UTF-8 encoded string with a length limit of 128 3647// characters. Otherwise, an INVALID_ARGUMENT error is returned. 3648func (c *ProjectsLocationsCatalogsBranchesProductsCreateCall) ProductId(productId string) *ProjectsLocationsCatalogsBranchesProductsCreateCall { 3649 c.urlParams_.Set("productId", productId) 3650 return c 3651} 3652 3653// Fields allows partial responses to be retrieved. See 3654// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3655// for more information. 3656func (c *ProjectsLocationsCatalogsBranchesProductsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesProductsCreateCall { 3657 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3658 return c 3659} 3660 3661// Context sets the context to be used in this call's Do method. Any 3662// pending HTTP request will be aborted if the provided context is 3663// canceled. 3664func (c *ProjectsLocationsCatalogsBranchesProductsCreateCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesProductsCreateCall { 3665 c.ctx_ = ctx 3666 return c 3667} 3668 3669// Header returns an http.Header that can be modified by the caller to 3670// add HTTP headers to the request. 3671func (c *ProjectsLocationsCatalogsBranchesProductsCreateCall) Header() http.Header { 3672 if c.header_ == nil { 3673 c.header_ = make(http.Header) 3674 } 3675 return c.header_ 3676} 3677 3678func (c *ProjectsLocationsCatalogsBranchesProductsCreateCall) doRequest(alt string) (*http.Response, error) { 3679 reqHeaders := make(http.Header) 3680 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 3681 for k, v := range c.header_ { 3682 reqHeaders[k] = v 3683 } 3684 reqHeaders.Set("User-Agent", c.s.userAgent()) 3685 var body io.Reader = nil 3686 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphaproduct) 3687 if err != nil { 3688 return nil, err 3689 } 3690 reqHeaders.Set("Content-Type", "application/json") 3691 c.urlParams_.Set("alt", alt) 3692 c.urlParams_.Set("prettyPrint", "false") 3693 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+parent}/products") 3694 urls += "?" + c.urlParams_.Encode() 3695 req, err := http.NewRequest("POST", urls, body) 3696 if err != nil { 3697 return nil, err 3698 } 3699 req.Header = reqHeaders 3700 googleapi.Expand(req.URL, map[string]string{ 3701 "parent": c.parent, 3702 }) 3703 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3704} 3705 3706// Do executes the "retail.projects.locations.catalogs.branches.products.create" call. 3707// Exactly one of *GoogleCloudRetailV2alphaProduct or error will be 3708// non-nil. Any non-2xx status code is an error. Response headers are in 3709// either *GoogleCloudRetailV2alphaProduct.ServerResponse.Header or (if 3710// a response was returned at all) in error.(*googleapi.Error).Header. 3711// Use googleapi.IsNotModified to check whether the returned error was 3712// because http.StatusNotModified was returned. 3713func (c *ProjectsLocationsCatalogsBranchesProductsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2alphaProduct, error) { 3714 gensupport.SetOptions(c.urlParams_, opts...) 3715 res, err := c.doRequest("json") 3716 if res != nil && res.StatusCode == http.StatusNotModified { 3717 if res.Body != nil { 3718 res.Body.Close() 3719 } 3720 return nil, &googleapi.Error{ 3721 Code: res.StatusCode, 3722 Header: res.Header, 3723 } 3724 } 3725 if err != nil { 3726 return nil, err 3727 } 3728 defer googleapi.CloseBody(res) 3729 if err := googleapi.CheckResponse(res); err != nil { 3730 return nil, err 3731 } 3732 ret := &GoogleCloudRetailV2alphaProduct{ 3733 ServerResponse: googleapi.ServerResponse{ 3734 Header: res.Header, 3735 HTTPStatusCode: res.StatusCode, 3736 }, 3737 } 3738 target := &ret 3739 if err := gensupport.DecodeResponse(target, res); err != nil { 3740 return nil, err 3741 } 3742 return ret, nil 3743 // { 3744 // "description": "Creates a Product.", 3745 // "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/products", 3746 // "httpMethod": "POST", 3747 // "id": "retail.projects.locations.catalogs.branches.products.create", 3748 // "parameterOrder": [ 3749 // "parent" 3750 // ], 3751 // "parameters": { 3752 // "parent": { 3753 // "description": "Required. The parent catalog resource name, such as `projects/*/locations/global/catalogs/default_catalog/branches/default_branch`.", 3754 // "location": "path", 3755 // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+$", 3756 // "required": true, 3757 // "type": "string" 3758 // }, 3759 // "productId": { 3760 // "description": "Required. The ID to use for the Product, which will become the final component of the Product.name. If the caller does not have permission to create the Product, regardless of whether or not it exists, a PERMISSION_DENIED error is returned. This field must be unique among all Products with the same parent. Otherwise, an ALREADY_EXISTS error is returned. This field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned.", 3761 // "location": "query", 3762 // "type": "string" 3763 // } 3764 // }, 3765 // "path": "v2alpha/{+parent}/products", 3766 // "request": { 3767 // "$ref": "GoogleCloudRetailV2alphaProduct" 3768 // }, 3769 // "response": { 3770 // "$ref": "GoogleCloudRetailV2alphaProduct" 3771 // }, 3772 // "scopes": [ 3773 // "https://www.googleapis.com/auth/cloud-platform" 3774 // ] 3775 // } 3776 3777} 3778 3779// method id "retail.projects.locations.catalogs.branches.products.delete": 3780 3781type ProjectsLocationsCatalogsBranchesProductsDeleteCall struct { 3782 s *Service 3783 name string 3784 urlParams_ gensupport.URLParams 3785 ctx_ context.Context 3786 header_ http.Header 3787} 3788 3789// Delete: Deletes a Product. 3790// 3791// - name: Full resource name of Product, such as 3792// `projects/*/locations/global/catalogs/default_catalog/branches/defau 3793// lt_branch/products/some_product_id`. If the caller does not have 3794// permission to delete the Product, regardless of whether or not it 3795// exists, a PERMISSION_DENIED error is returned. If the Product to 3796// delete does not exist, a NOT_FOUND error is returned. The Product 3797// to delete can neither be a Product.Type.COLLECTION Product member 3798// nor a Product.Type.PRIMARY Product with more than one variants. 3799// Otherwise, an INVALID_ARGUMENT error is returned. All inventory 3800// information for the named Product will be deleted. 3801func (r *ProjectsLocationsCatalogsBranchesProductsService) Delete(name string) *ProjectsLocationsCatalogsBranchesProductsDeleteCall { 3802 c := &ProjectsLocationsCatalogsBranchesProductsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3803 c.name = name 3804 return c 3805} 3806 3807// Fields allows partial responses to be retrieved. See 3808// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3809// for more information. 3810func (c *ProjectsLocationsCatalogsBranchesProductsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesProductsDeleteCall { 3811 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3812 return c 3813} 3814 3815// Context sets the context to be used in this call's Do method. Any 3816// pending HTTP request will be aborted if the provided context is 3817// canceled. 3818func (c *ProjectsLocationsCatalogsBranchesProductsDeleteCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesProductsDeleteCall { 3819 c.ctx_ = ctx 3820 return c 3821} 3822 3823// Header returns an http.Header that can be modified by the caller to 3824// add HTTP headers to the request. 3825func (c *ProjectsLocationsCatalogsBranchesProductsDeleteCall) Header() http.Header { 3826 if c.header_ == nil { 3827 c.header_ = make(http.Header) 3828 } 3829 return c.header_ 3830} 3831 3832func (c *ProjectsLocationsCatalogsBranchesProductsDeleteCall) doRequest(alt string) (*http.Response, error) { 3833 reqHeaders := make(http.Header) 3834 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 3835 for k, v := range c.header_ { 3836 reqHeaders[k] = v 3837 } 3838 reqHeaders.Set("User-Agent", c.s.userAgent()) 3839 var body io.Reader = nil 3840 c.urlParams_.Set("alt", alt) 3841 c.urlParams_.Set("prettyPrint", "false") 3842 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") 3843 urls += "?" + c.urlParams_.Encode() 3844 req, err := http.NewRequest("DELETE", urls, body) 3845 if err != nil { 3846 return nil, err 3847 } 3848 req.Header = reqHeaders 3849 googleapi.Expand(req.URL, map[string]string{ 3850 "name": c.name, 3851 }) 3852 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3853} 3854 3855// Do executes the "retail.projects.locations.catalogs.branches.products.delete" call. 3856// Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any 3857// non-2xx status code is an error. Response headers are in either 3858// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was 3859// returned at all) in error.(*googleapi.Error).Header. Use 3860// googleapi.IsNotModified to check whether the returned error was 3861// because http.StatusNotModified was returned. 3862func (c *ProjectsLocationsCatalogsBranchesProductsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { 3863 gensupport.SetOptions(c.urlParams_, opts...) 3864 res, err := c.doRequest("json") 3865 if res != nil && res.StatusCode == http.StatusNotModified { 3866 if res.Body != nil { 3867 res.Body.Close() 3868 } 3869 return nil, &googleapi.Error{ 3870 Code: res.StatusCode, 3871 Header: res.Header, 3872 } 3873 } 3874 if err != nil { 3875 return nil, err 3876 } 3877 defer googleapi.CloseBody(res) 3878 if err := googleapi.CheckResponse(res); err != nil { 3879 return nil, err 3880 } 3881 ret := &GoogleProtobufEmpty{ 3882 ServerResponse: googleapi.ServerResponse{ 3883 Header: res.Header, 3884 HTTPStatusCode: res.StatusCode, 3885 }, 3886 } 3887 target := &ret 3888 if err := gensupport.DecodeResponse(target, res); err != nil { 3889 return nil, err 3890 } 3891 return ret, nil 3892 // { 3893 // "description": "Deletes a Product.", 3894 // "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/products/{productsId}", 3895 // "httpMethod": "DELETE", 3896 // "id": "retail.projects.locations.catalogs.branches.products.delete", 3897 // "parameterOrder": [ 3898 // "name" 3899 // ], 3900 // "parameters": { 3901 // "name": { 3902 // "description": "Required. Full resource name of Product, such as `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. If the caller does not have permission to delete the Product, regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the Product to delete does not exist, a NOT_FOUND error is returned. The Product to delete can neither be a Product.Type.COLLECTION Product member nor a Product.Type.PRIMARY Product with more than one variants. Otherwise, an INVALID_ARGUMENT error is returned. All inventory information for the named Product will be deleted.", 3903 // "location": "path", 3904 // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+/products/.*$", 3905 // "required": true, 3906 // "type": "string" 3907 // } 3908 // }, 3909 // "path": "v2alpha/{+name}", 3910 // "response": { 3911 // "$ref": "GoogleProtobufEmpty" 3912 // }, 3913 // "scopes": [ 3914 // "https://www.googleapis.com/auth/cloud-platform" 3915 // ] 3916 // } 3917 3918} 3919 3920// method id "retail.projects.locations.catalogs.branches.products.get": 3921 3922type ProjectsLocationsCatalogsBranchesProductsGetCall struct { 3923 s *Service 3924 name string 3925 urlParams_ gensupport.URLParams 3926 ifNoneMatch_ string 3927 ctx_ context.Context 3928 header_ http.Header 3929} 3930 3931// Get: Gets a Product. 3932// 3933// - name: Full resource name of Product, such as 3934// `projects/*/locations/global/catalogs/default_catalog/branches/defau 3935// lt_branch/products/some_product_id`. If the caller does not have 3936// permission to access the Product, regardless of whether or not it 3937// exists, a PERMISSION_DENIED error is returned. If the requested 3938// Product does not exist, a NOT_FOUND error is returned. 3939func (r *ProjectsLocationsCatalogsBranchesProductsService) Get(name string) *ProjectsLocationsCatalogsBranchesProductsGetCall { 3940 c := &ProjectsLocationsCatalogsBranchesProductsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3941 c.name = name 3942 return c 3943} 3944 3945// Fields allows partial responses to be retrieved. See 3946// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3947// for more information. 3948func (c *ProjectsLocationsCatalogsBranchesProductsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesProductsGetCall { 3949 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3950 return c 3951} 3952 3953// IfNoneMatch sets the optional parameter which makes the operation 3954// fail if the object's ETag matches the given value. This is useful for 3955// getting updates only after the object has changed since the last 3956// request. Use googleapi.IsNotModified to check whether the response 3957// error from Do is the result of In-None-Match. 3958func (c *ProjectsLocationsCatalogsBranchesProductsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsBranchesProductsGetCall { 3959 c.ifNoneMatch_ = entityTag 3960 return c 3961} 3962 3963// Context sets the context to be used in this call's Do method. Any 3964// pending HTTP request will be aborted if the provided context is 3965// canceled. 3966func (c *ProjectsLocationsCatalogsBranchesProductsGetCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesProductsGetCall { 3967 c.ctx_ = ctx 3968 return c 3969} 3970 3971// Header returns an http.Header that can be modified by the caller to 3972// add HTTP headers to the request. 3973func (c *ProjectsLocationsCatalogsBranchesProductsGetCall) Header() http.Header { 3974 if c.header_ == nil { 3975 c.header_ = make(http.Header) 3976 } 3977 return c.header_ 3978} 3979 3980func (c *ProjectsLocationsCatalogsBranchesProductsGetCall) doRequest(alt string) (*http.Response, error) { 3981 reqHeaders := make(http.Header) 3982 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 3983 for k, v := range c.header_ { 3984 reqHeaders[k] = v 3985 } 3986 reqHeaders.Set("User-Agent", c.s.userAgent()) 3987 if c.ifNoneMatch_ != "" { 3988 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3989 } 3990 var body io.Reader = nil 3991 c.urlParams_.Set("alt", alt) 3992 c.urlParams_.Set("prettyPrint", "false") 3993 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") 3994 urls += "?" + c.urlParams_.Encode() 3995 req, err := http.NewRequest("GET", urls, body) 3996 if err != nil { 3997 return nil, err 3998 } 3999 req.Header = reqHeaders 4000 googleapi.Expand(req.URL, map[string]string{ 4001 "name": c.name, 4002 }) 4003 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4004} 4005 4006// Do executes the "retail.projects.locations.catalogs.branches.products.get" call. 4007// Exactly one of *GoogleCloudRetailV2alphaProduct or error will be 4008// non-nil. Any non-2xx status code is an error. Response headers are in 4009// either *GoogleCloudRetailV2alphaProduct.ServerResponse.Header or (if 4010// a response was returned at all) in error.(*googleapi.Error).Header. 4011// Use googleapi.IsNotModified to check whether the returned error was 4012// because http.StatusNotModified was returned. 4013func (c *ProjectsLocationsCatalogsBranchesProductsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2alphaProduct, error) { 4014 gensupport.SetOptions(c.urlParams_, opts...) 4015 res, err := c.doRequest("json") 4016 if res != nil && res.StatusCode == http.StatusNotModified { 4017 if res.Body != nil { 4018 res.Body.Close() 4019 } 4020 return nil, &googleapi.Error{ 4021 Code: res.StatusCode, 4022 Header: res.Header, 4023 } 4024 } 4025 if err != nil { 4026 return nil, err 4027 } 4028 defer googleapi.CloseBody(res) 4029 if err := googleapi.CheckResponse(res); err != nil { 4030 return nil, err 4031 } 4032 ret := &GoogleCloudRetailV2alphaProduct{ 4033 ServerResponse: googleapi.ServerResponse{ 4034 Header: res.Header, 4035 HTTPStatusCode: res.StatusCode, 4036 }, 4037 } 4038 target := &ret 4039 if err := gensupport.DecodeResponse(target, res); err != nil { 4040 return nil, err 4041 } 4042 return ret, nil 4043 // { 4044 // "description": "Gets a Product.", 4045 // "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/products/{productsId}", 4046 // "httpMethod": "GET", 4047 // "id": "retail.projects.locations.catalogs.branches.products.get", 4048 // "parameterOrder": [ 4049 // "name" 4050 // ], 4051 // "parameters": { 4052 // "name": { 4053 // "description": "Required. Full resource name of Product, such as `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. If the caller does not have permission to access the Product, regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the requested Product does not exist, a NOT_FOUND error is returned.", 4054 // "location": "path", 4055 // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+/products/.*$", 4056 // "required": true, 4057 // "type": "string" 4058 // } 4059 // }, 4060 // "path": "v2alpha/{+name}", 4061 // "response": { 4062 // "$ref": "GoogleCloudRetailV2alphaProduct" 4063 // }, 4064 // "scopes": [ 4065 // "https://www.googleapis.com/auth/cloud-platform" 4066 // ] 4067 // } 4068 4069} 4070 4071// method id "retail.projects.locations.catalogs.branches.products.import": 4072 4073type ProjectsLocationsCatalogsBranchesProductsImportCall struct { 4074 s *Service 4075 parent string 4076 googlecloudretailv2alphaimportproductsrequest *GoogleCloudRetailV2alphaImportProductsRequest 4077 urlParams_ gensupport.URLParams 4078 ctx_ context.Context 4079 header_ http.Header 4080} 4081 4082// Import: Bulk import of multiple Products. Request processing may be 4083// synchronous. No partial updating is supported. Non-existing items are 4084// created. Note that it is possible for a subset of the Products to be 4085// successfully updated. 4086// 4087// - parent: 4088// `projects/1234/locations/global/catalogs/default_catalog/branches/de 4089// fault_branch` If no updateMask is specified, requires 4090// products.create permission. If updateMask is specified, requires 4091// products.update permission. 4092func (r *ProjectsLocationsCatalogsBranchesProductsService) Import(parent string, googlecloudretailv2alphaimportproductsrequest *GoogleCloudRetailV2alphaImportProductsRequest) *ProjectsLocationsCatalogsBranchesProductsImportCall { 4093 c := &ProjectsLocationsCatalogsBranchesProductsImportCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4094 c.parent = parent 4095 c.googlecloudretailv2alphaimportproductsrequest = googlecloudretailv2alphaimportproductsrequest 4096 return c 4097} 4098 4099// Fields allows partial responses to be retrieved. See 4100// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4101// for more information. 4102func (c *ProjectsLocationsCatalogsBranchesProductsImportCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesProductsImportCall { 4103 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4104 return c 4105} 4106 4107// Context sets the context to be used in this call's Do method. Any 4108// pending HTTP request will be aborted if the provided context is 4109// canceled. 4110func (c *ProjectsLocationsCatalogsBranchesProductsImportCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesProductsImportCall { 4111 c.ctx_ = ctx 4112 return c 4113} 4114 4115// Header returns an http.Header that can be modified by the caller to 4116// add HTTP headers to the request. 4117func (c *ProjectsLocationsCatalogsBranchesProductsImportCall) Header() http.Header { 4118 if c.header_ == nil { 4119 c.header_ = make(http.Header) 4120 } 4121 return c.header_ 4122} 4123 4124func (c *ProjectsLocationsCatalogsBranchesProductsImportCall) doRequest(alt string) (*http.Response, error) { 4125 reqHeaders := make(http.Header) 4126 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 4127 for k, v := range c.header_ { 4128 reqHeaders[k] = v 4129 } 4130 reqHeaders.Set("User-Agent", c.s.userAgent()) 4131 var body io.Reader = nil 4132 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphaimportproductsrequest) 4133 if err != nil { 4134 return nil, err 4135 } 4136 reqHeaders.Set("Content-Type", "application/json") 4137 c.urlParams_.Set("alt", alt) 4138 c.urlParams_.Set("prettyPrint", "false") 4139 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+parent}/products:import") 4140 urls += "?" + c.urlParams_.Encode() 4141 req, err := http.NewRequest("POST", urls, body) 4142 if err != nil { 4143 return nil, err 4144 } 4145 req.Header = reqHeaders 4146 googleapi.Expand(req.URL, map[string]string{ 4147 "parent": c.parent, 4148 }) 4149 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4150} 4151 4152// Do executes the "retail.projects.locations.catalogs.branches.products.import" call. 4153// Exactly one of *GoogleLongrunningOperation or error will be non-nil. 4154// Any non-2xx status code is an error. Response headers are in either 4155// *GoogleLongrunningOperation.ServerResponse.Header or (if a response 4156// was returned at all) in error.(*googleapi.Error).Header. Use 4157// googleapi.IsNotModified to check whether the returned error was 4158// because http.StatusNotModified was returned. 4159func (c *ProjectsLocationsCatalogsBranchesProductsImportCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 4160 gensupport.SetOptions(c.urlParams_, opts...) 4161 res, err := c.doRequest("json") 4162 if res != nil && res.StatusCode == http.StatusNotModified { 4163 if res.Body != nil { 4164 res.Body.Close() 4165 } 4166 return nil, &googleapi.Error{ 4167 Code: res.StatusCode, 4168 Header: res.Header, 4169 } 4170 } 4171 if err != nil { 4172 return nil, err 4173 } 4174 defer googleapi.CloseBody(res) 4175 if err := googleapi.CheckResponse(res); err != nil { 4176 return nil, err 4177 } 4178 ret := &GoogleLongrunningOperation{ 4179 ServerResponse: googleapi.ServerResponse{ 4180 Header: res.Header, 4181 HTTPStatusCode: res.StatusCode, 4182 }, 4183 } 4184 target := &ret 4185 if err := gensupport.DecodeResponse(target, res); err != nil { 4186 return nil, err 4187 } 4188 return ret, nil 4189 // { 4190 // "description": "Bulk import of multiple Products. Request processing may be synchronous. No partial updating is supported. Non-existing items are created. Note that it is possible for a subset of the Products to be successfully updated.", 4191 // "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/products:import", 4192 // "httpMethod": "POST", 4193 // "id": "retail.projects.locations.catalogs.branches.products.import", 4194 // "parameterOrder": [ 4195 // "parent" 4196 // ], 4197 // "parameters": { 4198 // "parent": { 4199 // "description": "Required. `projects/1234/locations/global/catalogs/default_catalog/branches/default_branch` If no updateMask is specified, requires products.create permission. If updateMask is specified, requires products.update permission.", 4200 // "location": "path", 4201 // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+$", 4202 // "required": true, 4203 // "type": "string" 4204 // } 4205 // }, 4206 // "path": "v2alpha/{+parent}/products:import", 4207 // "request": { 4208 // "$ref": "GoogleCloudRetailV2alphaImportProductsRequest" 4209 // }, 4210 // "response": { 4211 // "$ref": "GoogleLongrunningOperation" 4212 // }, 4213 // "scopes": [ 4214 // "https://www.googleapis.com/auth/cloud-platform" 4215 // ] 4216 // } 4217 4218} 4219 4220// method id "retail.projects.locations.catalogs.branches.products.patch": 4221 4222type ProjectsLocationsCatalogsBranchesProductsPatchCall struct { 4223 s *Service 4224 name string 4225 googlecloudretailv2alphaproduct *GoogleCloudRetailV2alphaProduct 4226 urlParams_ gensupport.URLParams 4227 ctx_ context.Context 4228 header_ http.Header 4229} 4230 4231// Patch: Updates a Product. 4232// 4233// - name: Immutable. Full resource name of the product, such as 4234// `projects/*/locations/global/catalogs/default_catalog/branches/defau 4235// lt_branch/products/product_id`. The branch ID must be 4236// "default_branch". 4237func (r *ProjectsLocationsCatalogsBranchesProductsService) Patch(name string, googlecloudretailv2alphaproduct *GoogleCloudRetailV2alphaProduct) *ProjectsLocationsCatalogsBranchesProductsPatchCall { 4238 c := &ProjectsLocationsCatalogsBranchesProductsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4239 c.name = name 4240 c.googlecloudretailv2alphaproduct = googlecloudretailv2alphaproduct 4241 return c 4242} 4243 4244// AllowMissing sets the optional parameter "allowMissing": If set to 4245// true, and the Product is not found, a new Product will be created. In 4246// this situation, `update_mask` is ignored. 4247func (c *ProjectsLocationsCatalogsBranchesProductsPatchCall) AllowMissing(allowMissing bool) *ProjectsLocationsCatalogsBranchesProductsPatchCall { 4248 c.urlParams_.Set("allowMissing", fmt.Sprint(allowMissing)) 4249 return c 4250} 4251 4252// UpdateMask sets the optional parameter "updateMask": Indicates which 4253// fields in the provided Product to update. The immutable and output 4254// only fields are NOT supported. If not set, all supported fields (the 4255// fields that are neither immutable nor output only) are updated. If an 4256// unsupported or unknown field is provided, an INVALID_ARGUMENT error 4257// is returned. 4258func (c *ProjectsLocationsCatalogsBranchesProductsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsCatalogsBranchesProductsPatchCall { 4259 c.urlParams_.Set("updateMask", updateMask) 4260 return c 4261} 4262 4263// Fields allows partial responses to be retrieved. See 4264// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4265// for more information. 4266func (c *ProjectsLocationsCatalogsBranchesProductsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsBranchesProductsPatchCall { 4267 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4268 return c 4269} 4270 4271// Context sets the context to be used in this call's Do method. Any 4272// pending HTTP request will be aborted if the provided context is 4273// canceled. 4274func (c *ProjectsLocationsCatalogsBranchesProductsPatchCall) Context(ctx context.Context) *ProjectsLocationsCatalogsBranchesProductsPatchCall { 4275 c.ctx_ = ctx 4276 return c 4277} 4278 4279// Header returns an http.Header that can be modified by the caller to 4280// add HTTP headers to the request. 4281func (c *ProjectsLocationsCatalogsBranchesProductsPatchCall) Header() http.Header { 4282 if c.header_ == nil { 4283 c.header_ = make(http.Header) 4284 } 4285 return c.header_ 4286} 4287 4288func (c *ProjectsLocationsCatalogsBranchesProductsPatchCall) doRequest(alt string) (*http.Response, error) { 4289 reqHeaders := make(http.Header) 4290 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 4291 for k, v := range c.header_ { 4292 reqHeaders[k] = v 4293 } 4294 reqHeaders.Set("User-Agent", c.s.userAgent()) 4295 var body io.Reader = nil 4296 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphaproduct) 4297 if err != nil { 4298 return nil, err 4299 } 4300 reqHeaders.Set("Content-Type", "application/json") 4301 c.urlParams_.Set("alt", alt) 4302 c.urlParams_.Set("prettyPrint", "false") 4303 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") 4304 urls += "?" + c.urlParams_.Encode() 4305 req, err := http.NewRequest("PATCH", urls, body) 4306 if err != nil { 4307 return nil, err 4308 } 4309 req.Header = reqHeaders 4310 googleapi.Expand(req.URL, map[string]string{ 4311 "name": c.name, 4312 }) 4313 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4314} 4315 4316// Do executes the "retail.projects.locations.catalogs.branches.products.patch" call. 4317// Exactly one of *GoogleCloudRetailV2alphaProduct or error will be 4318// non-nil. Any non-2xx status code is an error. Response headers are in 4319// either *GoogleCloudRetailV2alphaProduct.ServerResponse.Header or (if 4320// a response was returned at all) in error.(*googleapi.Error).Header. 4321// Use googleapi.IsNotModified to check whether the returned error was 4322// because http.StatusNotModified was returned. 4323func (c *ProjectsLocationsCatalogsBranchesProductsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2alphaProduct, error) { 4324 gensupport.SetOptions(c.urlParams_, opts...) 4325 res, err := c.doRequest("json") 4326 if res != nil && res.StatusCode == http.StatusNotModified { 4327 if res.Body != nil { 4328 res.Body.Close() 4329 } 4330 return nil, &googleapi.Error{ 4331 Code: res.StatusCode, 4332 Header: res.Header, 4333 } 4334 } 4335 if err != nil { 4336 return nil, err 4337 } 4338 defer googleapi.CloseBody(res) 4339 if err := googleapi.CheckResponse(res); err != nil { 4340 return nil, err 4341 } 4342 ret := &GoogleCloudRetailV2alphaProduct{ 4343 ServerResponse: googleapi.ServerResponse{ 4344 Header: res.Header, 4345 HTTPStatusCode: res.StatusCode, 4346 }, 4347 } 4348 target := &ret 4349 if err := gensupport.DecodeResponse(target, res); err != nil { 4350 return nil, err 4351 } 4352 return ret, nil 4353 // { 4354 // "description": "Updates a Product.", 4355 // "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/branches/{branchesId}/products/{productsId}", 4356 // "httpMethod": "PATCH", 4357 // "id": "retail.projects.locations.catalogs.branches.products.patch", 4358 // "parameterOrder": [ 4359 // "name" 4360 // ], 4361 // "parameters": { 4362 // "allowMissing": { 4363 // "description": "If set to true, and the Product is not found, a new Product will be created. In this situation, `update_mask` is ignored.", 4364 // "location": "query", 4365 // "type": "boolean" 4366 // }, 4367 // "name": { 4368 // "description": "Immutable. Full resource name of the product, such as `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/product_id`. The branch ID must be \"default_branch\".", 4369 // "location": "path", 4370 // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/branches/[^/]+/products/.*$", 4371 // "required": true, 4372 // "type": "string" 4373 // }, 4374 // "updateMask": { 4375 // "description": "Indicates which fields in the provided Product to update. The immutable and output only fields are NOT supported. If not set, all supported fields (the fields that are neither immutable nor output only) are updated. If an unsupported or unknown field is provided, an INVALID_ARGUMENT error is returned.", 4376 // "format": "google-fieldmask", 4377 // "location": "query", 4378 // "type": "string" 4379 // } 4380 // }, 4381 // "path": "v2alpha/{+name}", 4382 // "request": { 4383 // "$ref": "GoogleCloudRetailV2alphaProduct" 4384 // }, 4385 // "response": { 4386 // "$ref": "GoogleCloudRetailV2alphaProduct" 4387 // }, 4388 // "scopes": [ 4389 // "https://www.googleapis.com/auth/cloud-platform" 4390 // ] 4391 // } 4392 4393} 4394 4395// method id "retail.projects.locations.catalogs.operations.get": 4396 4397type ProjectsLocationsCatalogsOperationsGetCall struct { 4398 s *Service 4399 name string 4400 urlParams_ gensupport.URLParams 4401 ifNoneMatch_ string 4402 ctx_ context.Context 4403 header_ http.Header 4404} 4405 4406// Get: Gets the latest state of a long-running operation. Clients can 4407// use this method to poll the operation result at intervals as 4408// recommended by the API service. 4409// 4410// - name: The name of the operation resource. 4411func (r *ProjectsLocationsCatalogsOperationsService) Get(name string) *ProjectsLocationsCatalogsOperationsGetCall { 4412 c := &ProjectsLocationsCatalogsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4413 c.name = name 4414 return c 4415} 4416 4417// Fields allows partial responses to be retrieved. See 4418// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4419// for more information. 4420func (c *ProjectsLocationsCatalogsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsOperationsGetCall { 4421 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4422 return c 4423} 4424 4425// IfNoneMatch sets the optional parameter which makes the operation 4426// fail if the object's ETag matches the given value. This is useful for 4427// getting updates only after the object has changed since the last 4428// request. Use googleapi.IsNotModified to check whether the response 4429// error from Do is the result of In-None-Match. 4430func (c *ProjectsLocationsCatalogsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsOperationsGetCall { 4431 c.ifNoneMatch_ = entityTag 4432 return c 4433} 4434 4435// Context sets the context to be used in this call's Do method. Any 4436// pending HTTP request will be aborted if the provided context is 4437// canceled. 4438func (c *ProjectsLocationsCatalogsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsCatalogsOperationsGetCall { 4439 c.ctx_ = ctx 4440 return c 4441} 4442 4443// Header returns an http.Header that can be modified by the caller to 4444// add HTTP headers to the request. 4445func (c *ProjectsLocationsCatalogsOperationsGetCall) Header() http.Header { 4446 if c.header_ == nil { 4447 c.header_ = make(http.Header) 4448 } 4449 return c.header_ 4450} 4451 4452func (c *ProjectsLocationsCatalogsOperationsGetCall) doRequest(alt string) (*http.Response, error) { 4453 reqHeaders := make(http.Header) 4454 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 4455 for k, v := range c.header_ { 4456 reqHeaders[k] = v 4457 } 4458 reqHeaders.Set("User-Agent", c.s.userAgent()) 4459 if c.ifNoneMatch_ != "" { 4460 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4461 } 4462 var body io.Reader = nil 4463 c.urlParams_.Set("alt", alt) 4464 c.urlParams_.Set("prettyPrint", "false") 4465 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") 4466 urls += "?" + c.urlParams_.Encode() 4467 req, err := http.NewRequest("GET", urls, body) 4468 if err != nil { 4469 return nil, err 4470 } 4471 req.Header = reqHeaders 4472 googleapi.Expand(req.URL, map[string]string{ 4473 "name": c.name, 4474 }) 4475 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4476} 4477 4478// Do executes the "retail.projects.locations.catalogs.operations.get" call. 4479// Exactly one of *GoogleLongrunningOperation or error will be non-nil. 4480// Any non-2xx status code is an error. Response headers are in either 4481// *GoogleLongrunningOperation.ServerResponse.Header or (if a response 4482// was returned at all) in error.(*googleapi.Error).Header. Use 4483// googleapi.IsNotModified to check whether the returned error was 4484// because http.StatusNotModified was returned. 4485func (c *ProjectsLocationsCatalogsOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 4486 gensupport.SetOptions(c.urlParams_, opts...) 4487 res, err := c.doRequest("json") 4488 if res != nil && res.StatusCode == http.StatusNotModified { 4489 if res.Body != nil { 4490 res.Body.Close() 4491 } 4492 return nil, &googleapi.Error{ 4493 Code: res.StatusCode, 4494 Header: res.Header, 4495 } 4496 } 4497 if err != nil { 4498 return nil, err 4499 } 4500 defer googleapi.CloseBody(res) 4501 if err := googleapi.CheckResponse(res); err != nil { 4502 return nil, err 4503 } 4504 ret := &GoogleLongrunningOperation{ 4505 ServerResponse: googleapi.ServerResponse{ 4506 Header: res.Header, 4507 HTTPStatusCode: res.StatusCode, 4508 }, 4509 } 4510 target := &ret 4511 if err := gensupport.DecodeResponse(target, res); err != nil { 4512 return nil, err 4513 } 4514 return ret, nil 4515 // { 4516 // "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", 4517 // "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/operations/{operationsId}", 4518 // "httpMethod": "GET", 4519 // "id": "retail.projects.locations.catalogs.operations.get", 4520 // "parameterOrder": [ 4521 // "name" 4522 // ], 4523 // "parameters": { 4524 // "name": { 4525 // "description": "The name of the operation resource.", 4526 // "location": "path", 4527 // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/operations/[^/]+$", 4528 // "required": true, 4529 // "type": "string" 4530 // } 4531 // }, 4532 // "path": "v2alpha/{+name}", 4533 // "response": { 4534 // "$ref": "GoogleLongrunningOperation" 4535 // }, 4536 // "scopes": [ 4537 // "https://www.googleapis.com/auth/cloud-platform" 4538 // ] 4539 // } 4540 4541} 4542 4543// method id "retail.projects.locations.catalogs.operations.list": 4544 4545type ProjectsLocationsCatalogsOperationsListCall struct { 4546 s *Service 4547 name string 4548 urlParams_ gensupport.URLParams 4549 ifNoneMatch_ string 4550 ctx_ context.Context 4551 header_ http.Header 4552} 4553 4554// List: Lists operations that match the specified filter in the 4555// request. If the server doesn't support this method, it returns 4556// `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to 4557// override the binding to use different resource name schemes, such as 4558// `users/*/operations`. To override the binding, API services can add a 4559// binding such as "/v1/{name=users/*}/operations" to their service 4560// configuration. For backwards compatibility, the default name includes 4561// the operations collection id, however overriding users must ensure 4562// the name binding is the parent resource, without the operations 4563// collection id. 4564// 4565// - name: The name of the operation's parent resource. 4566func (r *ProjectsLocationsCatalogsOperationsService) List(name string) *ProjectsLocationsCatalogsOperationsListCall { 4567 c := &ProjectsLocationsCatalogsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4568 c.name = name 4569 return c 4570} 4571 4572// Filter sets the optional parameter "filter": The standard list 4573// filter. 4574func (c *ProjectsLocationsCatalogsOperationsListCall) Filter(filter string) *ProjectsLocationsCatalogsOperationsListCall { 4575 c.urlParams_.Set("filter", filter) 4576 return c 4577} 4578 4579// PageSize sets the optional parameter "pageSize": The standard list 4580// page size. 4581func (c *ProjectsLocationsCatalogsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsCatalogsOperationsListCall { 4582 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 4583 return c 4584} 4585 4586// PageToken sets the optional parameter "pageToken": The standard list 4587// page token. 4588func (c *ProjectsLocationsCatalogsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsCatalogsOperationsListCall { 4589 c.urlParams_.Set("pageToken", pageToken) 4590 return c 4591} 4592 4593// Fields allows partial responses to be retrieved. See 4594// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4595// for more information. 4596func (c *ProjectsLocationsCatalogsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsOperationsListCall { 4597 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4598 return c 4599} 4600 4601// IfNoneMatch sets the optional parameter which makes the operation 4602// fail if the object's ETag matches the given value. This is useful for 4603// getting updates only after the object has changed since the last 4604// request. Use googleapi.IsNotModified to check whether the response 4605// error from Do is the result of In-None-Match. 4606func (c *ProjectsLocationsCatalogsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsOperationsListCall { 4607 c.ifNoneMatch_ = entityTag 4608 return c 4609} 4610 4611// Context sets the context to be used in this call's Do method. Any 4612// pending HTTP request will be aborted if the provided context is 4613// canceled. 4614func (c *ProjectsLocationsCatalogsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsCatalogsOperationsListCall { 4615 c.ctx_ = ctx 4616 return c 4617} 4618 4619// Header returns an http.Header that can be modified by the caller to 4620// add HTTP headers to the request. 4621func (c *ProjectsLocationsCatalogsOperationsListCall) Header() http.Header { 4622 if c.header_ == nil { 4623 c.header_ = make(http.Header) 4624 } 4625 return c.header_ 4626} 4627 4628func (c *ProjectsLocationsCatalogsOperationsListCall) doRequest(alt string) (*http.Response, error) { 4629 reqHeaders := make(http.Header) 4630 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 4631 for k, v := range c.header_ { 4632 reqHeaders[k] = v 4633 } 4634 reqHeaders.Set("User-Agent", c.s.userAgent()) 4635 if c.ifNoneMatch_ != "" { 4636 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4637 } 4638 var body io.Reader = nil 4639 c.urlParams_.Set("alt", alt) 4640 c.urlParams_.Set("prettyPrint", "false") 4641 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}/operations") 4642 urls += "?" + c.urlParams_.Encode() 4643 req, err := http.NewRequest("GET", urls, body) 4644 if err != nil { 4645 return nil, err 4646 } 4647 req.Header = reqHeaders 4648 googleapi.Expand(req.URL, map[string]string{ 4649 "name": c.name, 4650 }) 4651 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4652} 4653 4654// Do executes the "retail.projects.locations.catalogs.operations.list" call. 4655// Exactly one of *GoogleLongrunningListOperationsResponse or error will 4656// be non-nil. Any non-2xx status code is an error. Response headers are 4657// in either 4658// *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if 4659// a response was returned at all) in error.(*googleapi.Error).Header. 4660// Use googleapi.IsNotModified to check whether the returned error was 4661// because http.StatusNotModified was returned. 4662func (c *ProjectsLocationsCatalogsOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { 4663 gensupport.SetOptions(c.urlParams_, opts...) 4664 res, err := c.doRequest("json") 4665 if res != nil && res.StatusCode == http.StatusNotModified { 4666 if res.Body != nil { 4667 res.Body.Close() 4668 } 4669 return nil, &googleapi.Error{ 4670 Code: res.StatusCode, 4671 Header: res.Header, 4672 } 4673 } 4674 if err != nil { 4675 return nil, err 4676 } 4677 defer googleapi.CloseBody(res) 4678 if err := googleapi.CheckResponse(res); err != nil { 4679 return nil, err 4680 } 4681 ret := &GoogleLongrunningListOperationsResponse{ 4682 ServerResponse: googleapi.ServerResponse{ 4683 Header: res.Header, 4684 HTTPStatusCode: res.StatusCode, 4685 }, 4686 } 4687 target := &ret 4688 if err := gensupport.DecodeResponse(target, res); err != nil { 4689 return nil, err 4690 } 4691 return ret, nil 4692 // { 4693 // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/*/operations`. To override the binding, API services can add a binding such as `\"/v1/{name=users/*}/operations\"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.", 4694 // "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/operations", 4695 // "httpMethod": "GET", 4696 // "id": "retail.projects.locations.catalogs.operations.list", 4697 // "parameterOrder": [ 4698 // "name" 4699 // ], 4700 // "parameters": { 4701 // "filter": { 4702 // "description": "The standard list filter.", 4703 // "location": "query", 4704 // "type": "string" 4705 // }, 4706 // "name": { 4707 // "description": "The name of the operation's parent resource.", 4708 // "location": "path", 4709 // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+$", 4710 // "required": true, 4711 // "type": "string" 4712 // }, 4713 // "pageSize": { 4714 // "description": "The standard list page size.", 4715 // "format": "int32", 4716 // "location": "query", 4717 // "type": "integer" 4718 // }, 4719 // "pageToken": { 4720 // "description": "The standard list page token.", 4721 // "location": "query", 4722 // "type": "string" 4723 // } 4724 // }, 4725 // "path": "v2alpha/{+name}/operations", 4726 // "response": { 4727 // "$ref": "GoogleLongrunningListOperationsResponse" 4728 // }, 4729 // "scopes": [ 4730 // "https://www.googleapis.com/auth/cloud-platform" 4731 // ] 4732 // } 4733 4734} 4735 4736// Pages invokes f for each page of results. 4737// A non-nil error returned from f will halt the iteration. 4738// The provided context supersedes any context provided to the Context method. 4739func (c *ProjectsLocationsCatalogsOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { 4740 c.ctx_ = ctx 4741 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 4742 for { 4743 x, err := c.Do() 4744 if err != nil { 4745 return err 4746 } 4747 if err := f(x); err != nil { 4748 return err 4749 } 4750 if x.NextPageToken == "" { 4751 return nil 4752 } 4753 c.PageToken(x.NextPageToken) 4754 } 4755} 4756 4757// method id "retail.projects.locations.catalogs.placements.predict": 4758 4759type ProjectsLocationsCatalogsPlacementsPredictCall struct { 4760 s *Service 4761 placement string 4762 googlecloudretailv2alphapredictrequest *GoogleCloudRetailV2alphaPredictRequest 4763 urlParams_ gensupport.URLParams 4764 ctx_ context.Context 4765 header_ http.Header 4766} 4767 4768// Predict: Makes a recommendation prediction. 4769// 4770// - placement: Full resource name of the format: 4771// {name=projects/*/locations/global/catalogs/default_catalog/placement 4772// s/*} The ID of the Recommendations AI placement. Before you can 4773// request predictions from your model, you must create at least one 4774// placement for it. For more information, see Managing placements 4775// (https://cloud.google.com/retail/recommendations-ai/docs/manage-placements). 4776// The full list of available placements can be seen at 4777// https://console.cloud.google.com/recommendation/catalogs/default_catalog/placements. 4778func (r *ProjectsLocationsCatalogsPlacementsService) Predict(placement string, googlecloudretailv2alphapredictrequest *GoogleCloudRetailV2alphaPredictRequest) *ProjectsLocationsCatalogsPlacementsPredictCall { 4779 c := &ProjectsLocationsCatalogsPlacementsPredictCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4780 c.placement = placement 4781 c.googlecloudretailv2alphapredictrequest = googlecloudretailv2alphapredictrequest 4782 return c 4783} 4784 4785// Fields allows partial responses to be retrieved. See 4786// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4787// for more information. 4788func (c *ProjectsLocationsCatalogsPlacementsPredictCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsPlacementsPredictCall { 4789 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4790 return c 4791} 4792 4793// Context sets the context to be used in this call's Do method. Any 4794// pending HTTP request will be aborted if the provided context is 4795// canceled. 4796func (c *ProjectsLocationsCatalogsPlacementsPredictCall) Context(ctx context.Context) *ProjectsLocationsCatalogsPlacementsPredictCall { 4797 c.ctx_ = ctx 4798 return c 4799} 4800 4801// Header returns an http.Header that can be modified by the caller to 4802// add HTTP headers to the request. 4803func (c *ProjectsLocationsCatalogsPlacementsPredictCall) Header() http.Header { 4804 if c.header_ == nil { 4805 c.header_ = make(http.Header) 4806 } 4807 return c.header_ 4808} 4809 4810func (c *ProjectsLocationsCatalogsPlacementsPredictCall) doRequest(alt string) (*http.Response, error) { 4811 reqHeaders := make(http.Header) 4812 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 4813 for k, v := range c.header_ { 4814 reqHeaders[k] = v 4815 } 4816 reqHeaders.Set("User-Agent", c.s.userAgent()) 4817 var body io.Reader = nil 4818 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphapredictrequest) 4819 if err != nil { 4820 return nil, err 4821 } 4822 reqHeaders.Set("Content-Type", "application/json") 4823 c.urlParams_.Set("alt", alt) 4824 c.urlParams_.Set("prettyPrint", "false") 4825 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+placement}:predict") 4826 urls += "?" + c.urlParams_.Encode() 4827 req, err := http.NewRequest("POST", urls, body) 4828 if err != nil { 4829 return nil, err 4830 } 4831 req.Header = reqHeaders 4832 googleapi.Expand(req.URL, map[string]string{ 4833 "placement": c.placement, 4834 }) 4835 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4836} 4837 4838// Do executes the "retail.projects.locations.catalogs.placements.predict" call. 4839// Exactly one of *GoogleCloudRetailV2alphaPredictResponse or error will 4840// be non-nil. Any non-2xx status code is an error. Response headers are 4841// in either 4842// *GoogleCloudRetailV2alphaPredictResponse.ServerResponse.Header or (if 4843// a response was returned at all) in error.(*googleapi.Error).Header. 4844// Use googleapi.IsNotModified to check whether the returned error was 4845// because http.StatusNotModified was returned. 4846func (c *ProjectsLocationsCatalogsPlacementsPredictCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2alphaPredictResponse, error) { 4847 gensupport.SetOptions(c.urlParams_, opts...) 4848 res, err := c.doRequest("json") 4849 if res != nil && res.StatusCode == http.StatusNotModified { 4850 if res.Body != nil { 4851 res.Body.Close() 4852 } 4853 return nil, &googleapi.Error{ 4854 Code: res.StatusCode, 4855 Header: res.Header, 4856 } 4857 } 4858 if err != nil { 4859 return nil, err 4860 } 4861 defer googleapi.CloseBody(res) 4862 if err := googleapi.CheckResponse(res); err != nil { 4863 return nil, err 4864 } 4865 ret := &GoogleCloudRetailV2alphaPredictResponse{ 4866 ServerResponse: googleapi.ServerResponse{ 4867 Header: res.Header, 4868 HTTPStatusCode: res.StatusCode, 4869 }, 4870 } 4871 target := &ret 4872 if err := gensupport.DecodeResponse(target, res); err != nil { 4873 return nil, err 4874 } 4875 return ret, nil 4876 // { 4877 // "description": "Makes a recommendation prediction.", 4878 // "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/placements/{placementsId}:predict", 4879 // "httpMethod": "POST", 4880 // "id": "retail.projects.locations.catalogs.placements.predict", 4881 // "parameterOrder": [ 4882 // "placement" 4883 // ], 4884 // "parameters": { 4885 // "placement": { 4886 // "description": "Required. Full resource name of the format: {name=projects/*/locations/global/catalogs/default_catalog/placements/*} The ID of the Recommendations AI placement. Before you can request predictions from your model, you must create at least one placement for it. For more information, see [Managing placements](https://cloud.google.com/retail/recommendations-ai/docs/manage-placements). The full list of available placements can be seen at https://console.cloud.google.com/recommendation/catalogs/default_catalog/placements", 4887 // "location": "path", 4888 // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+/placements/[^/]+$", 4889 // "required": true, 4890 // "type": "string" 4891 // } 4892 // }, 4893 // "path": "v2alpha/{+placement}:predict", 4894 // "request": { 4895 // "$ref": "GoogleCloudRetailV2alphaPredictRequest" 4896 // }, 4897 // "response": { 4898 // "$ref": "GoogleCloudRetailV2alphaPredictResponse" 4899 // }, 4900 // "scopes": [ 4901 // "https://www.googleapis.com/auth/cloud-platform" 4902 // ] 4903 // } 4904 4905} 4906 4907// method id "retail.projects.locations.catalogs.userEvents.collect": 4908 4909type ProjectsLocationsCatalogsUserEventsCollectCall struct { 4910 s *Service 4911 parent string 4912 urlParams_ gensupport.URLParams 4913 ifNoneMatch_ string 4914 ctx_ context.Context 4915 header_ http.Header 4916} 4917 4918// Collect: Writes a single user event from the browser. This uses a GET 4919// request to due to browser restriction of POST-ing to a 3rd party 4920// domain. This method is used only by the Retail API JavaScript pixel 4921// and Google Tag Manager. Users should not call this method directly. 4922// 4923// - parent: The parent catalog name, such as 4924// `projects/1234/locations/global/catalogs/default_catalog`. 4925func (r *ProjectsLocationsCatalogsUserEventsService) Collect(parent string) *ProjectsLocationsCatalogsUserEventsCollectCall { 4926 c := &ProjectsLocationsCatalogsUserEventsCollectCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4927 c.parent = parent 4928 return c 4929} 4930 4931// Ets sets the optional parameter "ets": The event timestamp in 4932// milliseconds. This prevents browser caching of otherwise identical 4933// get requests. The name is abbreviated to reduce the payload bytes. 4934func (c *ProjectsLocationsCatalogsUserEventsCollectCall) Ets(ets int64) *ProjectsLocationsCatalogsUserEventsCollectCall { 4935 c.urlParams_.Set("ets", fmt.Sprint(ets)) 4936 return c 4937} 4938 4939// Uri sets the optional parameter "uri": The URL including 4940// cgi-parameters but excluding the hash fragment with a length limit of 4941// 5,000 characters. This is often more useful than the referer URL, 4942// because many browsers only send the domain for 3rd party requests. 4943func (c *ProjectsLocationsCatalogsUserEventsCollectCall) Uri(uri string) *ProjectsLocationsCatalogsUserEventsCollectCall { 4944 c.urlParams_.Set("uri", uri) 4945 return c 4946} 4947 4948// UserEvent sets the optional parameter "userEvent": Required. URL 4949// encoded UserEvent proto with a length limit of 2,000,000 characters. 4950func (c *ProjectsLocationsCatalogsUserEventsCollectCall) UserEvent(userEvent string) *ProjectsLocationsCatalogsUserEventsCollectCall { 4951 c.urlParams_.Set("userEvent", userEvent) 4952 return c 4953} 4954 4955// Fields allows partial responses to be retrieved. See 4956// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4957// for more information. 4958func (c *ProjectsLocationsCatalogsUserEventsCollectCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsUserEventsCollectCall { 4959 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4960 return c 4961} 4962 4963// IfNoneMatch sets the optional parameter which makes the operation 4964// fail if the object's ETag matches the given value. This is useful for 4965// getting updates only after the object has changed since the last 4966// request. Use googleapi.IsNotModified to check whether the response 4967// error from Do is the result of In-None-Match. 4968func (c *ProjectsLocationsCatalogsUserEventsCollectCall) IfNoneMatch(entityTag string) *ProjectsLocationsCatalogsUserEventsCollectCall { 4969 c.ifNoneMatch_ = entityTag 4970 return c 4971} 4972 4973// Context sets the context to be used in this call's Do method. Any 4974// pending HTTP request will be aborted if the provided context is 4975// canceled. 4976func (c *ProjectsLocationsCatalogsUserEventsCollectCall) Context(ctx context.Context) *ProjectsLocationsCatalogsUserEventsCollectCall { 4977 c.ctx_ = ctx 4978 return c 4979} 4980 4981// Header returns an http.Header that can be modified by the caller to 4982// add HTTP headers to the request. 4983func (c *ProjectsLocationsCatalogsUserEventsCollectCall) Header() http.Header { 4984 if c.header_ == nil { 4985 c.header_ = make(http.Header) 4986 } 4987 return c.header_ 4988} 4989 4990func (c *ProjectsLocationsCatalogsUserEventsCollectCall) doRequest(alt string) (*http.Response, error) { 4991 reqHeaders := make(http.Header) 4992 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 4993 for k, v := range c.header_ { 4994 reqHeaders[k] = v 4995 } 4996 reqHeaders.Set("User-Agent", c.s.userAgent()) 4997 if c.ifNoneMatch_ != "" { 4998 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4999 } 5000 var body io.Reader = nil 5001 c.urlParams_.Set("alt", alt) 5002 c.urlParams_.Set("prettyPrint", "false") 5003 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+parent}/userEvents:collect") 5004 urls += "?" + c.urlParams_.Encode() 5005 req, err := http.NewRequest("GET", urls, body) 5006 if err != nil { 5007 return nil, err 5008 } 5009 req.Header = reqHeaders 5010 googleapi.Expand(req.URL, map[string]string{ 5011 "parent": c.parent, 5012 }) 5013 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5014} 5015 5016// Do executes the "retail.projects.locations.catalogs.userEvents.collect" call. 5017// Exactly one of *GoogleApiHttpBody or error will be non-nil. Any 5018// non-2xx status code is an error. Response headers are in either 5019// *GoogleApiHttpBody.ServerResponse.Header or (if a response was 5020// returned at all) in error.(*googleapi.Error).Header. Use 5021// googleapi.IsNotModified to check whether the returned error was 5022// because http.StatusNotModified was returned. 5023func (c *ProjectsLocationsCatalogsUserEventsCollectCall) Do(opts ...googleapi.CallOption) (*GoogleApiHttpBody, error) { 5024 gensupport.SetOptions(c.urlParams_, opts...) 5025 res, err := c.doRequest("json") 5026 if res != nil && res.StatusCode == http.StatusNotModified { 5027 if res.Body != nil { 5028 res.Body.Close() 5029 } 5030 return nil, &googleapi.Error{ 5031 Code: res.StatusCode, 5032 Header: res.Header, 5033 } 5034 } 5035 if err != nil { 5036 return nil, err 5037 } 5038 defer googleapi.CloseBody(res) 5039 if err := googleapi.CheckResponse(res); err != nil { 5040 return nil, err 5041 } 5042 ret := &GoogleApiHttpBody{ 5043 ServerResponse: googleapi.ServerResponse{ 5044 Header: res.Header, 5045 HTTPStatusCode: res.StatusCode, 5046 }, 5047 } 5048 target := &ret 5049 if err := gensupport.DecodeResponse(target, res); err != nil { 5050 return nil, err 5051 } 5052 return ret, nil 5053 // { 5054 // "description": "Writes a single user event from the browser. This uses a GET request to due to browser restriction of POST-ing to a 3rd party domain. This method is used only by the Retail API JavaScript pixel and Google Tag Manager. Users should not call this method directly.", 5055 // "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/userEvents:collect", 5056 // "httpMethod": "GET", 5057 // "id": "retail.projects.locations.catalogs.userEvents.collect", 5058 // "parameterOrder": [ 5059 // "parent" 5060 // ], 5061 // "parameters": { 5062 // "ets": { 5063 // "description": "The event timestamp in milliseconds. This prevents browser caching of otherwise identical get requests. The name is abbreviated to reduce the payload bytes.", 5064 // "format": "int64", 5065 // "location": "query", 5066 // "type": "string" 5067 // }, 5068 // "parent": { 5069 // "description": "Required. The parent catalog name, such as `projects/1234/locations/global/catalogs/default_catalog`.", 5070 // "location": "path", 5071 // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+$", 5072 // "required": true, 5073 // "type": "string" 5074 // }, 5075 // "uri": { 5076 // "description": "The URL including cgi-parameters but excluding the hash fragment with a length limit of 5,000 characters. This is often more useful than the referer URL, because many browsers only send the domain for 3rd party requests.", 5077 // "location": "query", 5078 // "type": "string" 5079 // }, 5080 // "userEvent": { 5081 // "description": "Required. URL encoded UserEvent proto with a length limit of 2,000,000 characters.", 5082 // "location": "query", 5083 // "type": "string" 5084 // } 5085 // }, 5086 // "path": "v2alpha/{+parent}/userEvents:collect", 5087 // "response": { 5088 // "$ref": "GoogleApiHttpBody" 5089 // }, 5090 // "scopes": [ 5091 // "https://www.googleapis.com/auth/cloud-platform" 5092 // ] 5093 // } 5094 5095} 5096 5097// method id "retail.projects.locations.catalogs.userEvents.import": 5098 5099type ProjectsLocationsCatalogsUserEventsImportCall struct { 5100 s *Service 5101 parent string 5102 googlecloudretailv2alphaimportusereventsrequest *GoogleCloudRetailV2alphaImportUserEventsRequest 5103 urlParams_ gensupport.URLParams 5104 ctx_ context.Context 5105 header_ http.Header 5106} 5107 5108// Import: Bulk import of User events. Request processing might be 5109// synchronous. Events that already exist are skipped. Use this method 5110// for backfilling historical user events. Operation.response is of type 5111// ImportResponse. Note that it is possible for a subset of the items to 5112// be successfully inserted. Operation.metadata is of type 5113// ImportMetadata. 5114// 5115// - parent: `projects/1234/locations/global/catalogs/default_catalog`. 5116func (r *ProjectsLocationsCatalogsUserEventsService) Import(parent string, googlecloudretailv2alphaimportusereventsrequest *GoogleCloudRetailV2alphaImportUserEventsRequest) *ProjectsLocationsCatalogsUserEventsImportCall { 5117 c := &ProjectsLocationsCatalogsUserEventsImportCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5118 c.parent = parent 5119 c.googlecloudretailv2alphaimportusereventsrequest = googlecloudretailv2alphaimportusereventsrequest 5120 return c 5121} 5122 5123// Fields allows partial responses to be retrieved. See 5124// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5125// for more information. 5126func (c *ProjectsLocationsCatalogsUserEventsImportCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsUserEventsImportCall { 5127 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5128 return c 5129} 5130 5131// Context sets the context to be used in this call's Do method. Any 5132// pending HTTP request will be aborted if the provided context is 5133// canceled. 5134func (c *ProjectsLocationsCatalogsUserEventsImportCall) Context(ctx context.Context) *ProjectsLocationsCatalogsUserEventsImportCall { 5135 c.ctx_ = ctx 5136 return c 5137} 5138 5139// Header returns an http.Header that can be modified by the caller to 5140// add HTTP headers to the request. 5141func (c *ProjectsLocationsCatalogsUserEventsImportCall) Header() http.Header { 5142 if c.header_ == nil { 5143 c.header_ = make(http.Header) 5144 } 5145 return c.header_ 5146} 5147 5148func (c *ProjectsLocationsCatalogsUserEventsImportCall) doRequest(alt string) (*http.Response, error) { 5149 reqHeaders := make(http.Header) 5150 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 5151 for k, v := range c.header_ { 5152 reqHeaders[k] = v 5153 } 5154 reqHeaders.Set("User-Agent", c.s.userAgent()) 5155 var body io.Reader = nil 5156 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphaimportusereventsrequest) 5157 if err != nil { 5158 return nil, err 5159 } 5160 reqHeaders.Set("Content-Type", "application/json") 5161 c.urlParams_.Set("alt", alt) 5162 c.urlParams_.Set("prettyPrint", "false") 5163 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+parent}/userEvents:import") 5164 urls += "?" + c.urlParams_.Encode() 5165 req, err := http.NewRequest("POST", urls, body) 5166 if err != nil { 5167 return nil, err 5168 } 5169 req.Header = reqHeaders 5170 googleapi.Expand(req.URL, map[string]string{ 5171 "parent": c.parent, 5172 }) 5173 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5174} 5175 5176// Do executes the "retail.projects.locations.catalogs.userEvents.import" call. 5177// Exactly one of *GoogleLongrunningOperation or error will be non-nil. 5178// Any non-2xx status code is an error. Response headers are in either 5179// *GoogleLongrunningOperation.ServerResponse.Header or (if a response 5180// was returned at all) in error.(*googleapi.Error).Header. Use 5181// googleapi.IsNotModified to check whether the returned error was 5182// because http.StatusNotModified was returned. 5183func (c *ProjectsLocationsCatalogsUserEventsImportCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 5184 gensupport.SetOptions(c.urlParams_, opts...) 5185 res, err := c.doRequest("json") 5186 if res != nil && res.StatusCode == http.StatusNotModified { 5187 if res.Body != nil { 5188 res.Body.Close() 5189 } 5190 return nil, &googleapi.Error{ 5191 Code: res.StatusCode, 5192 Header: res.Header, 5193 } 5194 } 5195 if err != nil { 5196 return nil, err 5197 } 5198 defer googleapi.CloseBody(res) 5199 if err := googleapi.CheckResponse(res); err != nil { 5200 return nil, err 5201 } 5202 ret := &GoogleLongrunningOperation{ 5203 ServerResponse: googleapi.ServerResponse{ 5204 Header: res.Header, 5205 HTTPStatusCode: res.StatusCode, 5206 }, 5207 } 5208 target := &ret 5209 if err := gensupport.DecodeResponse(target, res); err != nil { 5210 return nil, err 5211 } 5212 return ret, nil 5213 // { 5214 // "description": "Bulk import of User events. Request processing might be synchronous. Events that already exist are skipped. Use this method for backfilling historical user events. Operation.response is of type ImportResponse. Note that it is possible for a subset of the items to be successfully inserted. Operation.metadata is of type ImportMetadata.", 5215 // "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/userEvents:import", 5216 // "httpMethod": "POST", 5217 // "id": "retail.projects.locations.catalogs.userEvents.import", 5218 // "parameterOrder": [ 5219 // "parent" 5220 // ], 5221 // "parameters": { 5222 // "parent": { 5223 // "description": "Required. `projects/1234/locations/global/catalogs/default_catalog`", 5224 // "location": "path", 5225 // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+$", 5226 // "required": true, 5227 // "type": "string" 5228 // } 5229 // }, 5230 // "path": "v2alpha/{+parent}/userEvents:import", 5231 // "request": { 5232 // "$ref": "GoogleCloudRetailV2alphaImportUserEventsRequest" 5233 // }, 5234 // "response": { 5235 // "$ref": "GoogleLongrunningOperation" 5236 // }, 5237 // "scopes": [ 5238 // "https://www.googleapis.com/auth/cloud-platform" 5239 // ] 5240 // } 5241 5242} 5243 5244// method id "retail.projects.locations.catalogs.userEvents.purge": 5245 5246type ProjectsLocationsCatalogsUserEventsPurgeCall struct { 5247 s *Service 5248 parent string 5249 googlecloudretailv2alphapurgeusereventsrequest *GoogleCloudRetailV2alphaPurgeUserEventsRequest 5250 urlParams_ gensupport.URLParams 5251 ctx_ context.Context 5252 header_ http.Header 5253} 5254 5255// Purge: Deletes permanently all user events specified by the filter 5256// provided. Depending on the number of events specified by the filter, 5257// this operation could take hours or days to complete. To test a 5258// filter, use the list command first. 5259// 5260// - parent: The resource name of the catalog under which the events are 5261// created. The format is 5262// `projects/${projectId}/locations/global/catalogs/${catalogId}`. 5263func (r *ProjectsLocationsCatalogsUserEventsService) Purge(parent string, googlecloudretailv2alphapurgeusereventsrequest *GoogleCloudRetailV2alphaPurgeUserEventsRequest) *ProjectsLocationsCatalogsUserEventsPurgeCall { 5264 c := &ProjectsLocationsCatalogsUserEventsPurgeCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5265 c.parent = parent 5266 c.googlecloudretailv2alphapurgeusereventsrequest = googlecloudretailv2alphapurgeusereventsrequest 5267 return c 5268} 5269 5270// Fields allows partial responses to be retrieved. See 5271// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5272// for more information. 5273func (c *ProjectsLocationsCatalogsUserEventsPurgeCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsUserEventsPurgeCall { 5274 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5275 return c 5276} 5277 5278// Context sets the context to be used in this call's Do method. Any 5279// pending HTTP request will be aborted if the provided context is 5280// canceled. 5281func (c *ProjectsLocationsCatalogsUserEventsPurgeCall) Context(ctx context.Context) *ProjectsLocationsCatalogsUserEventsPurgeCall { 5282 c.ctx_ = ctx 5283 return c 5284} 5285 5286// Header returns an http.Header that can be modified by the caller to 5287// add HTTP headers to the request. 5288func (c *ProjectsLocationsCatalogsUserEventsPurgeCall) Header() http.Header { 5289 if c.header_ == nil { 5290 c.header_ = make(http.Header) 5291 } 5292 return c.header_ 5293} 5294 5295func (c *ProjectsLocationsCatalogsUserEventsPurgeCall) doRequest(alt string) (*http.Response, error) { 5296 reqHeaders := make(http.Header) 5297 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 5298 for k, v := range c.header_ { 5299 reqHeaders[k] = v 5300 } 5301 reqHeaders.Set("User-Agent", c.s.userAgent()) 5302 var body io.Reader = nil 5303 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphapurgeusereventsrequest) 5304 if err != nil { 5305 return nil, err 5306 } 5307 reqHeaders.Set("Content-Type", "application/json") 5308 c.urlParams_.Set("alt", alt) 5309 c.urlParams_.Set("prettyPrint", "false") 5310 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+parent}/userEvents:purge") 5311 urls += "?" + c.urlParams_.Encode() 5312 req, err := http.NewRequest("POST", urls, body) 5313 if err != nil { 5314 return nil, err 5315 } 5316 req.Header = reqHeaders 5317 googleapi.Expand(req.URL, map[string]string{ 5318 "parent": c.parent, 5319 }) 5320 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5321} 5322 5323// Do executes the "retail.projects.locations.catalogs.userEvents.purge" call. 5324// Exactly one of *GoogleLongrunningOperation or error will be non-nil. 5325// Any non-2xx status code is an error. Response headers are in either 5326// *GoogleLongrunningOperation.ServerResponse.Header or (if a response 5327// was returned at all) in error.(*googleapi.Error).Header. Use 5328// googleapi.IsNotModified to check whether the returned error was 5329// because http.StatusNotModified was returned. 5330func (c *ProjectsLocationsCatalogsUserEventsPurgeCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 5331 gensupport.SetOptions(c.urlParams_, opts...) 5332 res, err := c.doRequest("json") 5333 if res != nil && res.StatusCode == http.StatusNotModified { 5334 if res.Body != nil { 5335 res.Body.Close() 5336 } 5337 return nil, &googleapi.Error{ 5338 Code: res.StatusCode, 5339 Header: res.Header, 5340 } 5341 } 5342 if err != nil { 5343 return nil, err 5344 } 5345 defer googleapi.CloseBody(res) 5346 if err := googleapi.CheckResponse(res); err != nil { 5347 return nil, err 5348 } 5349 ret := &GoogleLongrunningOperation{ 5350 ServerResponse: googleapi.ServerResponse{ 5351 Header: res.Header, 5352 HTTPStatusCode: res.StatusCode, 5353 }, 5354 } 5355 target := &ret 5356 if err := gensupport.DecodeResponse(target, res); err != nil { 5357 return nil, err 5358 } 5359 return ret, nil 5360 // { 5361 // "description": "Deletes permanently all user events specified by the filter provided. Depending on the number of events specified by the filter, this operation could take hours or days to complete. To test a filter, use the list command first.", 5362 // "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/userEvents:purge", 5363 // "httpMethod": "POST", 5364 // "id": "retail.projects.locations.catalogs.userEvents.purge", 5365 // "parameterOrder": [ 5366 // "parent" 5367 // ], 5368 // "parameters": { 5369 // "parent": { 5370 // "description": "Required. The resource name of the catalog under which the events are created. The format is `projects/${projectId}/locations/global/catalogs/${catalogId}`", 5371 // "location": "path", 5372 // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+$", 5373 // "required": true, 5374 // "type": "string" 5375 // } 5376 // }, 5377 // "path": "v2alpha/{+parent}/userEvents:purge", 5378 // "request": { 5379 // "$ref": "GoogleCloudRetailV2alphaPurgeUserEventsRequest" 5380 // }, 5381 // "response": { 5382 // "$ref": "GoogleLongrunningOperation" 5383 // }, 5384 // "scopes": [ 5385 // "https://www.googleapis.com/auth/cloud-platform" 5386 // ] 5387 // } 5388 5389} 5390 5391// method id "retail.projects.locations.catalogs.userEvents.rejoin": 5392 5393type ProjectsLocationsCatalogsUserEventsRejoinCall struct { 5394 s *Service 5395 parent string 5396 googlecloudretailv2alpharejoinusereventsrequest *GoogleCloudRetailV2alphaRejoinUserEventsRequest 5397 urlParams_ gensupport.URLParams 5398 ctx_ context.Context 5399 header_ http.Header 5400} 5401 5402// Rejoin: Triggers a user event rejoin operation with latest product 5403// catalog. Events will not be annotated with detailed product 5404// information if product is missing from the catalog at the time the 5405// user event is ingested, and these events are stored as unjoined 5406// events with a limited usage on training and serving. This API can be 5407// used to trigger a 'join' operation on specified events with latest 5408// version of product catalog. It can also be used to correct events 5409// joined with wrong product catalog. 5410// 5411// - parent: The parent catalog resource name, such as 5412// `projects/1234/locations/global/catalogs/default_catalog`. 5413func (r *ProjectsLocationsCatalogsUserEventsService) Rejoin(parent string, googlecloudretailv2alpharejoinusereventsrequest *GoogleCloudRetailV2alphaRejoinUserEventsRequest) *ProjectsLocationsCatalogsUserEventsRejoinCall { 5414 c := &ProjectsLocationsCatalogsUserEventsRejoinCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5415 c.parent = parent 5416 c.googlecloudretailv2alpharejoinusereventsrequest = googlecloudretailv2alpharejoinusereventsrequest 5417 return c 5418} 5419 5420// Fields allows partial responses to be retrieved. See 5421// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5422// for more information. 5423func (c *ProjectsLocationsCatalogsUserEventsRejoinCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsUserEventsRejoinCall { 5424 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5425 return c 5426} 5427 5428// Context sets the context to be used in this call's Do method. Any 5429// pending HTTP request will be aborted if the provided context is 5430// canceled. 5431func (c *ProjectsLocationsCatalogsUserEventsRejoinCall) Context(ctx context.Context) *ProjectsLocationsCatalogsUserEventsRejoinCall { 5432 c.ctx_ = ctx 5433 return c 5434} 5435 5436// Header returns an http.Header that can be modified by the caller to 5437// add HTTP headers to the request. 5438func (c *ProjectsLocationsCatalogsUserEventsRejoinCall) Header() http.Header { 5439 if c.header_ == nil { 5440 c.header_ = make(http.Header) 5441 } 5442 return c.header_ 5443} 5444 5445func (c *ProjectsLocationsCatalogsUserEventsRejoinCall) doRequest(alt string) (*http.Response, error) { 5446 reqHeaders := make(http.Header) 5447 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 5448 for k, v := range c.header_ { 5449 reqHeaders[k] = v 5450 } 5451 reqHeaders.Set("User-Agent", c.s.userAgent()) 5452 var body io.Reader = nil 5453 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alpharejoinusereventsrequest) 5454 if err != nil { 5455 return nil, err 5456 } 5457 reqHeaders.Set("Content-Type", "application/json") 5458 c.urlParams_.Set("alt", alt) 5459 c.urlParams_.Set("prettyPrint", "false") 5460 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+parent}/userEvents:rejoin") 5461 urls += "?" + c.urlParams_.Encode() 5462 req, err := http.NewRequest("POST", urls, body) 5463 if err != nil { 5464 return nil, err 5465 } 5466 req.Header = reqHeaders 5467 googleapi.Expand(req.URL, map[string]string{ 5468 "parent": c.parent, 5469 }) 5470 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5471} 5472 5473// Do executes the "retail.projects.locations.catalogs.userEvents.rejoin" call. 5474// Exactly one of *GoogleLongrunningOperation or error will be non-nil. 5475// Any non-2xx status code is an error. Response headers are in either 5476// *GoogleLongrunningOperation.ServerResponse.Header or (if a response 5477// was returned at all) in error.(*googleapi.Error).Header. Use 5478// googleapi.IsNotModified to check whether the returned error was 5479// because http.StatusNotModified was returned. 5480func (c *ProjectsLocationsCatalogsUserEventsRejoinCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 5481 gensupport.SetOptions(c.urlParams_, opts...) 5482 res, err := c.doRequest("json") 5483 if res != nil && res.StatusCode == http.StatusNotModified { 5484 if res.Body != nil { 5485 res.Body.Close() 5486 } 5487 return nil, &googleapi.Error{ 5488 Code: res.StatusCode, 5489 Header: res.Header, 5490 } 5491 } 5492 if err != nil { 5493 return nil, err 5494 } 5495 defer googleapi.CloseBody(res) 5496 if err := googleapi.CheckResponse(res); err != nil { 5497 return nil, err 5498 } 5499 ret := &GoogleLongrunningOperation{ 5500 ServerResponse: googleapi.ServerResponse{ 5501 Header: res.Header, 5502 HTTPStatusCode: res.StatusCode, 5503 }, 5504 } 5505 target := &ret 5506 if err := gensupport.DecodeResponse(target, res); err != nil { 5507 return nil, err 5508 } 5509 return ret, nil 5510 // { 5511 // "description": "Triggers a user event rejoin operation with latest product catalog. Events will not be annotated with detailed product information if product is missing from the catalog at the time the user event is ingested, and these events are stored as unjoined events with a limited usage on training and serving. This API can be used to trigger a 'join' operation on specified events with latest version of product catalog. It can also be used to correct events joined with wrong product catalog.", 5512 // "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/userEvents:rejoin", 5513 // "httpMethod": "POST", 5514 // "id": "retail.projects.locations.catalogs.userEvents.rejoin", 5515 // "parameterOrder": [ 5516 // "parent" 5517 // ], 5518 // "parameters": { 5519 // "parent": { 5520 // "description": "Required. The parent catalog resource name, such as `projects/1234/locations/global/catalogs/default_catalog`.", 5521 // "location": "path", 5522 // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+$", 5523 // "required": true, 5524 // "type": "string" 5525 // } 5526 // }, 5527 // "path": "v2alpha/{+parent}/userEvents:rejoin", 5528 // "request": { 5529 // "$ref": "GoogleCloudRetailV2alphaRejoinUserEventsRequest" 5530 // }, 5531 // "response": { 5532 // "$ref": "GoogleLongrunningOperation" 5533 // }, 5534 // "scopes": [ 5535 // "https://www.googleapis.com/auth/cloud-platform" 5536 // ] 5537 // } 5538 5539} 5540 5541// method id "retail.projects.locations.catalogs.userEvents.write": 5542 5543type ProjectsLocationsCatalogsUserEventsWriteCall struct { 5544 s *Service 5545 parent string 5546 googlecloudretailv2alphauserevent *GoogleCloudRetailV2alphaUserEvent 5547 urlParams_ gensupport.URLParams 5548 ctx_ context.Context 5549 header_ http.Header 5550} 5551 5552// Write: Writes a single user event. 5553// 5554// - parent: The parent catalog resource name, such as 5555// `projects/1234/locations/global/catalogs/default_catalog`. 5556func (r *ProjectsLocationsCatalogsUserEventsService) Write(parent string, googlecloudretailv2alphauserevent *GoogleCloudRetailV2alphaUserEvent) *ProjectsLocationsCatalogsUserEventsWriteCall { 5557 c := &ProjectsLocationsCatalogsUserEventsWriteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5558 c.parent = parent 5559 c.googlecloudretailv2alphauserevent = googlecloudretailv2alphauserevent 5560 return c 5561} 5562 5563// Fields allows partial responses to be retrieved. See 5564// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5565// for more information. 5566func (c *ProjectsLocationsCatalogsUserEventsWriteCall) Fields(s ...googleapi.Field) *ProjectsLocationsCatalogsUserEventsWriteCall { 5567 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5568 return c 5569} 5570 5571// Context sets the context to be used in this call's Do method. Any 5572// pending HTTP request will be aborted if the provided context is 5573// canceled. 5574func (c *ProjectsLocationsCatalogsUserEventsWriteCall) Context(ctx context.Context) *ProjectsLocationsCatalogsUserEventsWriteCall { 5575 c.ctx_ = ctx 5576 return c 5577} 5578 5579// Header returns an http.Header that can be modified by the caller to 5580// add HTTP headers to the request. 5581func (c *ProjectsLocationsCatalogsUserEventsWriteCall) Header() http.Header { 5582 if c.header_ == nil { 5583 c.header_ = make(http.Header) 5584 } 5585 return c.header_ 5586} 5587 5588func (c *ProjectsLocationsCatalogsUserEventsWriteCall) doRequest(alt string) (*http.Response, error) { 5589 reqHeaders := make(http.Header) 5590 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 5591 for k, v := range c.header_ { 5592 reqHeaders[k] = v 5593 } 5594 reqHeaders.Set("User-Agent", c.s.userAgent()) 5595 var body io.Reader = nil 5596 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudretailv2alphauserevent) 5597 if err != nil { 5598 return nil, err 5599 } 5600 reqHeaders.Set("Content-Type", "application/json") 5601 c.urlParams_.Set("alt", alt) 5602 c.urlParams_.Set("prettyPrint", "false") 5603 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+parent}/userEvents:write") 5604 urls += "?" + c.urlParams_.Encode() 5605 req, err := http.NewRequest("POST", urls, body) 5606 if err != nil { 5607 return nil, err 5608 } 5609 req.Header = reqHeaders 5610 googleapi.Expand(req.URL, map[string]string{ 5611 "parent": c.parent, 5612 }) 5613 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5614} 5615 5616// Do executes the "retail.projects.locations.catalogs.userEvents.write" call. 5617// Exactly one of *GoogleCloudRetailV2alphaUserEvent or error will be 5618// non-nil. Any non-2xx status code is an error. Response headers are in 5619// either *GoogleCloudRetailV2alphaUserEvent.ServerResponse.Header or 5620// (if a response was returned at all) in 5621// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 5622// whether the returned error was because http.StatusNotModified was 5623// returned. 5624func (c *ProjectsLocationsCatalogsUserEventsWriteCall) Do(opts ...googleapi.CallOption) (*GoogleCloudRetailV2alphaUserEvent, error) { 5625 gensupport.SetOptions(c.urlParams_, opts...) 5626 res, err := c.doRequest("json") 5627 if res != nil && res.StatusCode == http.StatusNotModified { 5628 if res.Body != nil { 5629 res.Body.Close() 5630 } 5631 return nil, &googleapi.Error{ 5632 Code: res.StatusCode, 5633 Header: res.Header, 5634 } 5635 } 5636 if err != nil { 5637 return nil, err 5638 } 5639 defer googleapi.CloseBody(res) 5640 if err := googleapi.CheckResponse(res); err != nil { 5641 return nil, err 5642 } 5643 ret := &GoogleCloudRetailV2alphaUserEvent{ 5644 ServerResponse: googleapi.ServerResponse{ 5645 Header: res.Header, 5646 HTTPStatusCode: res.StatusCode, 5647 }, 5648 } 5649 target := &ret 5650 if err := gensupport.DecodeResponse(target, res); err != nil { 5651 return nil, err 5652 } 5653 return ret, nil 5654 // { 5655 // "description": "Writes a single user event.", 5656 // "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/catalogs/{catalogsId}/userEvents:write", 5657 // "httpMethod": "POST", 5658 // "id": "retail.projects.locations.catalogs.userEvents.write", 5659 // "parameterOrder": [ 5660 // "parent" 5661 // ], 5662 // "parameters": { 5663 // "parent": { 5664 // "description": "Required. The parent catalog resource name, such as `projects/1234/locations/global/catalogs/default_catalog`.", 5665 // "location": "path", 5666 // "pattern": "^projects/[^/]+/locations/[^/]+/catalogs/[^/]+$", 5667 // "required": true, 5668 // "type": "string" 5669 // } 5670 // }, 5671 // "path": "v2alpha/{+parent}/userEvents:write", 5672 // "request": { 5673 // "$ref": "GoogleCloudRetailV2alphaUserEvent" 5674 // }, 5675 // "response": { 5676 // "$ref": "GoogleCloudRetailV2alphaUserEvent" 5677 // }, 5678 // "scopes": [ 5679 // "https://www.googleapis.com/auth/cloud-platform" 5680 // ] 5681 // } 5682 5683} 5684 5685// method id "retail.projects.locations.operations.get": 5686 5687type ProjectsLocationsOperationsGetCall struct { 5688 s *Service 5689 name string 5690 urlParams_ gensupport.URLParams 5691 ifNoneMatch_ string 5692 ctx_ context.Context 5693 header_ http.Header 5694} 5695 5696// Get: Gets the latest state of a long-running operation. Clients can 5697// use this method to poll the operation result at intervals as 5698// recommended by the API service. 5699// 5700// - name: The name of the operation resource. 5701func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall { 5702 c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5703 c.name = name 5704 return c 5705} 5706 5707// Fields allows partial responses to be retrieved. See 5708// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5709// for more information. 5710func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall { 5711 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5712 return c 5713} 5714 5715// IfNoneMatch sets the optional parameter which makes the operation 5716// fail if the object's ETag matches the given value. This is useful for 5717// getting updates only after the object has changed since the last 5718// request. Use googleapi.IsNotModified to check whether the response 5719// error from Do is the result of In-None-Match. 5720func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall { 5721 c.ifNoneMatch_ = entityTag 5722 return c 5723} 5724 5725// Context sets the context to be used in this call's Do method. Any 5726// pending HTTP request will be aborted if the provided context is 5727// canceled. 5728func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall { 5729 c.ctx_ = ctx 5730 return c 5731} 5732 5733// Header returns an http.Header that can be modified by the caller to 5734// add HTTP headers to the request. 5735func (c *ProjectsLocationsOperationsGetCall) Header() http.Header { 5736 if c.header_ == nil { 5737 c.header_ = make(http.Header) 5738 } 5739 return c.header_ 5740} 5741 5742func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) { 5743 reqHeaders := make(http.Header) 5744 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 5745 for k, v := range c.header_ { 5746 reqHeaders[k] = v 5747 } 5748 reqHeaders.Set("User-Agent", c.s.userAgent()) 5749 if c.ifNoneMatch_ != "" { 5750 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5751 } 5752 var body io.Reader = nil 5753 c.urlParams_.Set("alt", alt) 5754 c.urlParams_.Set("prettyPrint", "false") 5755 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") 5756 urls += "?" + c.urlParams_.Encode() 5757 req, err := http.NewRequest("GET", urls, body) 5758 if err != nil { 5759 return nil, err 5760 } 5761 req.Header = reqHeaders 5762 googleapi.Expand(req.URL, map[string]string{ 5763 "name": c.name, 5764 }) 5765 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5766} 5767 5768// Do executes the "retail.projects.locations.operations.get" call. 5769// Exactly one of *GoogleLongrunningOperation or error will be non-nil. 5770// Any non-2xx status code is an error. Response headers are in either 5771// *GoogleLongrunningOperation.ServerResponse.Header or (if a response 5772// was returned at all) in error.(*googleapi.Error).Header. Use 5773// googleapi.IsNotModified to check whether the returned error was 5774// because http.StatusNotModified was returned. 5775func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 5776 gensupport.SetOptions(c.urlParams_, opts...) 5777 res, err := c.doRequest("json") 5778 if res != nil && res.StatusCode == http.StatusNotModified { 5779 if res.Body != nil { 5780 res.Body.Close() 5781 } 5782 return nil, &googleapi.Error{ 5783 Code: res.StatusCode, 5784 Header: res.Header, 5785 } 5786 } 5787 if err != nil { 5788 return nil, err 5789 } 5790 defer googleapi.CloseBody(res) 5791 if err := googleapi.CheckResponse(res); err != nil { 5792 return nil, err 5793 } 5794 ret := &GoogleLongrunningOperation{ 5795 ServerResponse: googleapi.ServerResponse{ 5796 Header: res.Header, 5797 HTTPStatusCode: res.StatusCode, 5798 }, 5799 } 5800 target := &ret 5801 if err := gensupport.DecodeResponse(target, res); err != nil { 5802 return nil, err 5803 } 5804 return ret, nil 5805 // { 5806 // "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", 5807 // "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}", 5808 // "httpMethod": "GET", 5809 // "id": "retail.projects.locations.operations.get", 5810 // "parameterOrder": [ 5811 // "name" 5812 // ], 5813 // "parameters": { 5814 // "name": { 5815 // "description": "The name of the operation resource.", 5816 // "location": "path", 5817 // "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$", 5818 // "required": true, 5819 // "type": "string" 5820 // } 5821 // }, 5822 // "path": "v2alpha/{+name}", 5823 // "response": { 5824 // "$ref": "GoogleLongrunningOperation" 5825 // }, 5826 // "scopes": [ 5827 // "https://www.googleapis.com/auth/cloud-platform" 5828 // ] 5829 // } 5830 5831} 5832 5833// method id "retail.projects.locations.operations.list": 5834 5835type ProjectsLocationsOperationsListCall struct { 5836 s *Service 5837 name string 5838 urlParams_ gensupport.URLParams 5839 ifNoneMatch_ string 5840 ctx_ context.Context 5841 header_ http.Header 5842} 5843 5844// List: Lists operations that match the specified filter in the 5845// request. If the server doesn't support this method, it returns 5846// `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to 5847// override the binding to use different resource name schemes, such as 5848// `users/*/operations`. To override the binding, API services can add a 5849// binding such as "/v1/{name=users/*}/operations" to their service 5850// configuration. For backwards compatibility, the default name includes 5851// the operations collection id, however overriding users must ensure 5852// the name binding is the parent resource, without the operations 5853// collection id. 5854// 5855// - name: The name of the operation's parent resource. 5856func (r *ProjectsLocationsOperationsService) List(name string) *ProjectsLocationsOperationsListCall { 5857 c := &ProjectsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5858 c.name = name 5859 return c 5860} 5861 5862// Filter sets the optional parameter "filter": The standard list 5863// filter. 5864func (c *ProjectsLocationsOperationsListCall) Filter(filter string) *ProjectsLocationsOperationsListCall { 5865 c.urlParams_.Set("filter", filter) 5866 return c 5867} 5868 5869// PageSize sets the optional parameter "pageSize": The standard list 5870// page size. 5871func (c *ProjectsLocationsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsOperationsListCall { 5872 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 5873 return c 5874} 5875 5876// PageToken sets the optional parameter "pageToken": The standard list 5877// page token. 5878func (c *ProjectsLocationsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsOperationsListCall { 5879 c.urlParams_.Set("pageToken", pageToken) 5880 return c 5881} 5882 5883// Fields allows partial responses to be retrieved. See 5884// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5885// for more information. 5886func (c *ProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsListCall { 5887 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5888 return c 5889} 5890 5891// IfNoneMatch sets the optional parameter which makes the operation 5892// fail if the object's ETag matches the given value. This is useful for 5893// getting updates only after the object has changed since the last 5894// request. Use googleapi.IsNotModified to check whether the response 5895// error from Do is the result of In-None-Match. 5896func (c *ProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsListCall { 5897 c.ifNoneMatch_ = entityTag 5898 return c 5899} 5900 5901// Context sets the context to be used in this call's Do method. Any 5902// pending HTTP request will be aborted if the provided context is 5903// canceled. 5904func (c *ProjectsLocationsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsOperationsListCall { 5905 c.ctx_ = ctx 5906 return c 5907} 5908 5909// Header returns an http.Header that can be modified by the caller to 5910// add HTTP headers to the request. 5911func (c *ProjectsLocationsOperationsListCall) Header() http.Header { 5912 if c.header_ == nil { 5913 c.header_ = make(http.Header) 5914 } 5915 return c.header_ 5916} 5917 5918func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) { 5919 reqHeaders := make(http.Header) 5920 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 5921 for k, v := range c.header_ { 5922 reqHeaders[k] = v 5923 } 5924 reqHeaders.Set("User-Agent", c.s.userAgent()) 5925 if c.ifNoneMatch_ != "" { 5926 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5927 } 5928 var body io.Reader = nil 5929 c.urlParams_.Set("alt", alt) 5930 c.urlParams_.Set("prettyPrint", "false") 5931 urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}/operations") 5932 urls += "?" + c.urlParams_.Encode() 5933 req, err := http.NewRequest("GET", urls, body) 5934 if err != nil { 5935 return nil, err 5936 } 5937 req.Header = reqHeaders 5938 googleapi.Expand(req.URL, map[string]string{ 5939 "name": c.name, 5940 }) 5941 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5942} 5943 5944// Do executes the "retail.projects.locations.operations.list" call. 5945// Exactly one of *GoogleLongrunningListOperationsResponse or error will 5946// be non-nil. Any non-2xx status code is an error. Response headers are 5947// in either 5948// *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if 5949// a response was returned at all) in error.(*googleapi.Error).Header. 5950// Use googleapi.IsNotModified to check whether the returned error was 5951// because http.StatusNotModified was returned. 5952func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { 5953 gensupport.SetOptions(c.urlParams_, opts...) 5954 res, err := c.doRequest("json") 5955 if res != nil && res.StatusCode == http.StatusNotModified { 5956 if res.Body != nil { 5957 res.Body.Close() 5958 } 5959 return nil, &googleapi.Error{ 5960 Code: res.StatusCode, 5961 Header: res.Header, 5962 } 5963 } 5964 if err != nil { 5965 return nil, err 5966 } 5967 defer googleapi.CloseBody(res) 5968 if err := googleapi.CheckResponse(res); err != nil { 5969 return nil, err 5970 } 5971 ret := &GoogleLongrunningListOperationsResponse{ 5972 ServerResponse: googleapi.ServerResponse{ 5973 Header: res.Header, 5974 HTTPStatusCode: res.StatusCode, 5975 }, 5976 } 5977 target := &ret 5978 if err := gensupport.DecodeResponse(target, res); err != nil { 5979 return nil, err 5980 } 5981 return ret, nil 5982 // { 5983 // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/*/operations`. To override the binding, API services can add a binding such as `\"/v1/{name=users/*}/operations\"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.", 5984 // "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/operations", 5985 // "httpMethod": "GET", 5986 // "id": "retail.projects.locations.operations.list", 5987 // "parameterOrder": [ 5988 // "name" 5989 // ], 5990 // "parameters": { 5991 // "filter": { 5992 // "description": "The standard list filter.", 5993 // "location": "query", 5994 // "type": "string" 5995 // }, 5996 // "name": { 5997 // "description": "The name of the operation's parent resource.", 5998 // "location": "path", 5999 // "pattern": "^projects/[^/]+/locations/[^/]+$", 6000 // "required": true, 6001 // "type": "string" 6002 // }, 6003 // "pageSize": { 6004 // "description": "The standard list page size.", 6005 // "format": "int32", 6006 // "location": "query", 6007 // "type": "integer" 6008 // }, 6009 // "pageToken": { 6010 // "description": "The standard list page token.", 6011 // "location": "query", 6012 // "type": "string" 6013 // } 6014 // }, 6015 // "path": "v2alpha/{+name}/operations", 6016 // "response": { 6017 // "$ref": "GoogleLongrunningListOperationsResponse" 6018 // }, 6019 // "scopes": [ 6020 // "https://www.googleapis.com/auth/cloud-platform" 6021 // ] 6022 // } 6023 6024} 6025 6026// Pages invokes f for each page of results. 6027// A non-nil error returned from f will halt the iteration. 6028// The provided context supersedes any context provided to the Context method. 6029func (c *ProjectsLocationsOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { 6030 c.ctx_ = ctx 6031 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 6032 for { 6033 x, err := c.Do() 6034 if err != nil { 6035 return err 6036 } 6037 if err := f(x); err != nil { 6038 return err 6039 } 6040 if x.NextPageToken == "" { 6041 return nil 6042 } 6043 c.PageToken(x.NextPageToken) 6044 } 6045} 6046