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