From 83600d1533c9497bc6a7bf6ebe44acd04a3bd7dc Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 14 Dec 2022 20:27:01 -0800 Subject: [PATCH] feat: support async write mode for WriteUserEvent API (#3755) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: support async write mode for WriteUserEvent API feat: support collect and import GA4 event format with prebuilt whistle rule feat: support exact searchable and retrievable in catalog attribute config feat: deprecate retrievable_fields in product attribute feat: support diversity type in serving config feat: allow set feed id in merchant center link feat: support batch remove catalog attribute config feat: support attribute suggestion in autocomplete feat: support data output to GCS feat: expose the local inventory data in product data retrieval feat: return personal product labels in search response docs: keep the API doc up-to-date with recent changes PiperOrigin-RevId: 495450955 Source-Link: https://github.com/googleapis/googleapis/commit/4e4e58c442ca9f7b08b36bb8788c0d63ef70484e Source-Link: https://github.com/googleapis/googleapis-gen/commit/c8c05bffff889a77614526e4d3b90d41c75c31bc Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXJldGFpbC8uT3dsQm90LnlhbWwiLCJoIjoiYzhjMDViZmZmZjg4OWE3NzYxNDUyNmU0ZDNiOTBkNDFjNzVjMzFiYyJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot Co-authored-by: sofisl <55454395+sofisl@users.noreply.github.com> --- packages/google-cloud-retail/README.md | 1 + .../google/cloud/retail/v2alpha/catalog.proto | 89 +- .../retail/v2alpha/catalog_service.proto | 51 +- .../google/cloud/retail/v2alpha/common.proto | 15 +- .../retail/v2alpha/completion_service.proto | 33 +- .../google/cloud/retail/v2alpha/control.proto | 40 +- .../retail/v2alpha/control_service.proto | 7 +- .../cloud/retail/v2alpha/export_config.proto | 18 +- .../cloud/retail/v2alpha/import_config.proto | 69 +- .../google/cloud/retail/v2alpha/model.proto | 95 +- .../cloud/retail/v2alpha/model_service.proto | 47 +- .../retail/v2alpha/prediction_service.proto | 26 +- .../google/cloud/retail/v2alpha/product.proto | 40 +- .../retail/v2alpha/product_service.proto | 71 +- .../cloud/retail/v2alpha/search_service.proto | 55 +- .../cloud/retail/v2alpha/serving_config.proto | 68 +- .../v2alpha/serving_config_service.proto | 10 +- .../cloud/retail/v2alpha/user_event.proto | 2 +- .../retail/v2alpha/user_event_service.proto | 57 +- .../google-cloud-retail/protos/protos.d.ts | 842 ++++++- packages/google-cloud-retail/protos/protos.js | 2055 ++++++++++++++++- .../google-cloud-retail/protos/protos.json | 216 +- .../google-cloud-retail/samples/README.md | 18 + ...service.batch_remove_catalog_attributes.js | 70 + .../catalog_service.get_completion_config.js | 2 +- .../completion_service.complete_query.js | 10 +- ...mpletion_service.import_completion_data.js | 4 +- .../v2alpha/control_service.get_control.js | 2 +- .../v2alpha/model_service.create_model.js | 7 +- .../v2alpha/model_service.delete_model.js | 6 +- .../v2alpha/model_service.list_models.js | 2 +- .../v2alpha/model_service.pause_model.js | 2 +- .../v2alpha/model_service.resume_model.js | 2 +- .../v2alpha/model_service.tune_model.js | 2 +- .../v2alpha/model_service.update_model.js | 5 +- .../v2alpha/prediction_service.predict.js | 25 +- .../product_service.import_products.js | 20 +- .../v2alpha/search_service.search.js | 12 +- .../serving_config_service.add_control.js | 2 +- ...ng_config_service.delete_serving_config.js | 2 +- ...rving_config_service.get_serving_config.js | 2 +- ...ing_config_service.list_serving_configs.js | 2 +- .../serving_config_service.remove_control.js | 2 +- ..._metadata.google.cloud.retail.v2alpha.json | 102 +- .../user_event_service.collect_user_event.js | 12 + .../user_event_service.rejoin_user_events.js | 4 +- .../user_event_service.write_user_event.js | 7 + .../src/v2/catalog_service_client.ts | 3 + .../src/v2/completion_service_client.ts | 3 + .../src/v2/control_service_client.ts | 3 + .../src/v2/prediction_service_client.ts | 3 + .../src/v2/product_service_client.ts | 3 + .../src/v2/search_service_client.ts | 3 + .../src/v2/serving_config_service_client.ts | 3 + .../src/v2/user_event_service_client.ts | 3 + .../src/v2alpha/catalog_service_client.ts | 118 +- .../catalog_service_client_config.json | 5 + .../src/v2alpha/completion_service_client.ts | 26 +- .../src/v2alpha/control_service_client.ts | 13 +- .../src/v2alpha/gapic_metadata.json | 10 + .../src/v2alpha/model_service_client.ts | 45 +- .../src/v2alpha/prediction_service_client.ts | 31 +- .../src/v2alpha/product_service_client.ts | 98 +- .../src/v2alpha/search_service_client.ts | 49 +- .../v2alpha/serving_config_service_client.ts | 20 +- .../src/v2alpha/user_event_service_client.ts | 43 +- .../src/v2beta/catalog_service_client.ts | 3 + .../src/v2beta/completion_service_client.ts | 3 + .../src/v2beta/control_service_client.ts | 3 + .../src/v2beta/model_service_client.ts | 3 + .../src/v2beta/prediction_service_client.ts | 3 + .../src/v2beta/product_service_client.ts | 3 + .../src/v2beta/search_service_client.ts | 3 + .../v2beta/serving_config_service_client.ts | 3 + .../src/v2beta/user_event_service_client.ts | 3 + .../test/gapic_catalog_service_v2alpha.ts | 137 ++ 76 files changed, 4408 insertions(+), 469 deletions(-) create mode 100644 packages/google-cloud-retail/samples/generated/v2alpha/catalog_service.batch_remove_catalog_attributes.js diff --git a/packages/google-cloud-retail/README.md b/packages/google-cloud-retail/README.md index dd0aa0fdcef..4726bac0aca 100644 --- a/packages/google-cloud-retail/README.md +++ b/packages/google-cloud-retail/README.md @@ -130,6 +130,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | User_event_service.rejoin_user_events | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2/user_event_service.rejoin_user_events.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-retail/samples/generated/v2/user_event_service.rejoin_user_events.js,samples/README.md) | | User_event_service.write_user_event | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2/user_event_service.write_user_event.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-retail/samples/generated/v2/user_event_service.write_user_event.js,samples/README.md) | | Catalog_service.add_catalog_attribute | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2alpha/catalog_service.add_catalog_attribute.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-retail/samples/generated/v2alpha/catalog_service.add_catalog_attribute.js,samples/README.md) | +| Catalog_service.batch_remove_catalog_attributes | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2alpha/catalog_service.batch_remove_catalog_attributes.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-retail/samples/generated/v2alpha/catalog_service.batch_remove_catalog_attributes.js,samples/README.md) | | Catalog_service.get_attributes_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2alpha/catalog_service.get_attributes_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-retail/samples/generated/v2alpha/catalog_service.get_attributes_config.js,samples/README.md) | | Catalog_service.get_completion_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2alpha/catalog_service.get_completion_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-retail/samples/generated/v2alpha/catalog_service.get_completion_config.js,samples/README.md) | | Catalog_service.get_default_branch | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2alpha/catalog_service.get_default_branch.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-retail/samples/generated/v2alpha/catalog_service.get_default_branch.js,samples/README.md) | diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/catalog.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/catalog.proto index f6c114d7ca4..95b7dd9443d 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/catalog.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/catalog.proto @@ -104,8 +104,7 @@ message CatalogAttribute { // The status of the indexable option of a catalog attribute. enum IndexableOption { - // Value used when unset. Defaults to - // [INDEXABLE_ENABLED][google.cloud.retail.v2alpha.CatalogAttribute.IndexableOption.INDEXABLE_ENABLED]. + // Value used when unset. INDEXABLE_OPTION_UNSPECIFIED = 0; // Indexable option enabled for an attribute. @@ -117,8 +116,7 @@ message CatalogAttribute { // The status of the dynamic facetable option of a catalog attribute. enum DynamicFacetableOption { - // Value used when unset. Defaults to - // [DYNAMIC_FACETABLE_ENABLED][google.cloud.retail.v2alpha.CatalogAttribute.DynamicFacetableOption.DYNAMIC_FACETABLE_ENABLED]. + // Value used when unset. DYNAMIC_FACETABLE_OPTION_UNSPECIFIED = 0; // Dynamic facetable option enabled for an attribute. @@ -130,8 +128,7 @@ message CatalogAttribute { // The status of the searchable option of a catalog attribute. enum SearchableOption { - // Value used when unset. Defaults to - // [SEARCHABLE_DISABLED][google.cloud.retail.v2alpha.CatalogAttribute.SearchableOption.SEARCHABLE_DISABLED]. + // Value used when unset. SEARCHABLE_OPTION_UNSPECIFIED = 0; // Searchable option enabled for an attribute. @@ -141,6 +138,32 @@ message CatalogAttribute { SEARCHABLE_DISABLED = 2; } + // The status of the exact-searchable option of a catalog attribute. + enum ExactSearchableOption { + // Value used when unset. Defaults to + // [EXACT_SEARCHABLE_DISABLED][google.cloud.retail.v2alpha.CatalogAttribute.ExactSearchableOption.EXACT_SEARCHABLE_DISABLED]. + EXACT_SEARCHABLE_OPTION_UNSPECIFIED = 0; + + // Exact searchable option enabled for an attribute. + EXACT_SEARCHABLE_ENABLED = 1; + + // Exact searchable option disabled for an attribute. + EXACT_SEARCHABLE_DISABLED = 2; + } + + // The status of the retrievable option of a catalog attribute. + enum RetrievableOption { + // Value used when unset. Defaults to + // [RETRIEVABLE_DISABLED][google.cloud.retail.v2alpha.CatalogAttribute.RetrievableOption.RETRIEVABLE_DISABLED]. + RETRIEVABLE_OPTION_UNSPECIFIED = 0; + + // Retrievable option enabled for an attribute. + RETRIEVABLE_ENABLED = 1; + + // Retrievable option disabled for an attribute. + RETRIEVABLE_DISABLED = 2; + } + // Required. Attribute name. // For example: `color`, `brands`, `attributes.custom_attribute`, such as // `attributes.xyz`. @@ -165,13 +188,13 @@ message CatalogAttribute { // APIs. This field is `False` for pre-loaded // [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute]s. // - // Only pre-loaded - // [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute]s that are - // neither in use by products nor predefined can be deleted. - // [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute]s that are - // either in use by products or are predefined cannot be deleted; however, - // their configuration properties will reset to default values upon removal - // request. + // Only pre-loaded [catalog + // attributes][google.cloud.retail.v2alpha.CatalogAttribute] that are neither + // in use by products nor predefined can be deleted. [Catalog + // attributes][google.cloud.retail.v2alpha.CatalogAttribute] that are + // either in use by products or are predefined attributes cannot be deleted; + // however, their configuration properties will reset to default values upon + // removal request. // // After catalog changes, it takes about 10 minutes for this field to update. bool in_use = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; @@ -185,12 +208,16 @@ message CatalogAttribute { // is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if INDEXABLE_ENABLED attribute values // are indexed so that it can be filtered, faceted, or boosted in // [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]. + // + // Must be specified, otherwise throws INVALID_FORMAT error. IndexableOption indexable_option = 5; // If DYNAMIC_FACETABLE_ENABLED, attribute values are available for dynamic // facet. Could only be DYNAMIC_FACETABLE_DISABLED if // [CatalogAttribute.indexable_option][google.cloud.retail.v2alpha.CatalogAttribute.indexable_option] // is INDEXABLE_DISABLED. Otherwise, an INVALID_ARGUMENT error is returned. + // + // Must be specified, otherwise throws INVALID_FORMAT error. DynamicFacetableOption dynamic_facetable_option = 6; // When @@ -203,6 +230,8 @@ message CatalogAttribute { // will not be searchable by text queries in // [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search], // as there are no text values associated to numerical attributes. + // + // Must be specified, otherwise throws INVALID_FORMAT error. SearchableOption searchable_option = 7; // When @@ -212,6 +241,15 @@ message CatalogAttribute { // This option works for categorical features only, // does not work for numerical features, inventory filtering. RecommendationsFilteringOption recommendations_filtering_option = 8; + + // If EXACT_SEARCHABLE_ENABLED, attribute values will be exact searchable. + // This property only applies to textual custom attributes and requires + // indexable set to enabled to enable exact-searchable. + ExactSearchableOption exact_searchable_option = 11; + + // If RETRIEVABLE_ENABLED, attribute values are retrievable in the search + // results. + RetrievableOption retrievable_option = 12; } // Catalog level attribute config. @@ -336,21 +374,21 @@ message CompletionConfig { // will be streamed to the linked branch. message MerchantCenterLink { // Required. The linked [Merchant center account - // id](https://developers.google.com/shopping-content/guides/accountstatuses). + // ID](https://developers.google.com/shopping-content/guides/accountstatuses). // The account must be a standalone account or a sub-account of a MCA. int64 merchant_center_account_id = 1 [(google.api.field_behavior) = REQUIRED]; - // The branch id (e.g. 0/1/2) within this catalog that products from + // The branch ID (e.g. 0/1/2) within this catalog that products from // merchant_center_account_id are streamed to. When updating this field, an // empty value will use the currently configured default branch. However, // changing the default branch later on won't change the linked branch here. // - // A single branch id can only have one linked merchant center account id. + // A single branch ID can only have one linked merchant center account ID. string branch_id = 2; // String representing the destination to import for, all if left empty. - // List of possible values can be found here. - // [https://support.google.com/merchants/answer/7501026] + // List of possible values is given in [Included + // destination](https://support.google.com/merchants/answer/7501026). // List of allowed string values: // "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory // _ads", "Free_listings", "Free_local_listings" @@ -375,6 +413,21 @@ message MerchantCenterLink { // // Example value: `en`. string language_code = 5; + + // Criteria for the Merchant Center feeds to be ingested via the link. + // All offers will be ingested if the list is empty. + // Otherwise the offers will be ingested from selected feeds. + repeated MerchantCenterFeedFilter feeds = 6; +} + +// Merchant Center Feed filter criterion. +message MerchantCenterFeedFilter { + // Merchant Center primary feed ID. + int64 primary_feed_id = 1; + + // Merchant Center primary feed name. The name is used for the display + // purposes only. + string primary_feed_name = 2; } // Configures Merchant Center linking. diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/catalog_service.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/catalog_service.proto index 088c01922de..d14a79a83c9 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/catalog_service.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/catalog_service.proto @@ -186,6 +186,17 @@ service CatalogService { }; } + // Removes all specified + // [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute]s from the + // [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig]. + rpc BatchRemoveCatalogAttributes(BatchRemoveCatalogAttributesRequest) + returns (BatchRemoveCatalogAttributesResponse) { + option (google.api.http) = { + post: "/v2alpha/{attributes_config=projects/*/locations/*/catalogs/*/attributesConfig}:batchRemoveCatalogAttributes" + body: "*" + }; + } + // Replaces the specified // [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] in the // [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig] by @@ -341,7 +352,7 @@ message GetDefaultBranchResponse { // method. message GetCompletionConfigRequest { // Required. Full CompletionConfig resource name. Format: - // projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig + // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig` string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -449,6 +460,44 @@ message RemoveCatalogAttributeRequest { string key = 2 [(google.api.field_behavior) = REQUIRED]; } +// Request for +// [CatalogService.BatchRemoveCatalogAttributes][google.cloud.retail.v2alpha.CatalogService.BatchRemoveCatalogAttributes] +// method. +message BatchRemoveCatalogAttributesRequest { + // Required. The attributes config resource shared by all catalog attributes + // being deleted. Format: + // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` + string attributes_config = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "retail.googleapis.com/AttributesConfig" + } + ]; + + // Required. The attribute name keys of the + // [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute]s to + // delete. A maximum of 1000 catalog attributes can be deleted in a batch. + repeated string attribute_keys = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response of the +// [CatalogService.BatchRemoveCatalogAttributes][google.cloud.retail.v2alpha.CatalogService.BatchRemoveCatalogAttributes]. +message BatchRemoveCatalogAttributesResponse { + // Catalog attributes that were deleted. Only pre-loaded [catalog + // attributes][google.cloud.retail.v2alpha.CatalogAttribute] that are + // neither [in + // use][google.cloud.retail.v2alpha.CatalogAttribute.in_use] by + // products nor predefined can be deleted. + repeated string deleted_catalog_attributes = 1; + + // Catalog attributes that were reset. [Catalog + // attributes][google.cloud.retail.v2alpha.CatalogAttribute] that are either + // [in use][google.cloud.retail.v2alpha.CatalogAttribute.in_use] by products + // or are predefined attributes cannot be deleted; however, their + // configuration properties will reset to default values upon removal request. + repeated string reset_catalog_attributes = 2; +} + // Request for // [CatalogService.ReplaceCatalogAttribute][google.cloud.retail.v2alpha.CatalogService.ReplaceCatalogAttribute] // method. diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/common.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/common.proto index 02cf05ba8ec..4a06b4273ef 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/common.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/common.proto @@ -72,7 +72,7 @@ enum RecommendationsFilteringOption { // The use case of Cloud Retail Search. enum SearchSolutionUseCase { // The value when it's unspecified. In this case, server behavior defaults to - // [SEARCH_SOLUTION_USE_CASE_SEARCH][]. + // [SEARCH_SOLUTION_USE_CASE_SEARCH][google.cloud.retail.v2alpha.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH]. SEARCH_SOLUTION_USE_CASE_UNSPECIFIED = 0; // Search use case. Expects the traffic has a non-empty @@ -97,8 +97,8 @@ message Condition { // Value cannot be empty. // Value can have at most 3 terms if specified as a partial match. Each // space separated string is considered as one term. - // Example) "a b c" is 3 terms and allowed, " a b c d" is 4 terms and not - // allowed for partial match. + // For example, "a b c" is 3 terms and allowed, but " a b c d" is 4 terms + // and not allowed for a partial match. string value = 1; // Whether this is supposed to be a full or partial match. @@ -127,10 +127,12 @@ message Condition { } // A rule is a condition-action pair +// // * A condition defines when a rule is to be triggered. // * An action specifies what occurs on that trigger. -// Currently only boost rules are supported. -// Currently only supported by the search endpoint. +// Currently rules only work for [controls][google.cloud.retail.v2alpha.Control] +// with +// [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2alpha.SolutionType.SOLUTION_TYPE_SEARCH]. message Rule { // A boost action to apply to results matching condition specified above. message BoostAction { @@ -216,7 +218,8 @@ message Rule { } // Creates a set of terms that will be treated as synonyms of each other. - // Example: synonyms of "sneakers" and "shoes". + // Example: synonyms of "sneakers" and "shoes": + // // * "sneakers" will use a synonym of "shoes". // * "shoes" will use a synonym of "sneakers". message TwowaySynonymsAction { diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/completion_service.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/completion_service.proto index 9f399d2233b..323bc05d607 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/completion_service.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/completion_service.proto @@ -36,7 +36,7 @@ option ruby_package = "Google::Cloud::Retail::V2alpha"; // Auto-completion service for retail. // // This feature is only available for users who have Retail Search enabled. -// Please enable Retail Search on Cloud Console before using this feature. +// Enable Retail Search on Cloud Console before using this feature. service CompletionService { option (google.api.default_host) = "retail.googleapis.com"; option (google.api.oauth_scopes) = @@ -45,7 +45,7 @@ service CompletionService { // Completes the specified prefix with keyword suggestions. // // This feature is only available for users who have Retail Search enabled. - // Please enable Retail Search on Cloud Console before using this feature. + // Enable Retail Search on Cloud Console before using this feature. rpc CompleteQuery(CompleteQueryRequest) returns (CompleteQueryResponse) { option (google.api.http) = { get: "/v2alpha/{catalog=projects/*/locations/*/catalogs/*}:completeQuery" @@ -60,7 +60,7 @@ service CompletionService { // are indexed successfully and ready for serving. The process takes hours. // // This feature is only available for users who have Retail Search enabled. - // Please enable Retail Search on Cloud Console before using this feature. + // Enable Retail Search on Cloud Console before using this feature. rpc ImportCompletionData(ImportCompletionDataRequest) returns (google.longrunning.Operation) { option (google.api.http) = { @@ -110,8 +110,10 @@ message CompleteQueryRequest { // number of language codes is 3. repeated string language_codes = 3; - // The device type context for completion suggestions. - // It is useful to apply different suggestions on different device types, e.g. + // The device type context for completion suggestions. We recommend that you + // leave this field empty. + // + // It can apply different suggestions on different device types, e.g. // `DESKTOP`, `MOBILE`. If it is empty, the suggestions are across all device // types. // @@ -148,6 +150,11 @@ message CompleteQueryRequest { // The maximum allowed max suggestions is 20. If it is set higher, it will be // capped by 20. int32 max_suggestions = 5; + + // If true, attribute suggestions are enabled and provided in response. + // + // This field is only available for "cloud-retail" dataset. + bool enable_attribute_suggestions = 9; } // Response of the auto-complete query. @@ -175,6 +182,12 @@ message CompleteQueryResponse { string recent_search = 1; } + // Resource that represents attribute results. + message AttributeResult { + // The list of suggestions for the attribute. + repeated string suggestions = 1; + } + // Results of the matching suggestions. The result list is ordered and the // first result is top suggestion. repeated CompletionResult completion_results = 1; @@ -207,4 +220,14 @@ message CompleteQueryResponse { // Recent searches are deduplicated. More recent searches will be reserved // when duplication happens. repeated RecentSearchResult recent_search_results = 3; + + // A map of matched attribute suggestions. This field is only available for + // "cloud-retail" dataset. + // + // Current supported keys: + // + // * `brands` + // + // * `categories` + map attribute_results = 4; } diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/control.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/control.proto index cdd683d573e..6ad604ea42b 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/control.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/control.proto @@ -30,8 +30,9 @@ option objc_class_prefix = "RETAIL"; option php_namespace = "Google\\Cloud\\Retail\\V2alpha"; option ruby_package = "Google::Cloud::Retail::V2alpha"; -// Configures dynamic serving time metadata that is used to pre and post -// process search/recommendation model results. +// Configures dynamic metadata that can be linked to a +// [ServingConfig][google.cloud.retail.v2alpha.ServingConfig] and affect search +// or recommendation results at serving time. message Control { option (google.api.resource) = { type: "retail.googleapis.com/Control" @@ -45,7 +46,10 @@ message Control { // INVALID_ARGUMENT will be returned if either condition is violated. oneof control { // A facet specification to perform faceted search. - SearchRequest.FacetSpec facet_spec = 3; + // + // Note that this field is deprecated and will throw NOT_IMPLEMENTED if + // used for creating a control. + SearchRequest.FacetSpec facet_spec = 3 [deprecated = true]; // A rule control - a condition-action pair. // Enacts a set action when the condition is triggered. @@ -63,30 +67,34 @@ message Control { // characters. Otherwise, an INVALID_ARGUMENT error is thrown. string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - // Output only. List of serving configuration ids that that are associated - // with this control. Note the association is managed via the ServingConfig, - // this is an output only denormalizeed view. Assumed to be in the same - // catalog. + // Output only. List of [serving + // config][google.cloud.retail.v2alpha.ServingConfig] ids that are associated + // with this control in the same + // [Catalog][google.cloud.retail.v2alpha.Catalog]. + // + // Note the association is managed via the + // [ServingConfig][google.cloud.retail.v2alpha.ServingConfig], this is an + // output only denormalized view. repeated string associated_serving_config_ids = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Required. Immutable. The solution types that the serving config is used - // for. Currently we support setting only one type of solution at creation - // time. + // Required. Immutable. The solution types that the control is used for. + // Currently we support setting only one type of solution at creation time. // // Only `SOLUTION_TYPE_SEARCH` value is supported at the moment. // If no solution type is provided at creation time, will default to - // SOLUTION_TYPE_SEARCH. + // [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2alpha.SolutionType.SOLUTION_TYPE_SEARCH]. repeated SolutionType solution_types = 6 [ (google.api.field_behavior) = REQUIRED, (google.api.field_behavior) = IMMUTABLE ]; - // Required. Specifies the use case for the control. + // Specifies the use case for the control. // Affects what condition fields can be set. // Only settable by search controls. - // Will default to SEARCH_SOLUTION_USE_CASE_SEARCH if not specified. - // Currently only allow one search_solution_use_case per control. - repeated SearchSolutionUseCase search_solution_use_case = 7 - [(google.api.field_behavior) = REQUIRED]; + // Will default to + // [SEARCH_SOLUTION_USE_CASE_SEARCH][google.cloud.retail.v2alpha.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH] + // if not specified. Currently only allow one search_solution_use_case per + // control. + repeated SearchSolutionUseCase search_solution_use_case = 7; } diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/control_service.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/control_service.proto index d69201a3d18..53744cded22 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/control_service.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/control_service.proto @@ -66,7 +66,7 @@ service ControlService { // // [Control][google.cloud.retail.v2alpha.Control] cannot be set to a different // oneof field, if so an INVALID_ARGUMENT is returned. If the - // [Control][google.cloud.retail.v2alpha.Control] to delete does not exist, a + // [Control][google.cloud.retail.v2alpha.Control] to update does not exist, a // NOT_FOUND error is returned. rpc UpdateControl(UpdateControlRequest) returns (Control) { option (google.api.http) = { @@ -84,7 +84,8 @@ service ControlService { option (google.api.method_signature) = "name"; } - // Lists all Controls linked to this catalog. + // Lists all Controls by their parent + // [Catalog][google.cloud.retail.v2alpha.Catalog]. rpc ListControls(ListControlsRequest) returns (ListControlsResponse) { option (google.api.http) = { get: "/v2alpha/{parent=projects/*/locations/*/catalogs/*}/controls" @@ -140,7 +141,7 @@ message DeleteControlRequest { // Request for GetControl method. message GetControlRequest { - // Required. The resource name of the Control to delete. Format: + // Required. The resource name of the Control to get. Format: // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}` string name = 1 [ (google.api.field_behavior) = REQUIRED, diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/export_config.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/export_config.proto index dd907d1ea91..831bb2ec550 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/export_config.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/export_config.proto @@ -16,6 +16,8 @@ syntax = "proto3"; package google.cloud.retail.v2alpha; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; import "google/protobuf/timestamp.proto"; import "google/rpc/status.proto"; @@ -40,7 +42,7 @@ message ExportErrorsConfig { } } -// Metadata related to the progress of the Export operation. This will be +// Metadata related to the progress of the Export operation. This is // returned by the google.longrunning.Operation.metadata field. message ExportMetadata { // Operation create time. @@ -79,10 +81,14 @@ message ExportUserEventsResponse { OutputResult output_result = 3; } -// Output result. +// Output result that stores the information about where the exported data is +// stored. message OutputResult { - // Export result in BigQuery. + // The BigQuery location where the result is stored. repeated BigQueryOutputResult bigquery_result = 1; + + // The Google Cloud Storage location where the result is stored. + repeated GcsOutputResult gcs_result = 2; } // A BigQuery output result. @@ -93,3 +99,9 @@ message BigQueryOutputResult { // The ID of a BigQuery Table. string table_id = 2; } + +// A Gcs output result. +message GcsOutputResult { + // The uri of Gcs output + string output_uri = 1; +} diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/import_config.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/import_config.proto index 319edb1eacb..8b7d87b9568 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/import_config.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/import_config.proto @@ -35,7 +35,6 @@ option php_namespace = "Google\\Cloud\\Retail\\V2alpha"; option ruby_package = "Google::Cloud::Retail::V2alpha"; // Google Cloud Storage location for input content. -// format. message GcsSource { // Required. Google Cloud Storage URIs to input files. URI can be up to // 2000 characters long. URIs can match the full object path (for example, @@ -66,12 +65,12 @@ message GcsSource { // // Supported values for control imports: // - // * 'control' (default): One JSON + // * `control` (default): One JSON // [Control][google.cloud.retail.v2alpha.Control] per line. // // Supported values for catalog attribute imports: // - // * 'catalog_attribute' (default): One CSV + // * `catalog_attribute` (default): One CSV // [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] per line. string data_schema = 2; } @@ -83,9 +82,8 @@ message BigQuerySource { oneof partition { // BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format. // - // Only supported when - // [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2alpha.ImportProductsRequest.reconciliation_mode] - // is set to `FULL`. + // Only supported in + // [ImportProductsRequest][google.cloud.retail.v2alpha.ImportProductsRequest]. google.type.Date partition_date = 6; } @@ -124,8 +122,7 @@ message BigQuerySource { // * `user_event_ga360`: // The schema is available here: // https://support.google.com/analytics/answer/3437719. - // * `user_event_ga4`: This feature is in private preview. Please contact the - // support team for importing Google Analytics 4 events. + // * `user_event_ga4`: // The schema is available here: // https://support.google.com/analytics/answer/7029846. // @@ -156,7 +153,7 @@ message ImportErrorsConfig { // Required. Errors destination. oneof destination { // Google Cloud Storage prefix for import errors. This must be an empty, - // existing Cloud Storage directory. Import errors will be written to + // existing Cloud Storage directory. Import errors are written to // sharded files in this directory, one per line, as a JSON-encoded // `google.rpc.Status` message. string gcs_prefix = 1; @@ -176,16 +173,6 @@ message ImportProductsRequest { // Calculates diff and replaces the entire product dataset. Existing // products may be deleted if they are not present in the source location. - // - // Can only be set while using - // [BigQuerySource][google.cloud.retail.v2alpha.BigQuerySource]. And the - // BigQuery dataset must be created in the data location "us (multiple - // regions in United States)", otherwise a PERMISSION_DENIED error is - // thrown. - // - // Add the IAM permission "BigQuery Data Viewer" for - // cloud-retail-customer-data-access@system.gserviceaccount.com before - // using this feature otherwise an error is thrown. FULL = 2; } @@ -208,8 +195,8 @@ message ImportProductsRequest { // The desired location of errors incurred during the Import. ImportErrorsConfig errors_config = 3; - // Indicates which fields in the provided imported 'products' to update. If - // not set, will by default update all fields. + // Indicates which fields in the provided imported `products` to update. If + // not set, all fields are updated. google.protobuf.FieldMask update_mask = 4; // The mode of reconciliation between existing products and the products to be @@ -218,24 +205,19 @@ message ImportProductsRequest { ReconciliationMode reconciliation_mode = 5; // Full Pub/Sub topic name for receiving notification. If this field is set, - // when the import is finished, a notification will be sent to - // specified Pub/Sub topic. The message data will be JSON string of a + // when the import is finished, a notification is sent to + // specified Pub/Sub topic. The message data is JSON string of a // [Operation][google.longrunning.Operation]. // // Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. It has // to be within the same project as // [ImportProductsRequest.parent][google.cloud.retail.v2alpha.ImportProductsRequest.parent]. - // Make sure that both - // `cloud-retail-customer-data-access@system.gserviceaccount.com` and - // `service-@gcp-sa-retail.iam.gserviceaccount.com` - // have the `pubsub.topics.publish` IAM permission on the topic. - // - // Only supported when - // [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2alpha.ImportProductsRequest.reconciliation_mode] - // is set to `FULL`. + // Make sure that `service-@gcp-sa-retail.iam.gserviceaccount.com` has the + // `pubsub.topics.publish` IAM permission on the topic. string notification_pubsub_topic = 7; - // If true, will perform the FULL import even if it would delete a large + // If true, this performs the FULL import even if it would delete a large // proportion of the products in the default branch, which could potentially // cause outages if you have live predict/search traffic. // @@ -277,8 +259,8 @@ message ImportCompletionDataRequest { [(google.api.field_behavior) = REQUIRED]; // Pub/Sub topic for receiving notification. If this field is set, - // when the import is finished, a notification will be sent to - // specified Pub/Sub topic. The message data will be JSON string of a + // when the import is finished, a notification is sent to + // specified Pub/Sub topic. The message data is JSON string of a // [Operation][google.longrunning.Operation]. // Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. string notification_pubsub_topic = 3; @@ -338,7 +320,7 @@ message CompletionDataInputConfig { } } -// Metadata related to the progress of the Import operation. This will be +// Metadata related to the progress of the Import operation. This is // returned by the google.longrunning.Operation.metadata field. message ImportMetadata { // Operation create time. @@ -358,11 +340,24 @@ message ImportMetadata { string request_id = 5 [deprecated = true]; // Pub/Sub topic for receiving notification. If this field is set, - // when the import is finished, a notification will be sent to - // specified Pub/Sub topic. The message data will be JSON string of a + // when the import is finished, a notification is sent to + // specified Pub/Sub topic. The message data is JSON string of a // [Operation][google.longrunning.Operation]. // Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. string notification_pubsub_topic = 6; + + // Metadata related to transform user events. + TransformedUserEventsMetadata transformed_user_events_metadata = 7; +} + +// Metadata related to transform user events operation. +message TransformedUserEventsMetadata { + // Count of entries in the source user events BigQuery table. + int64 source_events_count = 1; + + // Count of entries in the transformed user events BigQuery table, which could + // be different from the actually imported number of user events. + int64 transformed_events_count = 2; } // Response of the diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/model.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/model.proto index 5f4ead9f7d2..1b60792dbfa 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/model.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/model.proto @@ -34,7 +34,7 @@ option ruby_package = "Google::Cloud::Retail::V2alpha"; // [Model][google.cloud.retail.v2alpha.Model]. A // [Model][google.cloud.retail.v2alpha.Model] can be associated with a // [ServingConfig][google.cloud.retail.v2alpha.ServingConfig] and then queried -// through the Predict api. +// through the Predict API. message Model { option (google.api.resource) = { type: "retail.googleapis.com/Model" @@ -44,7 +44,7 @@ message Model { // The PageOptimizationConfig for model training. // // This determines how many panels to optimize for, and which serving - // configurations to consider for each panel. + // configs to consider for each panel. // The purpose of this model is to optimize which // [ServingConfig][google.cloud.retail.v2alpha.ServingConfig] to show on which // panels in way that optimizes the visitors shopping journey. @@ -56,9 +56,9 @@ message Model { oneof candidate { // This has to be a valid // [ServingConfig][google.cloud.retail.v2alpha.ServingConfig] - // identifier. e.g. for a ServingConfig with full name: - // `projects/*/locations/global/catalogs/default_catalog/servingConfigs/my_candidate_config` - // this would be 'my_candidate_config' + // identifier. For example, for a ServingConfig with full name: + // `projects/*/locations/global/catalogs/default_catalog/servingConfigs/my_candidate_config`, + // this would be `my_candidate_config`. string serving_config_id = 1; } } @@ -71,13 +71,11 @@ message Model { string display_name = 1 [(google.api.field_behavior) = OPTIONAL]; // Required. The candidates to consider on the panel. - // - // Limit = 10. repeated Candidate candidates = 2 [(google.api.field_behavior) = REQUIRED]; - // Required. The default candidate (in case the model fails at serving - // time, we can fall back to the default). + // Required. The default candidate. If the model fails at serving time, + // we fall back to the default. Candidate default_candidate = 3 [(google.api.field_behavior) = REQUIRED]; } @@ -127,7 +125,7 @@ message Model { // home_page_ctr_diversity_low, // pdp_cvr_no_diversity // - // `Restriction` = UNIQUE_SERVING_CONFIG_RESTRICTION + // `Restriction` = `UNIQUE_SERVING_CONFIG_RESTRICTION` // // `Valid combinations`: // @@ -160,7 +158,7 @@ message Model { // home_page_ctr_diversity_low, // pdp_cvr_no_diversity // - // `Restriction` = UNIQUE_MODEL_RESTRICTION + // `Restriction` = `UNIQUE_MODEL_RESTRICTION` // // `Valid combinations`: // @@ -192,7 +190,7 @@ message Model { // home_page_ctr_diversity_low, // pdp_cvr_no_diversity // - // `Restriction` = UNIQUE_MODEL_RESTRICTION + // `Restriction` = `UNIQUE_MODEL_RESTRICTION` // // `Valid combinations`: // @@ -247,10 +245,10 @@ message Model { } // Represents an ordered combination of valid serving configs, which - // / may be used for PAGE_OPTIMIZATION recommendations. + // can be used for `PAGE_OPTIMIZATION` recommendations. message ServingConfigList { // Optional. A set of valid serving configs that may be used for - // PAGE_OPTIMIZATION. + // `PAGE_OPTIMIZATION`. repeated string serving_config_ids = 1 [(google.api.field_behavior) = OPTIONAL]; } @@ -266,7 +264,7 @@ message Model { // The model is serving and can be queried. ACTIVE = 2; - // The model is trained on tuned hyperparameters, and can be + // The model is trained on tuned hyperparameters and can be // queried. TUNED = 3; } @@ -285,26 +283,26 @@ message Model { // Describes whether periodic tuning is enabled for this model // or not. Periodic tuning is scheduled at most every three months. You can - // start a tuning process manually by using the ModelTune + // start a tuning process manually by using the `TuneModel` // method, which starts a tuning process immediately and resets the quarterly // schedule. Enabling or disabling periodic tuning does not affect any // current tuning processes. enum PeriodicTuningState { - // Unspecified default value - should never be explicitly set. + // Unspecified default value, should never be explicitly set. PERIODIC_TUNING_STATE_UNSPECIFIED = 0; // The model has periodic tuning disabled. Tuning - // can be reenabled by calling the EnableModelPeriodicTuning - // method or by calling the TuneModel method. + // can be reenabled by calling the `EnableModelPeriodicTuning` + // method or by calling the `TuneModel` method. PERIODIC_TUNING_DISABLED = 1; // The model cannot be tuned with periodic tuning OR the - // TuneModel method. Hide the options in customer UI and + // `TuneModel` method. Hide the options in customer UI and // reject any requests through the backend self serve API. ALL_TUNING_DISABLED = 3; // The model has periodic tuning enabled. Tuning - // can be disabled by calling the DisableModelPeriodicTuning + // can be disabled by calling the `DisableModelPeriodicTuning` // method. PERIODIC_TUNING_ENABLED = 2; } @@ -312,7 +310,7 @@ message Model { // Describes whether this model have sufficient training data // to be continuously trained. enum DataState { - // Unspecified default value - should never be explicitly set. + // Unspecified default value, should never be explicitly set. DATA_STATE_UNSPECIFIED = 0; // The model has sufficient training data. @@ -335,7 +333,7 @@ message Model { // Required. The fully qualified resource name of the model. // // Format: - // projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id} + // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` // catalog_id has char limit of 50. // recommendation_model_id has char limit of 40. string name = 1 [(google.api.field_behavior) = REQUIRED]; @@ -343,21 +341,21 @@ message Model { // Required. The display name of the model. // // Should be human readable, used to display Recommendation Models in the - // Retail Cloud Cosole Dashboard. UTF-8 encoded string with limit of 1024 + // Retail Cloud Console Dashboard. UTF-8 encoded string with limit of 1024 // characters. string display_name = 2 [(google.api.field_behavior) = REQUIRED]; // Optional. The training state that the model is in (e.g. - // TRAINING or PAUSED). + // `TRAINING` or `PAUSED`). // // Since part of the cost of running the service // is frequency of training - this can be used to determine when to train // model in order to control cost. If not specified: the default value for - // CreateModel method is TRAINING. the default value for - // UpdateModel method is to keep the state the same as before. + // `CreateModel` method is `TRAINING`. The default value for + // `UpdateModel` method is to keep the state the same as before. TrainingState training_state = 3 [(google.api.field_behavior) = OPTIONAL]; - // Output only. The serving state of the model: ACTIVE, NOT_ACTIVE. + // Output only. The serving state of the model: `ACTIVE`, `NOT_ACTIVE`. ServingState serving_state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. Timestamp the Recommendation Model was created at. @@ -373,8 +371,19 @@ message Model { // Required. The type of model e.g. `home-page`. // // Currently supported values: `recommended-for-you`, `others-you-may-like`, - // `frequently-bought-together`, `page-optimization`, 'similar-items', - // 'buy-it-again', `recently-viewed`(readonly value). + // `frequently-bought-together`, `page-optimization`, `similar-items`, + // `buy-it-again`, `on-sale-items`, and `recently-viewed`(readonly value). + // + // + // This field together with + // [optimization_objective][google.cloud.retail.v2alpha.Model.optimization_objective] + // describe model metadata to use to control model training and serving. + // See https://cloud.google.com/retail/docs/models + // for more details on what the model metadata control and which combination + // of parameters are valid. For invalid combinations of parameters (e.g. type + // = `frequently-bought-together` and optimization_objective = `ctr`), you + // receive an error 400 if you try to create/update a recommendation with + // this set of knobs. string type = 7 [(google.api.field_behavior) = REQUIRED]; // Optional. The optimization objective e.g. `cvr`. @@ -390,13 +399,23 @@ message Model { // `others-you-may-like` => `ctr` // // `frequently-bought-together` => `revenue_per_order` + // + // This field together with + // [optimization_objective][google.cloud.retail.v2alpha.Model.type] + // describe model metadata to use to control model training and serving. + // See https://cloud.google.com/retail/docs/models + // for more details on what the model metadata control and which combination + // of parameters are valid. For invalid combinations of parameters (e.g. type + // = `frequently-bought-together` and optimization_objective = `ctr`), you + // receive an error 400 if you try to create/update a recommendation with + // this set of knobs. string optimization_objective = 8 [(google.api.field_behavior) = OPTIONAL]; // Optional. The state of periodic tuning. // // The period we use is 3 months - to do a - // one-off tune earlier use the TuneModel method. Default value - // is PERIODIC_TUNING_ENABLED. + // one-off tune earlier use the `TuneModel` method. Default value + // is `PERIODIC_TUNING_ENABLED`. PeriodicTuningState periodic_tuning_state = 11 [(google.api.field_behavior) = OPTIONAL]; @@ -410,18 +429,18 @@ message Model { // recommendation. Empty field implies no tune is goig on. string tuning_operation = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. The state of data requirements for this model: DATA_OK and - // DATA_ERROR. + // Output only. The state of data requirements for this model: `DATA_OK` and + // `DATA_ERROR`. // // Recommendation model cannot be trained if the data is in - // DATA_ERROR state. Recommendation model can have DATA_ERROR state even if - // serving state is ACTIVE: models were trained successfully before, but + // `DATA_ERROR` state. Recommendation model can have `DATA_ERROR` state even + // if serving state is `ACTIVE`: models were trained successfully before, but // cannot be refreshed because model no longer has sufficient // data for training. DataState data_state = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Optional. If RECOMMENDATIONS_FILTERING_ENABLED, recommendation filtering by - // attributes is enabled for the model. + // Optional. If `RECOMMENDATIONS_FILTERING_ENABLED`, recommendation filtering + // by attributes is enabled for the model. RecommendationsFilteringOption filtering_option = 18 [(google.api.field_behavior) = OPTIONAL]; diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/model_service.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/model_service.proto index 30690f538f5..af057c51426 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/model_service.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/model_service.proto @@ -36,11 +36,11 @@ option ruby_package = "Google::Cloud::Retail::V2alpha"; // Service for performing CRUD operations on models. // Recommendation models contain all the metadata necessary to generate a set of -// models for the Predict() api. A model is queried +// models for the `Predict()` API. A model is queried // indirectly via a ServingConfig, which associates a model with a // given Placement (e.g. Frequently Bought Together on Home Page). // -// This service allows customers to e.g.: +// This service allows you to do the following: // // * Initiate training of a model. // * Pause training of an existing model. @@ -59,8 +59,8 @@ service ModelService { }; option (google.api.method_signature) = "parent,model"; option (google.longrunning.operation_info) = { - response_type: "Model" - metadata_type: "CreateModelMetadata" + response_type: "google.cloud.retail.v2alpha.Model" + metadata_type: "google.cloud.retail.v2alpha.CreateModelMetadata" }; } @@ -99,8 +99,9 @@ service ModelService { } // Update of model metadata. Only fields that - // currently can be updated are: filtering_option, periodic_tuning_state. - // If other values are provided, this API method will ignore them. + // currently can be updated are: `filtering_option` and + // `periodic_tuning_state`. + // If other values are provided, this API method ignores them. rpc UpdateModel(UpdateModelRequest) returns (Model) { option (google.api.http) = { patch: "/v2alpha/{model.name=projects/*/locations/*/catalogs/*/models/*}" @@ -117,8 +118,8 @@ service ModelService { }; option (google.api.method_signature) = "name"; option (google.longrunning.operation_info) = { - response_type: "TuneModelResponse" - metadata_type: "TuneModelMetadata" + response_type: "google.cloud.retail.v2alpha.TuneModelResponse" + metadata_type: "google.cloud.retail.v2alpha.TuneModelMetadata" }; } } @@ -126,27 +127,29 @@ service ModelService { // Request for creating a model. message CreateModelRequest { // Required. The parent resource under which to create the model. Format: - // projects/{project_number}/locations/{location_id}/catalogs/{catalog_id} + // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { type: "retail.googleapis.com/Catalog" } ]; - // Required. The payload of the [Model] to create. + // Required. The payload of the [Model][google.cloud.retail.v2alpha.Model] to + // create. Model model = 2 [(google.api.field_behavior) = REQUIRED]; - // Optional. Whether to run a dry_run to validate the request (without + // Optional. Whether to run a dry run to validate the request (without // actually creating the model). bool dry_run = 3 [(google.api.field_behavior) = OPTIONAL]; } // Request for updating an existing model. message UpdateModelRequest { - // Required. The body of the updated [Model]. + // Required. The body of the updated + // [Model][google.cloud.retail.v2alpha.Model]. Model model = 1 [(google.api.field_behavior) = REQUIRED]; // Optional. Indicates which fields in the provided 'model' to - // update. If not set, will by default update all fields. + // update. If not set, by default updates all fields. google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; } @@ -155,7 +158,7 @@ message UpdateModelRequest { message PauseModelRequest { // Required. The name of the model to pause. // Format: - // projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id} + // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { type: "retail.googleapis.com/Model" } @@ -166,7 +169,7 @@ message PauseModelRequest { message ResumeModelRequest { // Required. The name of the model to resume. // Format: - // projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id} + // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` string name = 1 [(google.api.field_behavior) = REQUIRED]; } @@ -174,7 +177,7 @@ message ResumeModelRequest { message ListModelsRequest { // Required. The parent for which to list models. // Format: - // projects/{project_number}/locations/{location_id}/catalogs/{catalog_id} + // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { type: "retail.googleapis.com/Catalog" } @@ -191,9 +194,9 @@ message ListModelsRequest { // Request for deleting a model. message DeleteModelRequest { - // Required. The resource name of the [Model] to delete. - // Format: - // projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id} + // Required. The resource name of the + // [Model][google.cloud.retail.v2alpha.Model] to delete. Format: + // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { type: "retail.googleapis.com/Model" } @@ -214,7 +217,7 @@ message ListModelsResponse { message TuneModelRequest { // Required. The resource name of the model to tune. // Format: - // projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id} + // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { type: "retail.googleapis.com/Model" } @@ -225,7 +228,7 @@ message TuneModelRequest { message CreateModelMetadata { // The resource name of the model that this create applies to. // Format: - // projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id} + // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` string model = 1; } @@ -233,7 +236,7 @@ message CreateModelMetadata { message TuneModelMetadata { // The resource name of the model that this tune applies to. // Format: - // projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id} + // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` string model = 1; } diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/prediction_service.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/prediction_service.proto index b76aed50b11..b88e97e7a34 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/prediction_service.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/prediction_service.proto @@ -19,6 +19,7 @@ package google.cloud.retail.v2alpha; import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; import "google/cloud/retail/v2alpha/user_event.proto"; import "google/protobuf/struct.proto"; @@ -61,7 +62,7 @@ message PredictRequest { // The ID of the Recommendations AI serving config or placement. // Before you can request predictions from your model, you must create at // least one serving config or placement for it. For more information, see - // [Managing serving configurations] + // [Manage serving configs] // (https://cloud.google.com/retail/docs/manage-configs). // // The full list of available serving configs can be seen at @@ -84,13 +85,13 @@ message PredictRequest { // [UserInfo.user_id][google.cloud.retail.v2alpha.UserInfo.user_id] unset. UserEvent user_event = 2 [(google.api.field_behavior) = REQUIRED]; - // Maximum number of results to return per page. Set this property - // to the number of prediction results needed. If zero, the service will - // choose a reasonable default. The maximum allowed value is 100. Values - // above 100 will be coerced to 100. + // Maximum number of results to return. Set this property to the number of + // prediction results needed. If zero, the service will choose a reasonable + // default. The maximum allowed value is 100. Values above 100 will be coerced + // to 100. int32 page_size = 3; - // This field is not used for now; leave it unset. + // This field is not used; leave it unset. string page_token = 4 [deprecated = true]; // Filter for restricting prediction results with a length limit of 5,000 @@ -116,12 +117,11 @@ message PredictRequest { // * filterOutOfStockItems tag=(-"promotional") // * filterOutOfStockItems // - // If your filter blocks all prediction results, the API will return generic - // (unfiltered) popular products. If you only want results strictly matching - // the filters, set `strictFiltering` to True in `PredictRequest.params` to - // receive empty results instead. - // Note that the API will never return items with storageStatus of "EXPIRED" - // or "DELETED" regardless of filter choices. + // If your filter blocks all prediction results, the API will return *no* + // results. If instead you want empty result sets to return generic + // (unfiltered) popular products, set `strictFiltering` to False in + // `PredictRequest.params`. Note that the API will never return items with + // storageStatus of "EXPIRED" or "DELETED" regardless of filter choices. // // If `filterSyntaxV2` is set to true under the `params` field, then // attribute-based expressions are expected instead of the above described @@ -148,7 +148,7 @@ message PredictRequest { // * `returnScore`: Boolean. If set to true, the prediction 'score' // corresponding to each returned product will be set in the // `results.metadata` field in the prediction response. The given - // 'score' indicates the probability of an product being clicked/purchased + // 'score' indicates the probability of a product being clicked/purchased // given the user's context and history. // * `strictFiltering`: Boolean. True by default. If set to false, the service // will return generic (unfiltered) popular products instead of empty if diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/product.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/product.proto index f4826f1bdd0..7dd20a744b3 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/product.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/product.proto @@ -105,6 +105,13 @@ message Product { oneof expiration { // The timestamp when this product becomes unavailable for // [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]. + // Note that this is only applicable to + // [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] and + // [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION], + // and ignored for + // [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]. In + // general, we suggest the users to delete the stale products explicitly, + // instead of using this field to determine staleness. // // If it is set, the [Product][google.cloud.retail.v2alpha.Product] is not // available for @@ -125,7 +132,14 @@ message Product { // [expiration_date](https://support.google.com/merchants/answer/6324499). google.protobuf.Timestamp expire_time = 16; - // Input only. The TTL (time to live) of the product. + // Input only. The TTL (time to live) of the product. Note that this is only + // applicable to + // [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] and + // [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION], + // and ignored for + // [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]. In + // general, we suggest the users to delete the stale products explicitly, + // instead of using this field to determine staleness. // // If it is set, it must be a non-negative value, and // [expire_time][google.cloud.retail.v2alpha.Product.expire_time] is set as @@ -200,7 +214,7 @@ message Product { // The [type][google.cloud.retail.v2alpha.Product.type] of the members must be // either [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] or // [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT] otherwise - // and INVALID_ARGUMENT error is thrown. Should not set it for other types. A + // an INVALID_ARGUMENT error is thrown. Should not set it for other types. A // maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is // return. repeated string collection_member_ids = 5; @@ -231,7 +245,7 @@ message Product { // // // To represent full path of category, use '>' sign to separate different - // hierarchies. If '>' is part of the category name, please replace it with + // hierarchies. If '>' is part of the category name, replace it with // other character(s). // // For example, if a shoes product belongs to both @@ -364,6 +378,11 @@ message Product { // The timestamp when this [Product][google.cloud.retail.v2alpha.Product] // becomes available for // [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]. + // Note that this is only applicable to + // [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] and + // [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION], and + // ignored for + // [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]. google.protobuf.Timestamp available_time = 18; // The online availability of the @@ -551,7 +570,9 @@ message Product { // Note: Returning more fields in // [SearchResponse][google.cloud.retail.v2alpha.SearchResponse] can increase // response payload size and serving latency. - google.protobuf.FieldMask retrievable_fields = 30; + // + // This field is deprecated. Use the retrievable site-wide control instead. + google.protobuf.FieldMask retrievable_fields = 30 [deprecated = true]; // Output only. Product variants grouped together on primary product which // share similar product attributes. It's automatically grouped by @@ -564,4 +585,15 @@ message Product { // [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct]. // Do not set this field in API requests. repeated Product variants = 31 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A list of local inventories specific to different places. + // + // This is only available for users who have Retail Search enabled, and it can + // be managed by + // [ProductService.AddLocalInventories][google.cloud.retail.v2alpha.ProductService.AddLocalInventories] + // and + // [ProductService.RemoveLocalInventories][google.cloud.retail.v2alpha.ProductService.RemoveLocalInventories] + // APIs. + repeated LocalInventory local_inventories = 35 + [(google.api.field_behavior) = OUTPUT_ONLY]; } diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/product_service.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/product_service.proto index 1a5f702bb05..ec82c437f44 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/product_service.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/product_service.proto @@ -141,9 +141,9 @@ service ProductService { // // This process is asynchronous and does not require the // [Product][google.cloud.retail.v2alpha.Product] to exist before updating - // fulfillment information. If the request is valid, the update will be - // enqueued and processed downstream. As a consequence, when a response is - // returned, updates are not immediately manifested in the + // fulfillment information. If the request is valid, the update is enqueued + // and processed downstream. As a consequence, when a response is returned, + // updates are not immediately manifested in the // [Product][google.cloud.retail.v2alpha.Product] queried by // [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] // or @@ -153,10 +153,10 @@ service ProductService { // [ProductService.CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] // and // [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct], - // the specified inventory field value(s) will overwrite any existing value(s) + // the specified inventory field value(s) overwrite any existing value(s) // while ignoring the last update time for this field. Furthermore, the last - // update time for the specified inventory fields will be overwritten to the - // time of the + // update times for the specified inventory fields are overwritten by the + // times of the // [ProductService.CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] // or // [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] @@ -164,11 +164,11 @@ service ProductService { // // If no inventory fields are set in // [CreateProductRequest.product][google.cloud.retail.v2alpha.CreateProductRequest.product], - // then any pre-existing inventory information for this product will be used. + // then any pre-existing inventory information for this product is used. // // If no inventory fields are set in // [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask], - // then any existing inventory information will be preserved. + // then any existing inventory information is preserved. // // Pre-existing inventory information can only be updated with // [ProductService.SetInventory][google.cloud.retail.v2alpha.ProductService.SetInventory], @@ -176,8 +176,17 @@ service ProductService { // and // [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.RemoveFulfillmentPlaces]. // + // The returned [Operation][google.longrunning.Operation]s is obsolete after + // one day, and the [GetOperation][google.longrunning.Operations.GetOperation] + // API returns `NOT_FOUND` afterwards. + // + // If conflicting updates are issued, the + // [Operation][google.longrunning.Operation]s associated with the stale + // updates are not marked as [done][google.longrunning.Operation.done] until + // they are obsolete. + // // This feature is only available for users who have Retail Search enabled. - // Please enable Retail Search on Cloud Console before using this feature. + // Enable Retail Search on Cloud Console before using this feature. rpc SetInventory(SetInventoryRequest) returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v2alpha/{inventory.name=projects/*/locations/*/catalogs/*/branches/*/products/**}:setInventory" @@ -203,8 +212,17 @@ service ProductService { // or // [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]. // + // The returned [Operation][google.longrunning.Operation]s will be obsolete + // after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] + // API will return NOT_FOUND afterwards. + // + // If conflicting updates are issued, the + // [Operation][google.longrunning.Operation]s associated with the stale + // updates will not be marked as [done][google.longrunning.Operation.done] + // until being obsolete. + // // This feature is only available for users who have Retail Search enabled. - // Please enable Retail Search on Cloud Console before using this feature. + // Enable Retail Search on Cloud Console before using this feature. rpc AddFulfillmentPlaces(AddFulfillmentPlacesRequest) returns (google.longrunning.Operation) { option (google.api.http) = { @@ -231,8 +249,17 @@ service ProductService { // or // [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]. // + // The returned [Operation][google.longrunning.Operation]s will be obsolete + // after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] + // API will return NOT_FOUND afterwards. + // + // If conflicting updates are issued, the + // [Operation][google.longrunning.Operation]s associated with the stale + // updates will not be marked as [done][google.longrunning.Operation.done] + // until being obsolete. + // // This feature is only available for users who have Retail Search enabled. - // Please enable Retail Search on Cloud Console before using this feature. + // Enable Retail Search on Cloud Console before using this feature. rpc RemoveFulfillmentPlaces(RemoveFulfillmentPlacesRequest) returns (google.longrunning.Operation) { option (google.api.http) = { @@ -266,8 +293,17 @@ service ProductService { // [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] // has no effect on local inventories. // + // The returned [Operation][google.longrunning.Operation]s will be obsolete + // after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] + // API will return NOT_FOUND afterwards. + // + // If conflicting updates are issued, the + // [Operation][google.longrunning.Operation]s associated with the stale + // updates will not be marked as [done][google.longrunning.Operation.done] + // until being obsolete. + // // This feature is only available for users who have Retail Search enabled. - // Please enable Retail Search on Cloud Console before using this feature. + // Enable Retail Search on Cloud Console before using this feature. rpc AddLocalInventories(AddLocalInventoriesRequest) returns (google.longrunning.Operation) { option (google.api.http) = { @@ -299,8 +335,17 @@ service ProductService { // [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] // has no effect on local inventories. // + // The returned [Operation][google.longrunning.Operation]s will be obsolete + // after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] + // API will return NOT_FOUND afterwards. + // + // If conflicting updates are issued, the + // [Operation][google.longrunning.Operation]s associated with the stale + // updates will not be marked as [done][google.longrunning.Operation.done] + // until being obsolete. + // // This feature is only available for users who have Retail Search enabled. - // Please enable Retail Search on Cloud Console before using this feature. + // Enable Retail Search on Cloud Console before using this feature. rpc RemoveLocalInventories(RemoveLocalInventoriesRequest) returns (google.longrunning.Operation) { option (google.api.http) = { diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/search_service.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/search_service.proto index 24bfa34aacd..37526c1f753 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/search_service.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/search_service.proto @@ -37,7 +37,7 @@ option ruby_package = "Google::Cloud::Retail::V2alpha"; // Service for search. // // This feature is only available for users who have Retail Search enabled. -// Please enable Retail Search on Cloud Console before using this feature. +// Enable Retail Search on Cloud Console before using this feature. service SearchService { option (google.api.default_host) = "retail.googleapis.com"; option (google.api.oauth_scopes) = @@ -46,7 +46,7 @@ service SearchService { // Performs a search. // // This feature is only available for users who have Retail Search enabled. - // Please enable Retail Search on Cloud Console before using this feature. + // Enable Retail Search on Cloud Console before using this feature. rpc Search(SearchRequest) returns (SearchResponse) { option (google.api.http) = { post: "/v2alpha/{placement=projects/*/locations/*/catalogs/*/placements/*}:search" @@ -218,7 +218,7 @@ message SearchRequest { FacetKey facet_key = 1 [(google.api.field_behavior) = REQUIRED]; // Maximum of facet values that should be returned for this facet. If - // unspecified, defaults to 20. The maximum allowed value is 300. Values + // unspecified, defaults to 50. The maximum allowed value is 300. Values // above 300 will be coerced to 300. // // If this field is negative, an INVALID_ARGUMENT is returned. @@ -396,7 +396,8 @@ message SearchRequest { // [Mode.AUTO][google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode.AUTO]. MODE_UNSPECIFIED = 0; - // Let CRS decide whether to use personalization. + // Let CRS decide whether to use personalization based on quality of user + // event data. AUTO = 1; // Disable personalization. @@ -458,15 +459,21 @@ message SearchRequest { // The search mode of each search request. enum SearchMode { // Default value. In this case both product search and faceted search will - // be performed. Both [SearchResponse.SearchResult] and - // [SearchResponse.Facet] will be returned. + // be performed. Both + // [SearchResponse.SearchResult][google.cloud.retail.v2alpha.SearchResponse.SearchResult] + // and + // [SearchResponse.Facet][google.cloud.retail.v2alpha.SearchResponse.Facet] + // will be returned. SEARCH_MODE_UNSPECIFIED = 0; // Only product search will be performed. The faceted search will be // disabled. // - // Only [SearchResponse.SearchResult] will be returned. - // [SearchResponse.Facet] will not be returned, even if + // Only + // [SearchResponse.SearchResult][google.cloud.retail.v2alpha.SearchResponse.SearchResult] + // will be returned. + // [SearchResponse.Facet][google.cloud.retail.v2alpha.SearchResponse.Facet] + // will not be returned, even if // [SearchRequest.facet_specs][google.cloud.retail.v2alpha.SearchRequest.facet_specs] // or // [SearchRequest.dynamic_facet_spec][google.cloud.retail.v2alpha.SearchRequest.dynamic_facet_spec] @@ -481,7 +488,9 @@ message SearchRequest { // and // [SearchRequest.dynamic_facet_spec][google.cloud.retail.v2alpha.SearchRequest.dynamic_facet_spec] // should be set. Otherwise, an INVALID_ARGUMENT error is returned. Only - // [SearchResponse.Facet] will be returned. [SearchResponse.SearchResult] + // [SearchResponse.Facet][google.cloud.retail.v2alpha.SearchResponse.Facet] + // will be returned. + // [SearchResponse.SearchResult][google.cloud.retail.v2alpha.SearchResponse.SearchResult] // will not be returned. FACETED_SEARCH_ONLY = 2; } @@ -490,7 +499,7 @@ message SearchRequest { // `projects/*/locations/global/catalogs/default_catalog/servingConfigs/default_serving_config` // or the name of the legacy placement resource, such as // `projects/*/locations/global/catalogs/default_catalog/placements/default_search`. - // This field is used to identify the serving configuration name and the set + // This field is used to identify the serving config name and the set // of models that will be used to make the search. string placement = 1 [(google.api.field_behavior) = REQUIRED]; @@ -713,7 +722,7 @@ message SearchRequest { // [UserEvent.page_categories][google.cloud.retail.v2alpha.UserEvent.page_categories]; // // To represent full path of category, use '>' sign to separate different - // hierarchies. If '>' is part of the category name, please replace it with + // hierarchies. If '>' is part of the category name, replace it with // other character(s). // // Category pages include special pages such as sales or promotions. For @@ -726,6 +735,15 @@ message SearchRequest { SearchMode search_mode = 31; // The specification for personalization. + // + // Notice that if both + // [ServingConfig.personalization_spec][google.cloud.retail.v2alpha.ServingConfig.personalization_spec] + // and + // [SearchRequest.personalization_spec][google.cloud.retail.v2alpha.SearchRequest.personalization_spec] + // are set. + // [SearchRequest.personalization_spec][google.cloud.retail.v2alpha.SearchRequest.personalization_spec] + // will override + // [ServingConfig.personalization_spec][google.cloud.retail.v2alpha.ServingConfig.personalization_spec]. PersonalizationSpec personalization_spec = 32; // The labels applied to a resource must meet the following requirements: @@ -829,6 +847,21 @@ message SearchResponse { // `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there // are 10 variants in this product are available in the store "store1". map variant_rollup_values = 5; + + // Specifies previous events related to this product for this user based on + // [UserEvent][google.cloud.retail.v2alpha.UserEvent] with same + // [SearchRequest.visitor_id][google.cloud.retail.v2alpha.SearchRequest.visitor_id] + // or [UserInfo.user_id][google.cloud.retail.v2alpha.UserInfo.user_id]. + // + // This is set only when + // [SearchRequest.PersonalizationSpec.mode][google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.mode] + // is + // [SearchRequest.PersonalizationSpec.Mode.AUTO][google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode.AUTO]. + // + // Possible values: + // + // * `purchased`: Indicates that this product has been purchased before. + repeated string personal_labels = 7; } // A facet result. diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/serving_config.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/serving_config.proto index d0524012454..d4d02c70c47 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/serving_config.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/serving_config.proto @@ -32,14 +32,25 @@ option ruby_package = "Google::Cloud::Retail::V2alpha"; // Configures metadata that is used to generate serving time results (e.g. // search results or recommendation predictions). -// The ServingConfig is passed in the search and predict request and together -// with the Catalog.default_branch, generates results. message ServingConfig { option (google.api.resource) = { type: "retail.googleapis.com/ServingConfig" pattern: "projects/{project}/locations/{location}/catalogs/{catalog}/servingConfigs/{serving_config}" }; + // What type of diversity - data or rule based. + // If none is specified, default to rule based. + enum DiversityType { + // Default value. + DIVERSITY_TYPE_UNSPECIFIED = 0; + + // Rule based diversity. + RULE_BASED_DIVERSITY = 2; + + // Data driven diversity. + DATA_DRIVEN_DIVERSITY = 3; + } + // Immutable. Fully qualified name // `projects/*/locations/global/catalogs/*/servingConfig/*` string name = 1 [(google.api.field_behavior) = IMMUTABLE]; @@ -51,7 +62,8 @@ message ServingConfig { // characters. Otherwise, an INVALID_ARGUMENT error is returned. string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - // The id of the model to use at serving time. + // The id of the model in the same + // [Catalog][google.cloud.retail.v2alpha.Catalog] to use at serving time. // Currently only RecommendationModels are supported: // https://cloud.google.com/retail/recommendations-ai/docs/create-models // Can be changed but only to a compatible model (e.g. @@ -70,13 +82,13 @@ message ServingConfig { // click-through and conversion rates. // Allowed values are: // - // * 'no-price-reranking' - // * 'low-price-raranking' - // * 'medium-price-reranking' - // * 'high-price-reranking' + // * `no-price-reranking` + // * `low-price-raranking` + // * `medium-price-reranking` + // * `high-price-reranking` // // If not specified, we choose default based on model type. Default value: - // 'no-price-reranking'. + // `no-price-reranking`. // // Can only be set if // [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types] @@ -205,16 +217,16 @@ message ServingConfig { repeated string ignore_control_ids = 15; // How much diversity to use in recommendation model results e.g. - // 'medium-diversity' or 'high-diversity'. Currently supported values: + // `medium-diversity` or `high-diversity`. Currently supported values: // - // * 'no-diversity' - // * 'low-diversity' - // * 'medium-diversity' - // * 'high-diversity' - // * 'auto-diversity' + // * `no-diversity` + // * `low-diversity` + // * `medium-diversity` + // * `high-diversity` + // * `auto-diversity` // // If not specified, we choose default based on recommendation model - // type. Default value: 'no-diversity'. + // type. Default value: `no-diversity`. // // Can only be set if // [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types] @@ -222,13 +234,16 @@ message ServingConfig { // [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION]. string diversity_level = 8; - // Whether to add additional category filters on the 'similar-items' model. + // What kind of diversity to use - data driven or rule based. + DiversityType diversity_type = 20; + + // Whether to add additional category filters on the `similar-items` model. // If not specified, we enable it by default. // Allowed values are: // - // * 'no-category-match': No additional filtering of original results from + // * `no-category-match`: No additional filtering of original results from // the model and the customer's filters. - // * 'relaxed-category-match': Only keep results with categories that match + // * `relaxed-category-match`: Only keep results with categories that match // at least one item categories in the PredictRequests's context item. // * If customer also sends filters in the PredictRequest, then the results // will satisfy both conditions (user given and category match). @@ -239,6 +254,23 @@ message ServingConfig { // [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION]. string enable_category_filter_level = 16; + // The specification for personalization spec. + // + // Can only be set if + // [solution_types][google.cloud.retail.v2alpha.ServingConfig.solution_types] + // is + // [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH]. + // + // Notice that if both + // [ServingConfig.personalization_spec][google.cloud.retail.v2alpha.ServingConfig.personalization_spec] + // and + // [SearchRequest.personalization_spec][google.cloud.retail.v2alpha.SearchRequest.personalization_spec] + // are set. + // [SearchRequest.personalization_spec][google.cloud.retail.v2alpha.SearchRequest.personalization_spec] + // will override + // [ServingConfig.personalization_spec][google.cloud.retail.v2alpha.ServingConfig.personalization_spec]. + SearchRequest.PersonalizationSpec personalization_spec = 21; + // Required. Immutable. Specifies the solution types that a serving config can // be associated with. Currently we support setting only one type of solution. repeated SolutionType solution_types = 19 [ diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/serving_config_service.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/serving_config_service.proto index 311126510e2..387091079cc 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/serving_config_service.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/serving_config_service.proto @@ -159,7 +159,7 @@ message UpdateServingConfigRequest { // Request for DeleteServingConfig method. message DeleteServingConfigRequest { // Required. The resource name of the ServingConfig to delete. Format: - // projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id} + // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -171,7 +171,7 @@ message DeleteServingConfigRequest { // Request for GetServingConfig method. message GetServingConfigRequest { // Required. The resource name of the ServingConfig to get. Format: - // projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id} + // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -183,7 +183,7 @@ message GetServingConfigRequest { // Request for ListServingConfigs method. message ListServingConfigsRequest { // Required. The catalog resource name. Format: - // projects/{project_number}/locations/{location_id}/catalogs/{catalog_id} + // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { type: "retail.googleapis.com/Catalog" } @@ -211,7 +211,7 @@ message ListServingConfigsResponse { // Request for AddControl method. message AddControlRequest { // Required. The source ServingConfig resource name . Format: - // projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id} + // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` string serving_config = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -227,7 +227,7 @@ message AddControlRequest { // Request for RemoveControl method. message RemoveControlRequest { // Required. The source ServingConfig resource name . Format: - // projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id} + // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` string serving_config = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/user_event.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/user_event.proto index ca25f3003fe..6d24ca24487 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/user_event.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/user_event.proto @@ -229,7 +229,7 @@ message UserEvent { // The categories associated with a category page. // // To represent full path of category, use '>' sign to separate different - // hierarchies. If '>' is part of the category name, please replace it with + // hierarchies. If '>' is part of the category name, replace it with // other character(s). // // Category pages include special pages such as sales or promotions. For diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/user_event_service.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/user_event_service.proto index 35fe33f4bae..5e0702bca51 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/user_event_service.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/user_event_service.proto @@ -20,6 +20,7 @@ import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/httpbody.proto"; +import "google/api/resource.proto"; import "google/cloud/retail/v2alpha/import_config.proto"; import "google/cloud/retail/v2alpha/purge_config.proto"; import "google/cloud/retail/v2alpha/user_event.proto"; @@ -79,9 +80,9 @@ service UserEventService { // 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 + // `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. + // `Operation.metadata` is of type `ImportMetadata`. rpc ImportUserEvents(ImportUserEventsRequest) returns (google.longrunning.Operation) { option (google.api.http) = { @@ -94,14 +95,14 @@ service UserEventService { }; } - // Starts a user event rejoin operation with latest product catalog. Events - // will not be annotated with detailed product information if product is - // missing from the catalog at the time the user event is ingested, and these - // events are stored as unjoined events with a limited usage on training and - // serving. This method can be used to start a join operation on specified - // events with latest version of product catalog. It can also be used to - // correct events joined with the wrong product catalog. A rejoin operation - // can take hours or days to complete. + // Starts a user-event rejoin operation with latest product catalog. Events + // are not annotated with detailed product information for products that are + // missing from the catalog when the user event is ingested. These + // events are stored as unjoined events with limited usage on training and + // serving. You can use this method to start a join operation on specified + // events with the latest version of product catalog. You can also use this + // method to correct events joined with the wrong product catalog. A rejoin + // operation can take hours or days to complete. rpc RejoinUserEvents(RejoinUserEventsRequest) returns (google.longrunning.Operation) { option (google.api.http) = { @@ -123,10 +124,24 @@ message WriteUserEventRequest { // Required. User event to write. UserEvent user_event = 2 [(google.api.field_behavior) = REQUIRED]; + + // If set to true, the user event will be written asynchronously after + // validation, and the API will respond without waiting for the write. + // Therefore, silent failures can occur even if the API returns success. In + // case of silent failures, error messages can be found in Stackdriver logs. + bool write_async = 3; } // Request message for CollectUserEvent method. message CollectUserEventRequest { + // The rule that can convert the raw_json to a user event. It is needed + // only when the raw_json is set. + oneof conversion_rule { + // The prebuilt rule name that can convert a specific type of raw_json. + // For example: "default_schema/v1.0" + string prebuilt_rule = 6; + } + // Required. The parent catalog name, such as // `projects/1234/locations/global/catalogs/default_catalog`. string parent = 1 [(google.api.field_behavior) = REQUIRED]; @@ -145,17 +160,23 @@ message CollectUserEventRequest { // otherwise identical get requests. The name is abbreviated to reduce the // payload bytes. int64 ets = 4; + + // An arbitrary serialized JSON string that contains necessary information + // that can comprise a user event. When this field is specified, the + // user_event field will be ignored. Note: line-delimited JSON is not + // supported, a single JSON only. + string raw_json = 5; } // Request message for RejoinUserEvents method. message RejoinUserEventsRequest { // The scope of user events to be rejoined with the latest product catalog. // If the rejoining aims at reducing number of unjoined events, set - // UserEventRejoinScope to UNJOINED_EVENTS. + // `UserEventRejoinScope` to `UNJOINED_EVENTS`. // If the rejoining aims at correcting product catalog information in joined - // events, set UserEventRejoinScope to JOINED_EVENTS. - // If all events needs to be rejoined, set UserEventRejoinScope to - // USER_EVENT_REJOIN_SCOPE_UNSPECIFIED. + // events, set `UserEventRejoinScope` to `JOINED_EVENTS`. + // If all events needs to be rejoined, set `UserEventRejoinScope` to + // `USER_EVENT_REJOIN_SCOPE_UNSPECIFIED`. enum UserEventRejoinScope { // Rejoin all events with the latest product catalog, including both joined // events and unjoined events. @@ -174,16 +195,16 @@ message RejoinUserEventsRequest { // The type of the user event rejoin to define the scope and range of the user // events to be rejoined with the latest product catalog. Defaults to - // USER_EVENT_REJOIN_SCOPE_UNSPECIFIED if this field is not set, or set to an - // invalid integer value. + // `USER_EVENT_REJOIN_SCOPE_UNSPECIFIED` if this field is not set, or set to + // an invalid integer value. UserEventRejoinScope user_event_rejoin_scope = 2; } -// Response message for RejoinUserEvents method. +// Response message for `RejoinUserEvents` method. message RejoinUserEventsResponse { // Number of user events that were joined with latest product catalog. int64 rejoined_user_events_count = 1; } -// Metadata for RejoinUserEvents method. +// Metadata for `RejoinUserEvents` method. message RejoinUserEventsMetadata {} diff --git a/packages/google-cloud-retail/protos/protos.d.ts b/packages/google-cloud-retail/protos/protos.d.ts index 1d348e9aa9b..6a5825b9f4b 100644 --- a/packages/google-cloud-retail/protos/protos.d.ts +++ b/packages/google-cloud-retail/protos/protos.d.ts @@ -15784,6 +15784,12 @@ export namespace google { /** CatalogAttribute recommendationsFilteringOption */ recommendationsFilteringOption?: (google.cloud.retail.v2alpha.RecommendationsFilteringOption|keyof typeof google.cloud.retail.v2alpha.RecommendationsFilteringOption|null); + + /** CatalogAttribute exactSearchableOption */ + exactSearchableOption?: (google.cloud.retail.v2alpha.CatalogAttribute.ExactSearchableOption|keyof typeof google.cloud.retail.v2alpha.CatalogAttribute.ExactSearchableOption|null); + + /** CatalogAttribute retrievableOption */ + retrievableOption?: (google.cloud.retail.v2alpha.CatalogAttribute.RetrievableOption|keyof typeof google.cloud.retail.v2alpha.CatalogAttribute.RetrievableOption|null); } /** Represents a CatalogAttribute. */ @@ -15816,6 +15822,12 @@ export namespace google { /** CatalogAttribute recommendationsFilteringOption. */ public recommendationsFilteringOption: (google.cloud.retail.v2alpha.RecommendationsFilteringOption|keyof typeof google.cloud.retail.v2alpha.RecommendationsFilteringOption); + /** CatalogAttribute exactSearchableOption. */ + public exactSearchableOption: (google.cloud.retail.v2alpha.CatalogAttribute.ExactSearchableOption|keyof typeof google.cloud.retail.v2alpha.CatalogAttribute.ExactSearchableOption); + + /** CatalogAttribute retrievableOption. */ + public retrievableOption: (google.cloud.retail.v2alpha.CatalogAttribute.RetrievableOption|keyof typeof google.cloud.retail.v2alpha.CatalogAttribute.RetrievableOption); + /** * Creates a new CatalogAttribute instance using the specified properties. * @param [properties] Properties to set @@ -15923,6 +15935,20 @@ export namespace google { SEARCHABLE_ENABLED = 1, SEARCHABLE_DISABLED = 2 } + + /** ExactSearchableOption enum. */ + enum ExactSearchableOption { + EXACT_SEARCHABLE_OPTION_UNSPECIFIED = 0, + EXACT_SEARCHABLE_ENABLED = 1, + EXACT_SEARCHABLE_DISABLED = 2 + } + + /** RetrievableOption enum. */ + enum RetrievableOption { + RETRIEVABLE_OPTION_UNSPECIFIED = 0, + RETRIEVABLE_ENABLED = 1, + RETRIEVABLE_DISABLED = 2 + } } /** Properties of an AttributesConfig. */ @@ -16208,6 +16234,9 @@ export namespace google { /** MerchantCenterLink languageCode */ languageCode?: (string|null); + + /** MerchantCenterLink feeds */ + feeds?: (google.cloud.retail.v2alpha.IMerchantCenterFeedFilter[]|null); } /** Represents a MerchantCenterLink. */ @@ -16234,6 +16263,9 @@ export namespace google { /** MerchantCenterLink languageCode. */ public languageCode: string; + /** MerchantCenterLink feeds. */ + public feeds: google.cloud.retail.v2alpha.IMerchantCenterFeedFilter[]; + /** * Creates a new MerchantCenterLink instance using the specified properties. * @param [properties] Properties to set @@ -16312,6 +16344,109 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a MerchantCenterFeedFilter. */ + interface IMerchantCenterFeedFilter { + + /** MerchantCenterFeedFilter primaryFeedId */ + primaryFeedId?: (number|Long|string|null); + + /** MerchantCenterFeedFilter primaryFeedName */ + primaryFeedName?: (string|null); + } + + /** Represents a MerchantCenterFeedFilter. */ + class MerchantCenterFeedFilter implements IMerchantCenterFeedFilter { + + /** + * Constructs a new MerchantCenterFeedFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IMerchantCenterFeedFilter); + + /** MerchantCenterFeedFilter primaryFeedId. */ + public primaryFeedId: (number|Long|string); + + /** MerchantCenterFeedFilter primaryFeedName. */ + public primaryFeedName: string; + + /** + * Creates a new MerchantCenterFeedFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns MerchantCenterFeedFilter instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IMerchantCenterFeedFilter): google.cloud.retail.v2alpha.MerchantCenterFeedFilter; + + /** + * Encodes the specified MerchantCenterFeedFilter message. Does not implicitly {@link google.cloud.retail.v2alpha.MerchantCenterFeedFilter.verify|verify} messages. + * @param message MerchantCenterFeedFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.IMerchantCenterFeedFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MerchantCenterFeedFilter message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.MerchantCenterFeedFilter.verify|verify} messages. + * @param message MerchantCenterFeedFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.IMerchantCenterFeedFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MerchantCenterFeedFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MerchantCenterFeedFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.MerchantCenterFeedFilter; + + /** + * Decodes a MerchantCenterFeedFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MerchantCenterFeedFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.MerchantCenterFeedFilter; + + /** + * Verifies a MerchantCenterFeedFilter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MerchantCenterFeedFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MerchantCenterFeedFilter + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.MerchantCenterFeedFilter; + + /** + * Creates a plain object from a MerchantCenterFeedFilter message. Also converts values to other types if specified. + * @param message MerchantCenterFeedFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.MerchantCenterFeedFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MerchantCenterFeedFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MerchantCenterFeedFilter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a MerchantCenterLinkingConfig. */ interface IMerchantCenterLinkingConfig { @@ -20309,6 +20444,9 @@ export namespace google { /** ImportMetadata notificationPubsubTopic */ notificationPubsubTopic?: (string|null); + + /** ImportMetadata transformedUserEventsMetadata */ + transformedUserEventsMetadata?: (google.cloud.retail.v2alpha.ITransformedUserEventsMetadata|null); } /** Represents an ImportMetadata. */ @@ -20338,6 +20476,9 @@ export namespace google { /** ImportMetadata notificationPubsubTopic. */ public notificationPubsubTopic: string; + /** ImportMetadata transformedUserEventsMetadata. */ + public transformedUserEventsMetadata?: (google.cloud.retail.v2alpha.ITransformedUserEventsMetadata|null); + /** * Creates a new ImportMetadata instance using the specified properties. * @param [properties] Properties to set @@ -20416,6 +20557,109 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a TransformedUserEventsMetadata. */ + interface ITransformedUserEventsMetadata { + + /** TransformedUserEventsMetadata sourceEventsCount */ + sourceEventsCount?: (number|Long|string|null); + + /** TransformedUserEventsMetadata transformedEventsCount */ + transformedEventsCount?: (number|Long|string|null); + } + + /** Represents a TransformedUserEventsMetadata. */ + class TransformedUserEventsMetadata implements ITransformedUserEventsMetadata { + + /** + * Constructs a new TransformedUserEventsMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.ITransformedUserEventsMetadata); + + /** TransformedUserEventsMetadata sourceEventsCount. */ + public sourceEventsCount: (number|Long|string); + + /** TransformedUserEventsMetadata transformedEventsCount. */ + public transformedEventsCount: (number|Long|string); + + /** + * Creates a new TransformedUserEventsMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns TransformedUserEventsMetadata instance + */ + public static create(properties?: google.cloud.retail.v2alpha.ITransformedUserEventsMetadata): google.cloud.retail.v2alpha.TransformedUserEventsMetadata; + + /** + * Encodes the specified TransformedUserEventsMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.TransformedUserEventsMetadata.verify|verify} messages. + * @param message TransformedUserEventsMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.ITransformedUserEventsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransformedUserEventsMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.TransformedUserEventsMetadata.verify|verify} messages. + * @param message TransformedUserEventsMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.ITransformedUserEventsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransformedUserEventsMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransformedUserEventsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.TransformedUserEventsMetadata; + + /** + * Decodes a TransformedUserEventsMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransformedUserEventsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.TransformedUserEventsMetadata; + + /** + * Verifies a TransformedUserEventsMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TransformedUserEventsMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransformedUserEventsMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.TransformedUserEventsMetadata; + + /** + * Creates a plain object from a TransformedUserEventsMetadata message. Also converts values to other types if specified. + * @param message TransformedUserEventsMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.TransformedUserEventsMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransformedUserEventsMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransformedUserEventsMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of an ImportProductsResponse. */ interface IImportProductsResponse { @@ -20929,6 +21173,9 @@ export namespace google { /** Product variants */ variants?: (google.cloud.retail.v2alpha.IProduct[]|null); + + /** Product localInventories */ + localInventories?: (google.cloud.retail.v2alpha.ILocalInventory[]|null); } /** Represents a Product. */ @@ -21039,6 +21286,9 @@ export namespace google { /** Product variants. */ public variants: google.cloud.retail.v2alpha.IProduct[]; + /** Product localInventories. */ + public localInventories: google.cloud.retail.v2alpha.ILocalInventory[]; + /** Product expiration. */ public expiration?: ("expireTime"|"ttl"); @@ -21941,6 +22191,20 @@ export namespace google { */ public removeCatalogAttribute(request: google.cloud.retail.v2alpha.IRemoveCatalogAttributeRequest): Promise; + /** + * Calls BatchRemoveCatalogAttributes. + * @param request BatchRemoveCatalogAttributesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BatchRemoveCatalogAttributesResponse + */ + public batchRemoveCatalogAttributes(request: google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesRequest, callback: google.cloud.retail.v2alpha.CatalogService.BatchRemoveCatalogAttributesCallback): void; + + /** + * Calls BatchRemoveCatalogAttributes. + * @param request BatchRemoveCatalogAttributesRequest message or plain object + * @returns Promise + */ + public batchRemoveCatalogAttributes(request: google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesRequest): Promise; + /** * Calls ReplaceCatalogAttribute. * @param request ReplaceCatalogAttributeRequest message or plain object @@ -22028,6 +22292,13 @@ export namespace google { */ type RemoveCatalogAttributeCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.AttributesConfig) => void; + /** + * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService|batchRemoveCatalogAttributes}. + * @param error Error, if any + * @param [response] BatchRemoveCatalogAttributesResponse + */ + type BatchRemoveCatalogAttributesCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse) => void; + /** * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService|replaceCatalogAttribute}. * @param error Error, if any @@ -23124,154 +23395,360 @@ export namespace google { * Decodes an AddCatalogAttributeRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AddCatalogAttributeRequest + * @returns AddCatalogAttributeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.AddCatalogAttributeRequest; + + /** + * Decodes an AddCatalogAttributeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AddCatalogAttributeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.AddCatalogAttributeRequest; + + /** + * Verifies an AddCatalogAttributeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AddCatalogAttributeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AddCatalogAttributeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.AddCatalogAttributeRequest; + + /** + * Creates a plain object from an AddCatalogAttributeRequest message. Also converts values to other types if specified. + * @param message AddCatalogAttributeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.AddCatalogAttributeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AddCatalogAttributeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AddCatalogAttributeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RemoveCatalogAttributeRequest. */ + interface IRemoveCatalogAttributeRequest { + + /** RemoveCatalogAttributeRequest attributesConfig */ + attributesConfig?: (string|null); + + /** RemoveCatalogAttributeRequest key */ + key?: (string|null); + } + + /** Represents a RemoveCatalogAttributeRequest. */ + class RemoveCatalogAttributeRequest implements IRemoveCatalogAttributeRequest { + + /** + * Constructs a new RemoveCatalogAttributeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IRemoveCatalogAttributeRequest); + + /** RemoveCatalogAttributeRequest attributesConfig. */ + public attributesConfig: string; + + /** RemoveCatalogAttributeRequest key. */ + public key: string; + + /** + * Creates a new RemoveCatalogAttributeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RemoveCatalogAttributeRequest instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IRemoveCatalogAttributeRequest): google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest; + + /** + * Encodes the specified RemoveCatalogAttributeRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest.verify|verify} messages. + * @param message RemoveCatalogAttributeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.IRemoveCatalogAttributeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RemoveCatalogAttributeRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest.verify|verify} messages. + * @param message RemoveCatalogAttributeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.IRemoveCatalogAttributeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RemoveCatalogAttributeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RemoveCatalogAttributeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest; + + /** + * Decodes a RemoveCatalogAttributeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RemoveCatalogAttributeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest; + + /** + * Verifies a RemoveCatalogAttributeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RemoveCatalogAttributeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RemoveCatalogAttributeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest; + + /** + * Creates a plain object from a RemoveCatalogAttributeRequest message. Also converts values to other types if specified. + * @param message RemoveCatalogAttributeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RemoveCatalogAttributeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RemoveCatalogAttributeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchRemoveCatalogAttributesRequest. */ + interface IBatchRemoveCatalogAttributesRequest { + + /** BatchRemoveCatalogAttributesRequest attributesConfig */ + attributesConfig?: (string|null); + + /** BatchRemoveCatalogAttributesRequest attributeKeys */ + attributeKeys?: (string[]|null); + } + + /** Represents a BatchRemoveCatalogAttributesRequest. */ + class BatchRemoveCatalogAttributesRequest implements IBatchRemoveCatalogAttributesRequest { + + /** + * Constructs a new BatchRemoveCatalogAttributesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesRequest); + + /** BatchRemoveCatalogAttributesRequest attributesConfig. */ + public attributesConfig: string; + + /** BatchRemoveCatalogAttributesRequest attributeKeys. */ + public attributeKeys: string[]; + + /** + * Creates a new BatchRemoveCatalogAttributesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchRemoveCatalogAttributesRequest instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesRequest): google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest; + + /** + * Encodes the specified BatchRemoveCatalogAttributesRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest.verify|verify} messages. + * @param message BatchRemoveCatalogAttributesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchRemoveCatalogAttributesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest.verify|verify} messages. + * @param message BatchRemoveCatalogAttributesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchRemoveCatalogAttributesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchRemoveCatalogAttributesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.AddCatalogAttributeRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest; /** - * Decodes an AddCatalogAttributeRequest message from the specified reader or buffer, length delimited. + * Decodes a BatchRemoveCatalogAttributesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AddCatalogAttributeRequest + * @returns BatchRemoveCatalogAttributesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.AddCatalogAttributeRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest; /** - * Verifies an AddCatalogAttributeRequest message. + * Verifies a BatchRemoveCatalogAttributesRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an AddCatalogAttributeRequest message from a plain object. Also converts values to their respective internal types. + * Creates a BatchRemoveCatalogAttributesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AddCatalogAttributeRequest + * @returns BatchRemoveCatalogAttributesRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.AddCatalogAttributeRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest; /** - * Creates a plain object from an AddCatalogAttributeRequest message. Also converts values to other types if specified. - * @param message AddCatalogAttributeRequest + * Creates a plain object from a BatchRemoveCatalogAttributesRequest message. Also converts values to other types if specified. + * @param message BatchRemoveCatalogAttributesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.AddCatalogAttributeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AddCatalogAttributeRequest to JSON. + * Converts this BatchRemoveCatalogAttributesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for AddCatalogAttributeRequest + * Gets the default type url for BatchRemoveCatalogAttributesRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a RemoveCatalogAttributeRequest. */ - interface IRemoveCatalogAttributeRequest { + /** Properties of a BatchRemoveCatalogAttributesResponse. */ + interface IBatchRemoveCatalogAttributesResponse { - /** RemoveCatalogAttributeRequest attributesConfig */ - attributesConfig?: (string|null); + /** BatchRemoveCatalogAttributesResponse deletedCatalogAttributes */ + deletedCatalogAttributes?: (string[]|null); - /** RemoveCatalogAttributeRequest key */ - key?: (string|null); + /** BatchRemoveCatalogAttributesResponse resetCatalogAttributes */ + resetCatalogAttributes?: (string[]|null); } - /** Represents a RemoveCatalogAttributeRequest. */ - class RemoveCatalogAttributeRequest implements IRemoveCatalogAttributeRequest { + /** Represents a BatchRemoveCatalogAttributesResponse. */ + class BatchRemoveCatalogAttributesResponse implements IBatchRemoveCatalogAttributesResponse { /** - * Constructs a new RemoveCatalogAttributeRequest. + * Constructs a new BatchRemoveCatalogAttributesResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IRemoveCatalogAttributeRequest); + constructor(properties?: google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesResponse); - /** RemoveCatalogAttributeRequest attributesConfig. */ - public attributesConfig: string; + /** BatchRemoveCatalogAttributesResponse deletedCatalogAttributes. */ + public deletedCatalogAttributes: string[]; - /** RemoveCatalogAttributeRequest key. */ - public key: string; + /** BatchRemoveCatalogAttributesResponse resetCatalogAttributes. */ + public resetCatalogAttributes: string[]; /** - * Creates a new RemoveCatalogAttributeRequest instance using the specified properties. + * Creates a new BatchRemoveCatalogAttributesResponse instance using the specified properties. * @param [properties] Properties to set - * @returns RemoveCatalogAttributeRequest instance + * @returns BatchRemoveCatalogAttributesResponse instance */ - public static create(properties?: google.cloud.retail.v2alpha.IRemoveCatalogAttributeRequest): google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest; + public static create(properties?: google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesResponse): google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse; /** - * Encodes the specified RemoveCatalogAttributeRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest.verify|verify} messages. - * @param message RemoveCatalogAttributeRequest message or plain object to encode + * Encodes the specified BatchRemoveCatalogAttributesResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse.verify|verify} messages. + * @param message BatchRemoveCatalogAttributesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IRemoveCatalogAttributeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RemoveCatalogAttributeRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest.verify|verify} messages. - * @param message RemoveCatalogAttributeRequest message or plain object to encode + * Encodes the specified BatchRemoveCatalogAttributesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse.verify|verify} messages. + * @param message BatchRemoveCatalogAttributesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IRemoveCatalogAttributeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RemoveCatalogAttributeRequest message from the specified reader or buffer. + * Decodes a BatchRemoveCatalogAttributesResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RemoveCatalogAttributeRequest + * @returns BatchRemoveCatalogAttributesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse; /** - * Decodes a RemoveCatalogAttributeRequest message from the specified reader or buffer, length delimited. + * Decodes a BatchRemoveCatalogAttributesResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RemoveCatalogAttributeRequest + * @returns BatchRemoveCatalogAttributesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse; /** - * Verifies a RemoveCatalogAttributeRequest message. + * Verifies a BatchRemoveCatalogAttributesResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a RemoveCatalogAttributeRequest message from a plain object. Also converts values to their respective internal types. + * Creates a BatchRemoveCatalogAttributesResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RemoveCatalogAttributeRequest + * @returns BatchRemoveCatalogAttributesResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse; /** - * Creates a plain object from a RemoveCatalogAttributeRequest message. Also converts values to other types if specified. - * @param message RemoveCatalogAttributeRequest + * Creates a plain object from a BatchRemoveCatalogAttributesResponse message. Also converts values to other types if specified. + * @param message BatchRemoveCatalogAttributesResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RemoveCatalogAttributeRequest to JSON. + * Converts this BatchRemoveCatalogAttributesResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for RemoveCatalogAttributeRequest + * Gets the default type url for BatchRemoveCatalogAttributesResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ @@ -23476,6 +23953,9 @@ export namespace google { /** CompleteQueryRequest maxSuggestions */ maxSuggestions?: (number|null); + + /** CompleteQueryRequest enableAttributeSuggestions */ + enableAttributeSuggestions?: (boolean|null); } /** Represents a CompleteQueryRequest. */ @@ -23508,6 +23988,9 @@ export namespace google { /** CompleteQueryRequest maxSuggestions. */ public maxSuggestions: number; + /** CompleteQueryRequest enableAttributeSuggestions. */ + public enableAttributeSuggestions: boolean; + /** * Creates a new CompleteQueryRequest instance using the specified properties. * @param [properties] Properties to set @@ -23597,6 +24080,9 @@ export namespace google { /** CompleteQueryResponse recentSearchResults */ recentSearchResults?: (google.cloud.retail.v2alpha.CompleteQueryResponse.IRecentSearchResult[]|null); + + /** CompleteQueryResponse attributeResults */ + attributeResults?: ({ [k: string]: google.cloud.retail.v2alpha.CompleteQueryResponse.IAttributeResult }|null); } /** Represents a CompleteQueryResponse. */ @@ -23617,6 +24103,9 @@ export namespace google { /** CompleteQueryResponse recentSearchResults. */ public recentSearchResults: google.cloud.retail.v2alpha.CompleteQueryResponse.IRecentSearchResult[]; + /** CompleteQueryResponse attributeResults. */ + public attributeResults: { [k: string]: google.cloud.retail.v2alpha.CompleteQueryResponse.IAttributeResult }; + /** * Creates a new CompleteQueryResponse instance using the specified properties. * @param [properties] Properties to set @@ -23896,6 +24385,103 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** Properties of an AttributeResult. */ + interface IAttributeResult { + + /** AttributeResult suggestions */ + suggestions?: (string[]|null); + } + + /** Represents an AttributeResult. */ + class AttributeResult implements IAttributeResult { + + /** + * Constructs a new AttributeResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.CompleteQueryResponse.IAttributeResult); + + /** AttributeResult suggestions. */ + public suggestions: string[]; + + /** + * Creates a new AttributeResult instance using the specified properties. + * @param [properties] Properties to set + * @returns AttributeResult instance + */ + public static create(properties?: google.cloud.retail.v2alpha.CompleteQueryResponse.IAttributeResult): google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult; + + /** + * Encodes the specified AttributeResult message. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult.verify|verify} messages. + * @param message AttributeResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.CompleteQueryResponse.IAttributeResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AttributeResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult.verify|verify} messages. + * @param message AttributeResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.CompleteQueryResponse.IAttributeResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AttributeResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AttributeResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult; + + /** + * Decodes an AttributeResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AttributeResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult; + + /** + * Verifies an AttributeResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AttributeResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AttributeResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult; + + /** + * Creates a plain object from an AttributeResult message. Also converts values to other types if specified. + * @param message AttributeResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AttributeResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AttributeResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } /** Properties of a Control. */ @@ -25403,6 +25989,9 @@ export namespace google { /** SearchResult variantRollupValues */ variantRollupValues?: ({ [k: string]: google.protobuf.IValue }|null); + + /** SearchResult personalLabels */ + personalLabels?: (string[]|null); } /** Represents a SearchResult. */ @@ -25429,6 +26018,9 @@ export namespace google { /** SearchResult variantRollupValues. */ public variantRollupValues: { [k: string]: google.protobuf.IValue }; + /** SearchResult personalLabels. */ + public personalLabels: string[]; + /** * Creates a new SearchResult instance using the specified properties. * @param [properties] Properties to set @@ -27026,6 +27618,9 @@ export namespace google { /** OutputResult bigqueryResult */ bigqueryResult?: (google.cloud.retail.v2alpha.IBigQueryOutputResult[]|null); + + /** OutputResult gcsResult */ + gcsResult?: (google.cloud.retail.v2alpha.IGcsOutputResult[]|null); } /** Represents an OutputResult. */ @@ -27040,6 +27635,9 @@ export namespace google { /** OutputResult bigqueryResult. */ public bigqueryResult: google.cloud.retail.v2alpha.IBigQueryOutputResult[]; + /** OutputResult gcsResult. */ + public gcsResult: google.cloud.retail.v2alpha.IGcsOutputResult[]; + /** * Creates a new OutputResult instance using the specified properties. * @param [properties] Properties to set @@ -27221,6 +27819,103 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a GcsOutputResult. */ + interface IGcsOutputResult { + + /** GcsOutputResult outputUri */ + outputUri?: (string|null); + } + + /** Represents a GcsOutputResult. */ + class GcsOutputResult implements IGcsOutputResult { + + /** + * Constructs a new GcsOutputResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IGcsOutputResult); + + /** GcsOutputResult outputUri. */ + public outputUri: string; + + /** + * Creates a new GcsOutputResult instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsOutputResult instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IGcsOutputResult): google.cloud.retail.v2alpha.GcsOutputResult; + + /** + * Encodes the specified GcsOutputResult message. Does not implicitly {@link google.cloud.retail.v2alpha.GcsOutputResult.verify|verify} messages. + * @param message GcsOutputResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.IGcsOutputResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsOutputResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.GcsOutputResult.verify|verify} messages. + * @param message GcsOutputResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.IGcsOutputResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcsOutputResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcsOutputResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.GcsOutputResult; + + /** + * Decodes a GcsOutputResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcsOutputResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.GcsOutputResult; + + /** + * Verifies a GcsOutputResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GcsOutputResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcsOutputResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.GcsOutputResult; + + /** + * Creates a plain object from a GcsOutputResult message. Also converts values to other types if specified. + * @param message GcsOutputResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.GcsOutputResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsOutputResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcsOutputResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a Model. */ interface IModel { @@ -32637,9 +33332,15 @@ export namespace google { /** ServingConfig diversityLevel */ diversityLevel?: (string|null); + /** ServingConfig diversityType */ + diversityType?: (google.cloud.retail.v2alpha.ServingConfig.DiversityType|keyof typeof google.cloud.retail.v2alpha.ServingConfig.DiversityType|null); + /** ServingConfig enableCategoryFilterLevel */ enableCategoryFilterLevel?: (string|null); + /** ServingConfig personalizationSpec */ + personalizationSpec?: (google.cloud.retail.v2alpha.SearchRequest.IPersonalizationSpec|null); + /** ServingConfig solutionTypes */ solutionTypes?: (google.cloud.retail.v2alpha.SolutionType[]|null); } @@ -32698,9 +33399,15 @@ export namespace google { /** ServingConfig diversityLevel. */ public diversityLevel: string; + /** ServingConfig diversityType. */ + public diversityType: (google.cloud.retail.v2alpha.ServingConfig.DiversityType|keyof typeof google.cloud.retail.v2alpha.ServingConfig.DiversityType); + /** ServingConfig enableCategoryFilterLevel. */ public enableCategoryFilterLevel: string; + /** ServingConfig personalizationSpec. */ + public personalizationSpec?: (google.cloud.retail.v2alpha.SearchRequest.IPersonalizationSpec|null); + /** ServingConfig solutionTypes. */ public solutionTypes: google.cloud.retail.v2alpha.SolutionType[]; @@ -32782,6 +33489,16 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + namespace ServingConfig { + + /** DiversityType enum. */ + enum DiversityType { + DIVERSITY_TYPE_UNSPECIFIED = 0, + RULE_BASED_DIVERSITY = 2, + DATA_DRIVEN_DIVERSITY = 3 + } + } + /** Represents a ServingConfigService */ class ServingConfigService extends $protobuf.rpc.Service { @@ -33914,6 +34631,9 @@ export namespace google { /** WriteUserEventRequest userEvent */ userEvent?: (google.cloud.retail.v2alpha.IUserEvent|null); + + /** WriteUserEventRequest writeAsync */ + writeAsync?: (boolean|null); } /** Represents a WriteUserEventRequest. */ @@ -33931,6 +34651,9 @@ export namespace google { /** WriteUserEventRequest userEvent. */ public userEvent?: (google.cloud.retail.v2alpha.IUserEvent|null); + /** WriteUserEventRequest writeAsync. */ + public writeAsync: boolean; + /** * Creates a new WriteUserEventRequest instance using the specified properties. * @param [properties] Properties to set @@ -34012,6 +34735,9 @@ export namespace google { /** Properties of a CollectUserEventRequest. */ interface ICollectUserEventRequest { + /** CollectUserEventRequest prebuiltRule */ + prebuiltRule?: (string|null); + /** CollectUserEventRequest parent */ parent?: (string|null); @@ -34023,6 +34749,9 @@ export namespace google { /** CollectUserEventRequest ets */ ets?: (number|Long|string|null); + + /** CollectUserEventRequest rawJson */ + rawJson?: (string|null); } /** Represents a CollectUserEventRequest. */ @@ -34034,6 +34763,9 @@ export namespace google { */ constructor(properties?: google.cloud.retail.v2alpha.ICollectUserEventRequest); + /** CollectUserEventRequest prebuiltRule. */ + public prebuiltRule?: (string|null); + /** CollectUserEventRequest parent. */ public parent: string; @@ -34046,6 +34778,12 @@ export namespace google { /** CollectUserEventRequest ets. */ public ets: (number|Long|string); + /** CollectUserEventRequest rawJson. */ + public rawJson: string; + + /** CollectUserEventRequest conversionRule. */ + public conversionRule?: "prebuiltRule"; + /** * Creates a new CollectUserEventRequest instance using the specified properties. * @param [properties] Properties to set diff --git a/packages/google-cloud-retail/protos/protos.js b/packages/google-cloud-retail/protos/protos.js index b8840714673..a71cd30c3a5 100644 --- a/packages/google-cloud-retail/protos/protos.js +++ b/packages/google-cloud-retail/protos/protos.js @@ -38835,6 +38835,8 @@ * @property {google.cloud.retail.v2alpha.CatalogAttribute.DynamicFacetableOption|null} [dynamicFacetableOption] CatalogAttribute dynamicFacetableOption * @property {google.cloud.retail.v2alpha.CatalogAttribute.SearchableOption|null} [searchableOption] CatalogAttribute searchableOption * @property {google.cloud.retail.v2alpha.RecommendationsFilteringOption|null} [recommendationsFilteringOption] CatalogAttribute recommendationsFilteringOption + * @property {google.cloud.retail.v2alpha.CatalogAttribute.ExactSearchableOption|null} [exactSearchableOption] CatalogAttribute exactSearchableOption + * @property {google.cloud.retail.v2alpha.CatalogAttribute.RetrievableOption|null} [retrievableOption] CatalogAttribute retrievableOption */ /** @@ -38908,6 +38910,22 @@ */ CatalogAttribute.prototype.recommendationsFilteringOption = 0; + /** + * CatalogAttribute exactSearchableOption. + * @member {google.cloud.retail.v2alpha.CatalogAttribute.ExactSearchableOption} exactSearchableOption + * @memberof google.cloud.retail.v2alpha.CatalogAttribute + * @instance + */ + CatalogAttribute.prototype.exactSearchableOption = 0; + + /** + * CatalogAttribute retrievableOption. + * @member {google.cloud.retail.v2alpha.CatalogAttribute.RetrievableOption} retrievableOption + * @memberof google.cloud.retail.v2alpha.CatalogAttribute + * @instance + */ + CatalogAttribute.prototype.retrievableOption = 0; + /** * Creates a new CatalogAttribute instance using the specified properties. * @function create @@ -38946,6 +38964,10 @@ writer.uint32(/* id 9, wireType 0 =*/72).bool(message.inUse); if (message.type != null && Object.hasOwnProperty.call(message, "type")) writer.uint32(/* id 10, wireType 0 =*/80).int32(message.type); + if (message.exactSearchableOption != null && Object.hasOwnProperty.call(message, "exactSearchableOption")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.exactSearchableOption); + if (message.retrievableOption != null && Object.hasOwnProperty.call(message, "retrievableOption")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.retrievableOption); return writer; }; @@ -39008,6 +39030,14 @@ message.recommendationsFilteringOption = reader.int32(); break; } + case 11: { + message.exactSearchableOption = reader.int32(); + break; + } + case 12: { + message.retrievableOption = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -39094,6 +39124,24 @@ case 3: break; } + if (message.exactSearchableOption != null && message.hasOwnProperty("exactSearchableOption")) + switch (message.exactSearchableOption) { + default: + return "exactSearchableOption: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.retrievableOption != null && message.hasOwnProperty("retrievableOption")) + switch (message.retrievableOption) { + default: + return "retrievableOption: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; @@ -39213,6 +39261,46 @@ message.recommendationsFilteringOption = 3; break; } + switch (object.exactSearchableOption) { + default: + if (typeof object.exactSearchableOption === "number") { + message.exactSearchableOption = object.exactSearchableOption; + break; + } + break; + case "EXACT_SEARCHABLE_OPTION_UNSPECIFIED": + case 0: + message.exactSearchableOption = 0; + break; + case "EXACT_SEARCHABLE_ENABLED": + case 1: + message.exactSearchableOption = 1; + break; + case "EXACT_SEARCHABLE_DISABLED": + case 2: + message.exactSearchableOption = 2; + break; + } + switch (object.retrievableOption) { + default: + if (typeof object.retrievableOption === "number") { + message.retrievableOption = object.retrievableOption; + break; + } + break; + case "RETRIEVABLE_OPTION_UNSPECIFIED": + case 0: + message.retrievableOption = 0; + break; + case "RETRIEVABLE_ENABLED": + case 1: + message.retrievableOption = 1; + break; + case "RETRIEVABLE_DISABLED": + case 2: + message.retrievableOption = 2; + break; + } return message; }; @@ -39237,6 +39325,8 @@ object.recommendationsFilteringOption = options.enums === String ? "RECOMMENDATIONS_FILTERING_OPTION_UNSPECIFIED" : 0; object.inUse = false; object.type = options.enums === String ? "UNKNOWN" : 0; + object.exactSearchableOption = options.enums === String ? "EXACT_SEARCHABLE_OPTION_UNSPECIFIED" : 0; + object.retrievableOption = options.enums === String ? "RETRIEVABLE_OPTION_UNSPECIFIED" : 0; } if (message.key != null && message.hasOwnProperty("key")) object.key = message.key; @@ -39252,6 +39342,10 @@ object.inUse = message.inUse; if (message.type != null && message.hasOwnProperty("type")) object.type = options.enums === String ? $root.google.cloud.retail.v2alpha.CatalogAttribute.AttributeType[message.type] === undefined ? message.type : $root.google.cloud.retail.v2alpha.CatalogAttribute.AttributeType[message.type] : message.type; + if (message.exactSearchableOption != null && message.hasOwnProperty("exactSearchableOption")) + object.exactSearchableOption = options.enums === String ? $root.google.cloud.retail.v2alpha.CatalogAttribute.ExactSearchableOption[message.exactSearchableOption] === undefined ? message.exactSearchableOption : $root.google.cloud.retail.v2alpha.CatalogAttribute.ExactSearchableOption[message.exactSearchableOption] : message.exactSearchableOption; + if (message.retrievableOption != null && message.hasOwnProperty("retrievableOption")) + object.retrievableOption = options.enums === String ? $root.google.cloud.retail.v2alpha.CatalogAttribute.RetrievableOption[message.retrievableOption] === undefined ? message.retrievableOption : $root.google.cloud.retail.v2alpha.CatalogAttribute.RetrievableOption[message.retrievableOption] : message.retrievableOption; return object; }; @@ -39345,6 +39439,38 @@ return values; })(); + /** + * ExactSearchableOption enum. + * @name google.cloud.retail.v2alpha.CatalogAttribute.ExactSearchableOption + * @enum {number} + * @property {number} EXACT_SEARCHABLE_OPTION_UNSPECIFIED=0 EXACT_SEARCHABLE_OPTION_UNSPECIFIED value + * @property {number} EXACT_SEARCHABLE_ENABLED=1 EXACT_SEARCHABLE_ENABLED value + * @property {number} EXACT_SEARCHABLE_DISABLED=2 EXACT_SEARCHABLE_DISABLED value + */ + CatalogAttribute.ExactSearchableOption = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EXACT_SEARCHABLE_OPTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "EXACT_SEARCHABLE_ENABLED"] = 1; + values[valuesById[2] = "EXACT_SEARCHABLE_DISABLED"] = 2; + return values; + })(); + + /** + * RetrievableOption enum. + * @name google.cloud.retail.v2alpha.CatalogAttribute.RetrievableOption + * @enum {number} + * @property {number} RETRIEVABLE_OPTION_UNSPECIFIED=0 RETRIEVABLE_OPTION_UNSPECIFIED value + * @property {number} RETRIEVABLE_ENABLED=1 RETRIEVABLE_ENABLED value + * @property {number} RETRIEVABLE_DISABLED=2 RETRIEVABLE_DISABLED value + */ + CatalogAttribute.RetrievableOption = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RETRIEVABLE_OPTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "RETRIEVABLE_ENABLED"] = 1; + values[valuesById[2] = "RETRIEVABLE_DISABLED"] = 2; + return values; + })(); + return CatalogAttribute; })(); @@ -40125,6 +40251,7 @@ * @property {Array.|null} [destinations] MerchantCenterLink destinations * @property {string|null} [regionCode] MerchantCenterLink regionCode * @property {string|null} [languageCode] MerchantCenterLink languageCode + * @property {Array.|null} [feeds] MerchantCenterLink feeds */ /** @@ -40137,6 +40264,7 @@ */ function MerchantCenterLink(properties) { this.destinations = []; + this.feeds = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -40183,6 +40311,14 @@ */ MerchantCenterLink.prototype.languageCode = ""; + /** + * MerchantCenterLink feeds. + * @member {Array.} feeds + * @memberof google.cloud.retail.v2alpha.MerchantCenterLink + * @instance + */ + MerchantCenterLink.prototype.feeds = $util.emptyArray; + /** * Creates a new MerchantCenterLink instance using the specified properties. * @function create @@ -40218,6 +40354,9 @@ writer.uint32(/* id 4, wireType 2 =*/34).string(message.regionCode); if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.languageCode); + if (message.feeds != null && message.feeds.length) + for (var i = 0; i < message.feeds.length; ++i) + $root.google.cloud.retail.v2alpha.MerchantCenterFeedFilter.encode(message.feeds[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; @@ -40274,6 +40413,12 @@ message.languageCode = reader.string(); break; } + case 6: { + if (!(message.feeds && message.feeds.length)) + message.feeds = []; + message.feeds.push($root.google.cloud.retail.v2alpha.MerchantCenterFeedFilter.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -40328,6 +40473,15 @@ if (message.languageCode != null && message.hasOwnProperty("languageCode")) if (!$util.isString(message.languageCode)) return "languageCode: string expected"; + if (message.feeds != null && message.hasOwnProperty("feeds")) { + if (!Array.isArray(message.feeds)) + return "feeds: array expected"; + for (var i = 0; i < message.feeds.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.MerchantCenterFeedFilter.verify(message.feeds[i]); + if (error) + return "feeds." + error; + } + } return null; }; @@ -40365,6 +40519,16 @@ message.regionCode = String(object.regionCode); if (object.languageCode != null) message.languageCode = String(object.languageCode); + if (object.feeds) { + if (!Array.isArray(object.feeds)) + throw TypeError(".google.cloud.retail.v2alpha.MerchantCenterLink.feeds: array expected"); + message.feeds = []; + for (var i = 0; i < object.feeds.length; ++i) { + if (typeof object.feeds[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.MerchantCenterLink.feeds: object expected"); + message.feeds[i] = $root.google.cloud.retail.v2alpha.MerchantCenterFeedFilter.fromObject(object.feeds[i]); + } + } return message; }; @@ -40381,8 +40545,10 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.destinations = []; + object.feeds = []; + } if (options.defaults) { if ($util.Long) { var long = new $util.Long(0, 0, false); @@ -40409,6 +40575,11 @@ object.regionCode = message.regionCode; if (message.languageCode != null && message.hasOwnProperty("languageCode")) object.languageCode = message.languageCode; + if (message.feeds && message.feeds.length) { + object.feeds = []; + for (var j = 0; j < message.feeds.length; ++j) + object.feeds[j] = $root.google.cloud.retail.v2alpha.MerchantCenterFeedFilter.toObject(message.feeds[j], options); + } return object; }; @@ -40441,6 +40612,247 @@ return MerchantCenterLink; })(); + v2alpha.MerchantCenterFeedFilter = (function() { + + /** + * Properties of a MerchantCenterFeedFilter. + * @memberof google.cloud.retail.v2alpha + * @interface IMerchantCenterFeedFilter + * @property {number|Long|null} [primaryFeedId] MerchantCenterFeedFilter primaryFeedId + * @property {string|null} [primaryFeedName] MerchantCenterFeedFilter primaryFeedName + */ + + /** + * Constructs a new MerchantCenterFeedFilter. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a MerchantCenterFeedFilter. + * @implements IMerchantCenterFeedFilter + * @constructor + * @param {google.cloud.retail.v2alpha.IMerchantCenterFeedFilter=} [properties] Properties to set + */ + function MerchantCenterFeedFilter(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MerchantCenterFeedFilter primaryFeedId. + * @member {number|Long} primaryFeedId + * @memberof google.cloud.retail.v2alpha.MerchantCenterFeedFilter + * @instance + */ + MerchantCenterFeedFilter.prototype.primaryFeedId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * MerchantCenterFeedFilter primaryFeedName. + * @member {string} primaryFeedName + * @memberof google.cloud.retail.v2alpha.MerchantCenterFeedFilter + * @instance + */ + MerchantCenterFeedFilter.prototype.primaryFeedName = ""; + + /** + * Creates a new MerchantCenterFeedFilter instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.MerchantCenterFeedFilter + * @static + * @param {google.cloud.retail.v2alpha.IMerchantCenterFeedFilter=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.MerchantCenterFeedFilter} MerchantCenterFeedFilter instance + */ + MerchantCenterFeedFilter.create = function create(properties) { + return new MerchantCenterFeedFilter(properties); + }; + + /** + * Encodes the specified MerchantCenterFeedFilter message. Does not implicitly {@link google.cloud.retail.v2alpha.MerchantCenterFeedFilter.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.MerchantCenterFeedFilter + * @static + * @param {google.cloud.retail.v2alpha.IMerchantCenterFeedFilter} message MerchantCenterFeedFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MerchantCenterFeedFilter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.primaryFeedId != null && Object.hasOwnProperty.call(message, "primaryFeedId")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.primaryFeedId); + if (message.primaryFeedName != null && Object.hasOwnProperty.call(message, "primaryFeedName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.primaryFeedName); + return writer; + }; + + /** + * Encodes the specified MerchantCenterFeedFilter message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.MerchantCenterFeedFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.MerchantCenterFeedFilter + * @static + * @param {google.cloud.retail.v2alpha.IMerchantCenterFeedFilter} message MerchantCenterFeedFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MerchantCenterFeedFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MerchantCenterFeedFilter message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.MerchantCenterFeedFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.MerchantCenterFeedFilter} MerchantCenterFeedFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MerchantCenterFeedFilter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.MerchantCenterFeedFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.primaryFeedId = reader.int64(); + break; + } + case 2: { + message.primaryFeedName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MerchantCenterFeedFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.MerchantCenterFeedFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.MerchantCenterFeedFilter} MerchantCenterFeedFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MerchantCenterFeedFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MerchantCenterFeedFilter message. + * @function verify + * @memberof google.cloud.retail.v2alpha.MerchantCenterFeedFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MerchantCenterFeedFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.primaryFeedId != null && message.hasOwnProperty("primaryFeedId")) + if (!$util.isInteger(message.primaryFeedId) && !(message.primaryFeedId && $util.isInteger(message.primaryFeedId.low) && $util.isInteger(message.primaryFeedId.high))) + return "primaryFeedId: integer|Long expected"; + if (message.primaryFeedName != null && message.hasOwnProperty("primaryFeedName")) + if (!$util.isString(message.primaryFeedName)) + return "primaryFeedName: string expected"; + return null; + }; + + /** + * Creates a MerchantCenterFeedFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.MerchantCenterFeedFilter + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.MerchantCenterFeedFilter} MerchantCenterFeedFilter + */ + MerchantCenterFeedFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.MerchantCenterFeedFilter) + return object; + var message = new $root.google.cloud.retail.v2alpha.MerchantCenterFeedFilter(); + if (object.primaryFeedId != null) + if ($util.Long) + (message.primaryFeedId = $util.Long.fromValue(object.primaryFeedId)).unsigned = false; + else if (typeof object.primaryFeedId === "string") + message.primaryFeedId = parseInt(object.primaryFeedId, 10); + else if (typeof object.primaryFeedId === "number") + message.primaryFeedId = object.primaryFeedId; + else if (typeof object.primaryFeedId === "object") + message.primaryFeedId = new $util.LongBits(object.primaryFeedId.low >>> 0, object.primaryFeedId.high >>> 0).toNumber(); + if (object.primaryFeedName != null) + message.primaryFeedName = String(object.primaryFeedName); + return message; + }; + + /** + * Creates a plain object from a MerchantCenterFeedFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.MerchantCenterFeedFilter + * @static + * @param {google.cloud.retail.v2alpha.MerchantCenterFeedFilter} message MerchantCenterFeedFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MerchantCenterFeedFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.primaryFeedId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.primaryFeedId = options.longs === String ? "0" : 0; + object.primaryFeedName = ""; + } + if (message.primaryFeedId != null && message.hasOwnProperty("primaryFeedId")) + if (typeof message.primaryFeedId === "number") + object.primaryFeedId = options.longs === String ? String(message.primaryFeedId) : message.primaryFeedId; + else + object.primaryFeedId = options.longs === String ? $util.Long.prototype.toString.call(message.primaryFeedId) : options.longs === Number ? new $util.LongBits(message.primaryFeedId.low >>> 0, message.primaryFeedId.high >>> 0).toNumber() : message.primaryFeedId; + if (message.primaryFeedName != null && message.hasOwnProperty("primaryFeedName")) + object.primaryFeedName = message.primaryFeedName; + return object; + }; + + /** + * Converts this MerchantCenterFeedFilter to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.MerchantCenterFeedFilter + * @instance + * @returns {Object.} JSON object + */ + MerchantCenterFeedFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MerchantCenterFeedFilter + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.MerchantCenterFeedFilter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MerchantCenterFeedFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.MerchantCenterFeedFilter"; + }; + + return MerchantCenterFeedFilter; + })(); + v2alpha.MerchantCenterLinkingConfig = (function() { /** @@ -50359,6 +50771,7 @@ * @property {number|Long|null} [failureCount] ImportMetadata failureCount * @property {string|null} [requestId] ImportMetadata requestId * @property {string|null} [notificationPubsubTopic] ImportMetadata notificationPubsubTopic + * @property {google.cloud.retail.v2alpha.ITransformedUserEventsMetadata|null} [transformedUserEventsMetadata] ImportMetadata transformedUserEventsMetadata */ /** @@ -50424,6 +50837,14 @@ */ ImportMetadata.prototype.notificationPubsubTopic = ""; + /** + * ImportMetadata transformedUserEventsMetadata. + * @member {google.cloud.retail.v2alpha.ITransformedUserEventsMetadata|null|undefined} transformedUserEventsMetadata + * @memberof google.cloud.retail.v2alpha.ImportMetadata + * @instance + */ + ImportMetadata.prototype.transformedUserEventsMetadata = null; + /** * Creates a new ImportMetadata instance using the specified properties. * @function create @@ -50460,6 +50881,8 @@ writer.uint32(/* id 5, wireType 2 =*/42).string(message.requestId); if (message.notificationPubsubTopic != null && Object.hasOwnProperty.call(message, "notificationPubsubTopic")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.notificationPubsubTopic); + if (message.transformedUserEventsMetadata != null && Object.hasOwnProperty.call(message, "transformedUserEventsMetadata")) + $root.google.cloud.retail.v2alpha.TransformedUserEventsMetadata.encode(message.transformedUserEventsMetadata, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); return writer; }; @@ -50518,6 +50941,10 @@ message.notificationPubsubTopic = reader.string(); break; } + case 7: { + message.transformedUserEventsMetadata = $root.google.cloud.retail.v2alpha.TransformedUserEventsMetadata.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -50575,6 +51002,11 @@ if (message.notificationPubsubTopic != null && message.hasOwnProperty("notificationPubsubTopic")) if (!$util.isString(message.notificationPubsubTopic)) return "notificationPubsubTopic: string expected"; + if (message.transformedUserEventsMetadata != null && message.hasOwnProperty("transformedUserEventsMetadata")) { + var error = $root.google.cloud.retail.v2alpha.TransformedUserEventsMetadata.verify(message.transformedUserEventsMetadata); + if (error) + return "transformedUserEventsMetadata." + error; + } return null; }; @@ -50622,6 +51054,11 @@ message.requestId = String(object.requestId); if (object.notificationPubsubTopic != null) message.notificationPubsubTopic = String(object.notificationPubsubTopic); + if (object.transformedUserEventsMetadata != null) { + if (typeof object.transformedUserEventsMetadata !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ImportMetadata.transformedUserEventsMetadata: object expected"); + message.transformedUserEventsMetadata = $root.google.cloud.retail.v2alpha.TransformedUserEventsMetadata.fromObject(object.transformedUserEventsMetadata); + } return message; }; @@ -50653,6 +51090,7 @@ object.failureCount = options.longs === String ? "0" : 0; object.requestId = ""; object.notificationPubsubTopic = ""; + object.transformedUserEventsMetadata = null; } if (message.createTime != null && message.hasOwnProperty("createTime")) object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); @@ -50672,6 +51110,8 @@ object.requestId = message.requestId; if (message.notificationPubsubTopic != null && message.hasOwnProperty("notificationPubsubTopic")) object.notificationPubsubTopic = message.notificationPubsubTopic; + if (message.transformedUserEventsMetadata != null && message.hasOwnProperty("transformedUserEventsMetadata")) + object.transformedUserEventsMetadata = $root.google.cloud.retail.v2alpha.TransformedUserEventsMetadata.toObject(message.transformedUserEventsMetadata, options); return object; }; @@ -50704,6 +51144,261 @@ return ImportMetadata; })(); + v2alpha.TransformedUserEventsMetadata = (function() { + + /** + * Properties of a TransformedUserEventsMetadata. + * @memberof google.cloud.retail.v2alpha + * @interface ITransformedUserEventsMetadata + * @property {number|Long|null} [sourceEventsCount] TransformedUserEventsMetadata sourceEventsCount + * @property {number|Long|null} [transformedEventsCount] TransformedUserEventsMetadata transformedEventsCount + */ + + /** + * Constructs a new TransformedUserEventsMetadata. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a TransformedUserEventsMetadata. + * @implements ITransformedUserEventsMetadata + * @constructor + * @param {google.cloud.retail.v2alpha.ITransformedUserEventsMetadata=} [properties] Properties to set + */ + function TransformedUserEventsMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransformedUserEventsMetadata sourceEventsCount. + * @member {number|Long} sourceEventsCount + * @memberof google.cloud.retail.v2alpha.TransformedUserEventsMetadata + * @instance + */ + TransformedUserEventsMetadata.prototype.sourceEventsCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TransformedUserEventsMetadata transformedEventsCount. + * @member {number|Long} transformedEventsCount + * @memberof google.cloud.retail.v2alpha.TransformedUserEventsMetadata + * @instance + */ + TransformedUserEventsMetadata.prototype.transformedEventsCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TransformedUserEventsMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.TransformedUserEventsMetadata + * @static + * @param {google.cloud.retail.v2alpha.ITransformedUserEventsMetadata=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.TransformedUserEventsMetadata} TransformedUserEventsMetadata instance + */ + TransformedUserEventsMetadata.create = function create(properties) { + return new TransformedUserEventsMetadata(properties); + }; + + /** + * Encodes the specified TransformedUserEventsMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.TransformedUserEventsMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.TransformedUserEventsMetadata + * @static + * @param {google.cloud.retail.v2alpha.ITransformedUserEventsMetadata} message TransformedUserEventsMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransformedUserEventsMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sourceEventsCount != null && Object.hasOwnProperty.call(message, "sourceEventsCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.sourceEventsCount); + if (message.transformedEventsCount != null && Object.hasOwnProperty.call(message, "transformedEventsCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.transformedEventsCount); + return writer; + }; + + /** + * Encodes the specified TransformedUserEventsMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.TransformedUserEventsMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.TransformedUserEventsMetadata + * @static + * @param {google.cloud.retail.v2alpha.ITransformedUserEventsMetadata} message TransformedUserEventsMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransformedUserEventsMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransformedUserEventsMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.TransformedUserEventsMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.TransformedUserEventsMetadata} TransformedUserEventsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransformedUserEventsMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.TransformedUserEventsMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.sourceEventsCount = reader.int64(); + break; + } + case 2: { + message.transformedEventsCount = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransformedUserEventsMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.TransformedUserEventsMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.TransformedUserEventsMetadata} TransformedUserEventsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransformedUserEventsMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransformedUserEventsMetadata message. + * @function verify + * @memberof google.cloud.retail.v2alpha.TransformedUserEventsMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransformedUserEventsMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sourceEventsCount != null && message.hasOwnProperty("sourceEventsCount")) + if (!$util.isInteger(message.sourceEventsCount) && !(message.sourceEventsCount && $util.isInteger(message.sourceEventsCount.low) && $util.isInteger(message.sourceEventsCount.high))) + return "sourceEventsCount: integer|Long expected"; + if (message.transformedEventsCount != null && message.hasOwnProperty("transformedEventsCount")) + if (!$util.isInteger(message.transformedEventsCount) && !(message.transformedEventsCount && $util.isInteger(message.transformedEventsCount.low) && $util.isInteger(message.transformedEventsCount.high))) + return "transformedEventsCount: integer|Long expected"; + return null; + }; + + /** + * Creates a TransformedUserEventsMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.TransformedUserEventsMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.TransformedUserEventsMetadata} TransformedUserEventsMetadata + */ + TransformedUserEventsMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.TransformedUserEventsMetadata) + return object; + var message = new $root.google.cloud.retail.v2alpha.TransformedUserEventsMetadata(); + if (object.sourceEventsCount != null) + if ($util.Long) + (message.sourceEventsCount = $util.Long.fromValue(object.sourceEventsCount)).unsigned = false; + else if (typeof object.sourceEventsCount === "string") + message.sourceEventsCount = parseInt(object.sourceEventsCount, 10); + else if (typeof object.sourceEventsCount === "number") + message.sourceEventsCount = object.sourceEventsCount; + else if (typeof object.sourceEventsCount === "object") + message.sourceEventsCount = new $util.LongBits(object.sourceEventsCount.low >>> 0, object.sourceEventsCount.high >>> 0).toNumber(); + if (object.transformedEventsCount != null) + if ($util.Long) + (message.transformedEventsCount = $util.Long.fromValue(object.transformedEventsCount)).unsigned = false; + else if (typeof object.transformedEventsCount === "string") + message.transformedEventsCount = parseInt(object.transformedEventsCount, 10); + else if (typeof object.transformedEventsCount === "number") + message.transformedEventsCount = object.transformedEventsCount; + else if (typeof object.transformedEventsCount === "object") + message.transformedEventsCount = new $util.LongBits(object.transformedEventsCount.low >>> 0, object.transformedEventsCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a TransformedUserEventsMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.TransformedUserEventsMetadata + * @static + * @param {google.cloud.retail.v2alpha.TransformedUserEventsMetadata} message TransformedUserEventsMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransformedUserEventsMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.sourceEventsCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.sourceEventsCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.transformedEventsCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.transformedEventsCount = options.longs === String ? "0" : 0; + } + if (message.sourceEventsCount != null && message.hasOwnProperty("sourceEventsCount")) + if (typeof message.sourceEventsCount === "number") + object.sourceEventsCount = options.longs === String ? String(message.sourceEventsCount) : message.sourceEventsCount; + else + object.sourceEventsCount = options.longs === String ? $util.Long.prototype.toString.call(message.sourceEventsCount) : options.longs === Number ? new $util.LongBits(message.sourceEventsCount.low >>> 0, message.sourceEventsCount.high >>> 0).toNumber() : message.sourceEventsCount; + if (message.transformedEventsCount != null && message.hasOwnProperty("transformedEventsCount")) + if (typeof message.transformedEventsCount === "number") + object.transformedEventsCount = options.longs === String ? String(message.transformedEventsCount) : message.transformedEventsCount; + else + object.transformedEventsCount = options.longs === String ? $util.Long.prototype.toString.call(message.transformedEventsCount) : options.longs === Number ? new $util.LongBits(message.transformedEventsCount.low >>> 0, message.transformedEventsCount.high >>> 0).toNumber() : message.transformedEventsCount; + return object; + }; + + /** + * Converts this TransformedUserEventsMetadata to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.TransformedUserEventsMetadata + * @instance + * @returns {Object.} JSON object + */ + TransformedUserEventsMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransformedUserEventsMetadata + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.TransformedUserEventsMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransformedUserEventsMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.TransformedUserEventsMetadata"; + }; + + return TransformedUserEventsMetadata; + })(); + v2alpha.ImportProductsResponse = (function() { /** @@ -51757,6 +52452,7 @@ * @property {google.protobuf.ITimestamp|null} [publishTime] Product publishTime * @property {google.protobuf.IFieldMask|null} [retrievableFields] Product retrievableFields * @property {Array.|null} [variants] Product variants + * @property {Array.|null} [localInventories] Product localInventories */ /** @@ -51781,6 +52477,7 @@ this.conditions = []; this.promotions = []; this.variants = []; + this.localInventories = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -52051,6 +52748,14 @@ */ Product.prototype.variants = $util.emptyArray; + /** + * Product localInventories. + * @member {Array.} localInventories + * @memberof google.cloud.retail.v2alpha.Product + * @instance + */ + Product.prototype.localInventories = $util.emptyArray; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -52170,6 +52875,9 @@ if (message.promotions != null && message.promotions.length) for (var i = 0; i < message.promotions.length; ++i) $root.google.cloud.retail.v2alpha.Promotion.encode(message.promotions[i], writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); + if (message.localInventories != null && message.localInventories.length) + for (var i = 0; i < message.localInventories.length; ++i) + $root.google.cloud.retail.v2alpha.LocalInventory.encode(message.localInventories[i], writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); return writer; }; @@ -52379,6 +53087,12 @@ message.variants.push($root.google.cloud.retail.v2alpha.Product.decode(reader, reader.uint32())); break; } + case 35: { + if (!(message.localInventories && message.localInventories.length)) + message.localInventories = []; + message.localInventories.push($root.google.cloud.retail.v2alpha.LocalInventory.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -52620,6 +53334,15 @@ return "variants." + error; } } + if (message.localInventories != null && message.hasOwnProperty("localInventories")) { + if (!Array.isArray(message.localInventories)) + return "localInventories: array expected"; + for (var i = 0; i < message.localInventories.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.LocalInventory.verify(message.localInventories[i]); + if (error) + return "localInventories." + error; + } + } return null; }; @@ -52859,6 +53582,16 @@ message.variants[i] = $root.google.cloud.retail.v2alpha.Product.fromObject(object.variants[i]); } } + if (object.localInventories) { + if (!Array.isArray(object.localInventories)) + throw TypeError(".google.cloud.retail.v2alpha.Product.localInventories: array expected"); + message.localInventories = []; + for (var i = 0; i < object.localInventories.length; ++i) { + if (typeof object.localInventories[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Product.localInventories: object expected"); + message.localInventories[i] = $root.google.cloud.retail.v2alpha.LocalInventory.fromObject(object.localInventories[i]); + } + } return message; }; @@ -52888,6 +53621,7 @@ object.conditions = []; object.variants = []; object.promotions = []; + object.localInventories = []; } if (options.objects || options.defaults) object.attributes = {}; @@ -53023,6 +53757,11 @@ for (var j = 0; j < message.promotions.length; ++j) object.promotions[j] = $root.google.cloud.retail.v2alpha.Promotion.toObject(message.promotions[j], options); } + if (message.localInventories && message.localInventories.length) { + object.localInventories = []; + for (var j = 0; j < message.localInventories.length; ++j) + object.localInventories[j] = $root.google.cloud.retail.v2alpha.LocalInventory.toObject(message.localInventories[j], options); + } return object; }; @@ -55200,6 +55939,39 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService|batchRemoveCatalogAttributes}. + * @memberof google.cloud.retail.v2alpha.CatalogService + * @typedef BatchRemoveCatalogAttributesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse} [response] BatchRemoveCatalogAttributesResponse + */ + + /** + * Calls BatchRemoveCatalogAttributes. + * @function batchRemoveCatalogAttributes + * @memberof google.cloud.retail.v2alpha.CatalogService + * @instance + * @param {google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesRequest} request BatchRemoveCatalogAttributesRequest message or plain object + * @param {google.cloud.retail.v2alpha.CatalogService.BatchRemoveCatalogAttributesCallback} callback Node-style callback called with the error, if any, and BatchRemoveCatalogAttributesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CatalogService.prototype.batchRemoveCatalogAttributes = function batchRemoveCatalogAttributes(request, callback) { + return this.rpcCall(batchRemoveCatalogAttributes, $root.google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest, $root.google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse, request, callback); + }, "name", { value: "BatchRemoveCatalogAttributes" }); + + /** + * Calls BatchRemoveCatalogAttributes. + * @function batchRemoveCatalogAttributes + * @memberof google.cloud.retail.v2alpha.CatalogService + * @instance + * @param {google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesRequest} request BatchRemoveCatalogAttributesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + /** * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService|replaceCatalogAttribute}. * @memberof google.cloud.retail.v2alpha.CatalogService @@ -58041,6 +58813,508 @@ return RemoveCatalogAttributeRequest; })(); + v2alpha.BatchRemoveCatalogAttributesRequest = (function() { + + /** + * Properties of a BatchRemoveCatalogAttributesRequest. + * @memberof google.cloud.retail.v2alpha + * @interface IBatchRemoveCatalogAttributesRequest + * @property {string|null} [attributesConfig] BatchRemoveCatalogAttributesRequest attributesConfig + * @property {Array.|null} [attributeKeys] BatchRemoveCatalogAttributesRequest attributeKeys + */ + + /** + * Constructs a new BatchRemoveCatalogAttributesRequest. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a BatchRemoveCatalogAttributesRequest. + * @implements IBatchRemoveCatalogAttributesRequest + * @constructor + * @param {google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesRequest=} [properties] Properties to set + */ + function BatchRemoveCatalogAttributesRequest(properties) { + this.attributeKeys = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchRemoveCatalogAttributesRequest attributesConfig. + * @member {string} attributesConfig + * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest + * @instance + */ + BatchRemoveCatalogAttributesRequest.prototype.attributesConfig = ""; + + /** + * BatchRemoveCatalogAttributesRequest attributeKeys. + * @member {Array.} attributeKeys + * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest + * @instance + */ + BatchRemoveCatalogAttributesRequest.prototype.attributeKeys = $util.emptyArray; + + /** + * Creates a new BatchRemoveCatalogAttributesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest + * @static + * @param {google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest} BatchRemoveCatalogAttributesRequest instance + */ + BatchRemoveCatalogAttributesRequest.create = function create(properties) { + return new BatchRemoveCatalogAttributesRequest(properties); + }; + + /** + * Encodes the specified BatchRemoveCatalogAttributesRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest + * @static + * @param {google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesRequest} message BatchRemoveCatalogAttributesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchRemoveCatalogAttributesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.attributesConfig != null && Object.hasOwnProperty.call(message, "attributesConfig")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.attributesConfig); + if (message.attributeKeys != null && message.attributeKeys.length) + for (var i = 0; i < message.attributeKeys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.attributeKeys[i]); + return writer; + }; + + /** + * Encodes the specified BatchRemoveCatalogAttributesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest + * @static + * @param {google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesRequest} message BatchRemoveCatalogAttributesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchRemoveCatalogAttributesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchRemoveCatalogAttributesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest} BatchRemoveCatalogAttributesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchRemoveCatalogAttributesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.attributesConfig = reader.string(); + break; + } + case 2: { + if (!(message.attributeKeys && message.attributeKeys.length)) + message.attributeKeys = []; + message.attributeKeys.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchRemoveCatalogAttributesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest} BatchRemoveCatalogAttributesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchRemoveCatalogAttributesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchRemoveCatalogAttributesRequest message. + * @function verify + * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchRemoveCatalogAttributesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.attributesConfig != null && message.hasOwnProperty("attributesConfig")) + if (!$util.isString(message.attributesConfig)) + return "attributesConfig: string expected"; + if (message.attributeKeys != null && message.hasOwnProperty("attributeKeys")) { + if (!Array.isArray(message.attributeKeys)) + return "attributeKeys: array expected"; + for (var i = 0; i < message.attributeKeys.length; ++i) + if (!$util.isString(message.attributeKeys[i])) + return "attributeKeys: string[] expected"; + } + return null; + }; + + /** + * Creates a BatchRemoveCatalogAttributesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest} BatchRemoveCatalogAttributesRequest + */ + BatchRemoveCatalogAttributesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest) + return object; + var message = new $root.google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest(); + if (object.attributesConfig != null) + message.attributesConfig = String(object.attributesConfig); + if (object.attributeKeys) { + if (!Array.isArray(object.attributeKeys)) + throw TypeError(".google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest.attributeKeys: array expected"); + message.attributeKeys = []; + for (var i = 0; i < object.attributeKeys.length; ++i) + message.attributeKeys[i] = String(object.attributeKeys[i]); + } + return message; + }; + + /** + * Creates a plain object from a BatchRemoveCatalogAttributesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest + * @static + * @param {google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest} message BatchRemoveCatalogAttributesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchRemoveCatalogAttributesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.attributeKeys = []; + if (options.defaults) + object.attributesConfig = ""; + if (message.attributesConfig != null && message.hasOwnProperty("attributesConfig")) + object.attributesConfig = message.attributesConfig; + if (message.attributeKeys && message.attributeKeys.length) { + object.attributeKeys = []; + for (var j = 0; j < message.attributeKeys.length; ++j) + object.attributeKeys[j] = message.attributeKeys[j]; + } + return object; + }; + + /** + * Converts this BatchRemoveCatalogAttributesRequest to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest + * @instance + * @returns {Object.} JSON object + */ + BatchRemoveCatalogAttributesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchRemoveCatalogAttributesRequest + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchRemoveCatalogAttributesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest"; + }; + + return BatchRemoveCatalogAttributesRequest; + })(); + + v2alpha.BatchRemoveCatalogAttributesResponse = (function() { + + /** + * Properties of a BatchRemoveCatalogAttributesResponse. + * @memberof google.cloud.retail.v2alpha + * @interface IBatchRemoveCatalogAttributesResponse + * @property {Array.|null} [deletedCatalogAttributes] BatchRemoveCatalogAttributesResponse deletedCatalogAttributes + * @property {Array.|null} [resetCatalogAttributes] BatchRemoveCatalogAttributesResponse resetCatalogAttributes + */ + + /** + * Constructs a new BatchRemoveCatalogAttributesResponse. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a BatchRemoveCatalogAttributesResponse. + * @implements IBatchRemoveCatalogAttributesResponse + * @constructor + * @param {google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesResponse=} [properties] Properties to set + */ + function BatchRemoveCatalogAttributesResponse(properties) { + this.deletedCatalogAttributes = []; + this.resetCatalogAttributes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchRemoveCatalogAttributesResponse deletedCatalogAttributes. + * @member {Array.} deletedCatalogAttributes + * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse + * @instance + */ + BatchRemoveCatalogAttributesResponse.prototype.deletedCatalogAttributes = $util.emptyArray; + + /** + * BatchRemoveCatalogAttributesResponse resetCatalogAttributes. + * @member {Array.} resetCatalogAttributes + * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse + * @instance + */ + BatchRemoveCatalogAttributesResponse.prototype.resetCatalogAttributes = $util.emptyArray; + + /** + * Creates a new BatchRemoveCatalogAttributesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse + * @static + * @param {google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse} BatchRemoveCatalogAttributesResponse instance + */ + BatchRemoveCatalogAttributesResponse.create = function create(properties) { + return new BatchRemoveCatalogAttributesResponse(properties); + }; + + /** + * Encodes the specified BatchRemoveCatalogAttributesResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse + * @static + * @param {google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesResponse} message BatchRemoveCatalogAttributesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchRemoveCatalogAttributesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deletedCatalogAttributes != null && message.deletedCatalogAttributes.length) + for (var i = 0; i < message.deletedCatalogAttributes.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.deletedCatalogAttributes[i]); + if (message.resetCatalogAttributes != null && message.resetCatalogAttributes.length) + for (var i = 0; i < message.resetCatalogAttributes.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resetCatalogAttributes[i]); + return writer; + }; + + /** + * Encodes the specified BatchRemoveCatalogAttributesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse + * @static + * @param {google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesResponse} message BatchRemoveCatalogAttributesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchRemoveCatalogAttributesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchRemoveCatalogAttributesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse} BatchRemoveCatalogAttributesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchRemoveCatalogAttributesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.deletedCatalogAttributes && message.deletedCatalogAttributes.length)) + message.deletedCatalogAttributes = []; + message.deletedCatalogAttributes.push(reader.string()); + break; + } + case 2: { + if (!(message.resetCatalogAttributes && message.resetCatalogAttributes.length)) + message.resetCatalogAttributes = []; + message.resetCatalogAttributes.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchRemoveCatalogAttributesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse} BatchRemoveCatalogAttributesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchRemoveCatalogAttributesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchRemoveCatalogAttributesResponse message. + * @function verify + * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchRemoveCatalogAttributesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deletedCatalogAttributes != null && message.hasOwnProperty("deletedCatalogAttributes")) { + if (!Array.isArray(message.deletedCatalogAttributes)) + return "deletedCatalogAttributes: array expected"; + for (var i = 0; i < message.deletedCatalogAttributes.length; ++i) + if (!$util.isString(message.deletedCatalogAttributes[i])) + return "deletedCatalogAttributes: string[] expected"; + } + if (message.resetCatalogAttributes != null && message.hasOwnProperty("resetCatalogAttributes")) { + if (!Array.isArray(message.resetCatalogAttributes)) + return "resetCatalogAttributes: array expected"; + for (var i = 0; i < message.resetCatalogAttributes.length; ++i) + if (!$util.isString(message.resetCatalogAttributes[i])) + return "resetCatalogAttributes: string[] expected"; + } + return null; + }; + + /** + * Creates a BatchRemoveCatalogAttributesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse} BatchRemoveCatalogAttributesResponse + */ + BatchRemoveCatalogAttributesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse) + return object; + var message = new $root.google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse(); + if (object.deletedCatalogAttributes) { + if (!Array.isArray(object.deletedCatalogAttributes)) + throw TypeError(".google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse.deletedCatalogAttributes: array expected"); + message.deletedCatalogAttributes = []; + for (var i = 0; i < object.deletedCatalogAttributes.length; ++i) + message.deletedCatalogAttributes[i] = String(object.deletedCatalogAttributes[i]); + } + if (object.resetCatalogAttributes) { + if (!Array.isArray(object.resetCatalogAttributes)) + throw TypeError(".google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse.resetCatalogAttributes: array expected"); + message.resetCatalogAttributes = []; + for (var i = 0; i < object.resetCatalogAttributes.length; ++i) + message.resetCatalogAttributes[i] = String(object.resetCatalogAttributes[i]); + } + return message; + }; + + /** + * Creates a plain object from a BatchRemoveCatalogAttributesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse + * @static + * @param {google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse} message BatchRemoveCatalogAttributesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchRemoveCatalogAttributesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.deletedCatalogAttributes = []; + object.resetCatalogAttributes = []; + } + if (message.deletedCatalogAttributes && message.deletedCatalogAttributes.length) { + object.deletedCatalogAttributes = []; + for (var j = 0; j < message.deletedCatalogAttributes.length; ++j) + object.deletedCatalogAttributes[j] = message.deletedCatalogAttributes[j]; + } + if (message.resetCatalogAttributes && message.resetCatalogAttributes.length) { + object.resetCatalogAttributes = []; + for (var j = 0; j < message.resetCatalogAttributes.length; ++j) + object.resetCatalogAttributes[j] = message.resetCatalogAttributes[j]; + } + return object; + }; + + /** + * Converts this BatchRemoveCatalogAttributesResponse to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse + * @instance + * @returns {Object.} JSON object + */ + BatchRemoveCatalogAttributesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchRemoveCatalogAttributesResponse + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchRemoveCatalogAttributesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse"; + }; + + return BatchRemoveCatalogAttributesResponse; + })(); + v2alpha.ReplaceCatalogAttributeRequest = (function() { /** @@ -58415,6 +59689,7 @@ * @property {string|null} [deviceType] CompleteQueryRequest deviceType * @property {string|null} [dataset] CompleteQueryRequest dataset * @property {number|null} [maxSuggestions] CompleteQueryRequest maxSuggestions + * @property {boolean|null} [enableAttributeSuggestions] CompleteQueryRequest enableAttributeSuggestions */ /** @@ -58489,6 +59764,14 @@ */ CompleteQueryRequest.prototype.maxSuggestions = 0; + /** + * CompleteQueryRequest enableAttributeSuggestions. + * @member {boolean} enableAttributeSuggestions + * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * @instance + */ + CompleteQueryRequest.prototype.enableAttributeSuggestions = false; + /** * Creates a new CompleteQueryRequest instance using the specified properties. * @function create @@ -58528,6 +59811,8 @@ writer.uint32(/* id 6, wireType 2 =*/50).string(message.dataset); if (message.visitorId != null && Object.hasOwnProperty.call(message, "visitorId")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.visitorId); + if (message.enableAttributeSuggestions != null && Object.hasOwnProperty.call(message, "enableAttributeSuggestions")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.enableAttributeSuggestions); return writer; }; @@ -58592,6 +59877,10 @@ message.maxSuggestions = reader.int32(); break; } + case 9: { + message.enableAttributeSuggestions = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -58652,6 +59941,9 @@ if (message.maxSuggestions != null && message.hasOwnProperty("maxSuggestions")) if (!$util.isInteger(message.maxSuggestions)) return "maxSuggestions: integer expected"; + if (message.enableAttributeSuggestions != null && message.hasOwnProperty("enableAttributeSuggestions")) + if (typeof message.enableAttributeSuggestions !== "boolean") + return "enableAttributeSuggestions: boolean expected"; return null; }; @@ -58686,6 +59978,8 @@ message.dataset = String(object.dataset); if (object.maxSuggestions != null) message.maxSuggestions = object.maxSuggestions | 0; + if (object.enableAttributeSuggestions != null) + message.enableAttributeSuggestions = Boolean(object.enableAttributeSuggestions); return message; }; @@ -58711,6 +60005,7 @@ object.maxSuggestions = 0; object.dataset = ""; object.visitorId = ""; + object.enableAttributeSuggestions = false; } if (message.catalog != null && message.hasOwnProperty("catalog")) object.catalog = message.catalog; @@ -58729,6 +60024,8 @@ object.dataset = message.dataset; if (message.visitorId != null && message.hasOwnProperty("visitorId")) object.visitorId = message.visitorId; + if (message.enableAttributeSuggestions != null && message.hasOwnProperty("enableAttributeSuggestions")) + object.enableAttributeSuggestions = message.enableAttributeSuggestions; return object; }; @@ -58770,6 +60067,7 @@ * @property {Array.|null} [completionResults] CompleteQueryResponse completionResults * @property {string|null} [attributionToken] CompleteQueryResponse attributionToken * @property {Array.|null} [recentSearchResults] CompleteQueryResponse recentSearchResults + * @property {Object.|null} [attributeResults] CompleteQueryResponse attributeResults */ /** @@ -58783,6 +60081,7 @@ function CompleteQueryResponse(properties) { this.completionResults = []; this.recentSearchResults = []; + this.attributeResults = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -58813,6 +60112,14 @@ */ CompleteQueryResponse.prototype.recentSearchResults = $util.emptyArray; + /** + * CompleteQueryResponse attributeResults. + * @member {Object.} attributeResults + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse + * @instance + */ + CompleteQueryResponse.prototype.attributeResults = $util.emptyObject; + /** * Creates a new CompleteQueryResponse instance using the specified properties. * @function create @@ -58845,6 +60152,11 @@ if (message.recentSearchResults != null && message.recentSearchResults.length) for (var i = 0; i < message.recentSearchResults.length; ++i) $root.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult.encode(message.recentSearchResults[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.attributeResults != null && Object.hasOwnProperty.call(message, "attributeResults")) + for (var keys = Object.keys(message.attributeResults), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult.encode(message.attributeResults[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } return writer; }; @@ -58875,7 +60187,7 @@ CompleteQueryResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.CompleteQueryResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.CompleteQueryResponse(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -58895,6 +60207,29 @@ message.recentSearchResults.push($root.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult.decode(reader, reader.uint32())); break; } + case 4: { + if (message.attributeResults === $util.emptyObject) + message.attributeResults = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.attributeResults[key] = value; + break; + } default: reader.skipType(tag & 7); break; @@ -58951,6 +60286,16 @@ return "recentSearchResults." + error; } } + if (message.attributeResults != null && message.hasOwnProperty("attributeResults")) { + if (!$util.isObject(message.attributeResults)) + return "attributeResults: object expected"; + var key = Object.keys(message.attributeResults); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult.verify(message.attributeResults[key[i]]); + if (error) + return "attributeResults." + error; + } + } return null; }; @@ -58988,6 +60333,16 @@ message.recentSearchResults[i] = $root.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult.fromObject(object.recentSearchResults[i]); } } + if (object.attributeResults) { + if (typeof object.attributeResults !== "object") + throw TypeError(".google.cloud.retail.v2alpha.CompleteQueryResponse.attributeResults: object expected"); + message.attributeResults = {}; + for (var keys = Object.keys(object.attributeResults), i = 0; i < keys.length; ++i) { + if (typeof object.attributeResults[keys[i]] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.CompleteQueryResponse.attributeResults: object expected"); + message.attributeResults[keys[i]] = $root.google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult.fromObject(object.attributeResults[keys[i]]); + } + } return message; }; @@ -59008,6 +60363,8 @@ object.completionResults = []; object.recentSearchResults = []; } + if (options.objects || options.defaults) + object.attributeResults = {}; if (options.defaults) object.attributionToken = ""; if (message.completionResults && message.completionResults.length) { @@ -59022,6 +60379,12 @@ for (var j = 0; j < message.recentSearchResults.length; ++j) object.recentSearchResults[j] = $root.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult.toObject(message.recentSearchResults[j], options); } + var keys2; + if (message.attributeResults && (keys2 = Object.keys(message.attributeResults)).length) { + object.attributeResults = {}; + for (var j = 0; j < keys2.length; ++j) + object.attributeResults[keys2[j]] = $root.google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult.toObject(message.attributeResults[keys2[j]], options); + } return object; }; @@ -59523,6 +60886,225 @@ return RecentSearchResult; })(); + CompleteQueryResponse.AttributeResult = (function() { + + /** + * Properties of an AttributeResult. + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse + * @interface IAttributeResult + * @property {Array.|null} [suggestions] AttributeResult suggestions + */ + + /** + * Constructs a new AttributeResult. + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse + * @classdesc Represents an AttributeResult. + * @implements IAttributeResult + * @constructor + * @param {google.cloud.retail.v2alpha.CompleteQueryResponse.IAttributeResult=} [properties] Properties to set + */ + function AttributeResult(properties) { + this.suggestions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AttributeResult suggestions. + * @member {Array.} suggestions + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult + * @instance + */ + AttributeResult.prototype.suggestions = $util.emptyArray; + + /** + * Creates a new AttributeResult instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult + * @static + * @param {google.cloud.retail.v2alpha.CompleteQueryResponse.IAttributeResult=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult} AttributeResult instance + */ + AttributeResult.create = function create(properties) { + return new AttributeResult(properties); + }; + + /** + * Encodes the specified AttributeResult message. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult + * @static + * @param {google.cloud.retail.v2alpha.CompleteQueryResponse.IAttributeResult} message AttributeResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttributeResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.suggestions != null && message.suggestions.length) + for (var i = 0; i < message.suggestions.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.suggestions[i]); + return writer; + }; + + /** + * Encodes the specified AttributeResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult + * @static + * @param {google.cloud.retail.v2alpha.CompleteQueryResponse.IAttributeResult} message AttributeResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttributeResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AttributeResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult} AttributeResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttributeResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.suggestions && message.suggestions.length)) + message.suggestions = []; + message.suggestions.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AttributeResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult} AttributeResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttributeResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AttributeResult message. + * @function verify + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AttributeResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.suggestions != null && message.hasOwnProperty("suggestions")) { + if (!Array.isArray(message.suggestions)) + return "suggestions: array expected"; + for (var i = 0; i < message.suggestions.length; ++i) + if (!$util.isString(message.suggestions[i])) + return "suggestions: string[] expected"; + } + return null; + }; + + /** + * Creates an AttributeResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult} AttributeResult + */ + AttributeResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult) + return object; + var message = new $root.google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult(); + if (object.suggestions) { + if (!Array.isArray(object.suggestions)) + throw TypeError(".google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult.suggestions: array expected"); + message.suggestions = []; + for (var i = 0; i < object.suggestions.length; ++i) + message.suggestions[i] = String(object.suggestions[i]); + } + return message; + }; + + /** + * Creates a plain object from an AttributeResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult + * @static + * @param {google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult} message AttributeResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AttributeResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.suggestions = []; + if (message.suggestions && message.suggestions.length) { + object.suggestions = []; + for (var j = 0; j < message.suggestions.length; ++j) + object.suggestions[j] = message.suggestions[j]; + } + return object; + }; + + /** + * Converts this AttributeResult to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult + * @instance + * @returns {Object.} JSON object + */ + AttributeResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AttributeResult + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AttributeResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult"; + }; + + return AttributeResult; + })(); + return CompleteQueryResponse; })(); @@ -63757,6 +65339,7 @@ * @property {number|null} [matchingVariantCount] SearchResult matchingVariantCount * @property {Object.|null} [matchingVariantFields] SearchResult matchingVariantFields * @property {Object.|null} [variantRollupValues] SearchResult variantRollupValues + * @property {Array.|null} [personalLabels] SearchResult personalLabels */ /** @@ -63770,6 +65353,7 @@ function SearchResult(properties) { this.matchingVariantFields = {}; this.variantRollupValues = {}; + this.personalLabels = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -63816,6 +65400,14 @@ */ SearchResult.prototype.variantRollupValues = $util.emptyObject; + /** + * SearchResult personalLabels. + * @member {Array.} personalLabels + * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult + * @instance + */ + SearchResult.prototype.personalLabels = $util.emptyArray; + /** * Creates a new SearchResult instance using the specified properties. * @function create @@ -63856,6 +65448,9 @@ writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); $root.google.protobuf.Value.encode(message.variantRollupValues[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); } + if (message.personalLabels != null && message.personalLabels.length) + for (var i = 0; i < message.personalLabels.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.personalLabels[i]); return writer; }; @@ -63948,6 +65543,12 @@ message.variantRollupValues[key] = value; break; } + case 7: { + if (!(message.personalLabels && message.personalLabels.length)) + message.personalLabels = []; + message.personalLabels.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -64014,6 +65615,13 @@ return "variantRollupValues." + error; } } + if (message.personalLabels != null && message.hasOwnProperty("personalLabels")) { + if (!Array.isArray(message.personalLabels)) + return "personalLabels: array expected"; + for (var i = 0; i < message.personalLabels.length; ++i) + if (!$util.isString(message.personalLabels[i])) + return "personalLabels: string[] expected"; + } return null; }; @@ -64058,6 +65666,13 @@ message.variantRollupValues[keys[i]] = $root.google.protobuf.Value.fromObject(object.variantRollupValues[keys[i]]); } } + if (object.personalLabels) { + if (!Array.isArray(object.personalLabels)) + throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.SearchResult.personalLabels: array expected"); + message.personalLabels = []; + for (var i = 0; i < object.personalLabels.length; ++i) + message.personalLabels[i] = String(object.personalLabels[i]); + } return message; }; @@ -64074,6 +65689,8 @@ if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.personalLabels = []; if (options.objects || options.defaults) { object.matchingVariantFields = {}; object.variantRollupValues = {}; @@ -64100,6 +65717,11 @@ for (var j = 0; j < keys2.length; ++j) object.variantRollupValues[keys2[j]] = $root.google.protobuf.Value.toObject(message.variantRollupValues[keys2[j]], options); } + if (message.personalLabels && message.personalLabels.length) { + object.personalLabels = []; + for (var j = 0; j < message.personalLabels.length; ++j) + object.personalLabels[j] = message.personalLabels[j]; + } return object; }; @@ -67637,6 +69259,7 @@ * @memberof google.cloud.retail.v2alpha * @interface IOutputResult * @property {Array.|null} [bigqueryResult] OutputResult bigqueryResult + * @property {Array.|null} [gcsResult] OutputResult gcsResult */ /** @@ -67649,6 +69272,7 @@ */ function OutputResult(properties) { this.bigqueryResult = []; + this.gcsResult = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -67663,6 +69287,14 @@ */ OutputResult.prototype.bigqueryResult = $util.emptyArray; + /** + * OutputResult gcsResult. + * @member {Array.} gcsResult + * @memberof google.cloud.retail.v2alpha.OutputResult + * @instance + */ + OutputResult.prototype.gcsResult = $util.emptyArray; + /** * Creates a new OutputResult instance using the specified properties. * @function create @@ -67690,6 +69322,9 @@ if (message.bigqueryResult != null && message.bigqueryResult.length) for (var i = 0; i < message.bigqueryResult.length; ++i) $root.google.cloud.retail.v2alpha.BigQueryOutputResult.encode(message.bigqueryResult[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.gcsResult != null && message.gcsResult.length) + for (var i = 0; i < message.gcsResult.length; ++i) + $root.google.cloud.retail.v2alpha.GcsOutputResult.encode(message.gcsResult[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -67730,6 +69365,12 @@ message.bigqueryResult.push($root.google.cloud.retail.v2alpha.BigQueryOutputResult.decode(reader, reader.uint32())); break; } + case 2: { + if (!(message.gcsResult && message.gcsResult.length)) + message.gcsResult = []; + message.gcsResult.push($root.google.cloud.retail.v2alpha.GcsOutputResult.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -67774,6 +69415,15 @@ return "bigqueryResult." + error; } } + if (message.gcsResult != null && message.hasOwnProperty("gcsResult")) { + if (!Array.isArray(message.gcsResult)) + return "gcsResult: array expected"; + for (var i = 0; i < message.gcsResult.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.GcsOutputResult.verify(message.gcsResult[i]); + if (error) + return "gcsResult." + error; + } + } return null; }; @@ -67799,6 +69449,16 @@ message.bigqueryResult[i] = $root.google.cloud.retail.v2alpha.BigQueryOutputResult.fromObject(object.bigqueryResult[i]); } } + if (object.gcsResult) { + if (!Array.isArray(object.gcsResult)) + throw TypeError(".google.cloud.retail.v2alpha.OutputResult.gcsResult: array expected"); + message.gcsResult = []; + for (var i = 0; i < object.gcsResult.length; ++i) { + if (typeof object.gcsResult[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.OutputResult.gcsResult: object expected"); + message.gcsResult[i] = $root.google.cloud.retail.v2alpha.GcsOutputResult.fromObject(object.gcsResult[i]); + } + } return message; }; @@ -67815,13 +69475,20 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.bigqueryResult = []; + object.gcsResult = []; + } if (message.bigqueryResult && message.bigqueryResult.length) { object.bigqueryResult = []; for (var j = 0; j < message.bigqueryResult.length; ++j) object.bigqueryResult[j] = $root.google.cloud.retail.v2alpha.BigQueryOutputResult.toObject(message.bigqueryResult[j], options); } + if (message.gcsResult && message.gcsResult.length) { + object.gcsResult = []; + for (var j = 0; j < message.gcsResult.length; ++j) + object.gcsResult[j] = $root.google.cloud.retail.v2alpha.GcsOutputResult.toObject(message.gcsResult[j], options); + } return object; }; @@ -68081,6 +69748,209 @@ return BigQueryOutputResult; })(); + v2alpha.GcsOutputResult = (function() { + + /** + * Properties of a GcsOutputResult. + * @memberof google.cloud.retail.v2alpha + * @interface IGcsOutputResult + * @property {string|null} [outputUri] GcsOutputResult outputUri + */ + + /** + * Constructs a new GcsOutputResult. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a GcsOutputResult. + * @implements IGcsOutputResult + * @constructor + * @param {google.cloud.retail.v2alpha.IGcsOutputResult=} [properties] Properties to set + */ + function GcsOutputResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GcsOutputResult outputUri. + * @member {string} outputUri + * @memberof google.cloud.retail.v2alpha.GcsOutputResult + * @instance + */ + GcsOutputResult.prototype.outputUri = ""; + + /** + * Creates a new GcsOutputResult instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.GcsOutputResult + * @static + * @param {google.cloud.retail.v2alpha.IGcsOutputResult=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.GcsOutputResult} GcsOutputResult instance + */ + GcsOutputResult.create = function create(properties) { + return new GcsOutputResult(properties); + }; + + /** + * Encodes the specified GcsOutputResult message. Does not implicitly {@link google.cloud.retail.v2alpha.GcsOutputResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.GcsOutputResult + * @static + * @param {google.cloud.retail.v2alpha.IGcsOutputResult} message GcsOutputResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsOutputResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.outputUri != null && Object.hasOwnProperty.call(message, "outputUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.outputUri); + return writer; + }; + + /** + * Encodes the specified GcsOutputResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.GcsOutputResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.GcsOutputResult + * @static + * @param {google.cloud.retail.v2alpha.IGcsOutputResult} message GcsOutputResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsOutputResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcsOutputResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.GcsOutputResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.GcsOutputResult} GcsOutputResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsOutputResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.GcsOutputResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.outputUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcsOutputResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.GcsOutputResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.GcsOutputResult} GcsOutputResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsOutputResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcsOutputResult message. + * @function verify + * @memberof google.cloud.retail.v2alpha.GcsOutputResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcsOutputResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.outputUri != null && message.hasOwnProperty("outputUri")) + if (!$util.isString(message.outputUri)) + return "outputUri: string expected"; + return null; + }; + + /** + * Creates a GcsOutputResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.GcsOutputResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.GcsOutputResult} GcsOutputResult + */ + GcsOutputResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.GcsOutputResult) + return object; + var message = new $root.google.cloud.retail.v2alpha.GcsOutputResult(); + if (object.outputUri != null) + message.outputUri = String(object.outputUri); + return message; + }; + + /** + * Creates a plain object from a GcsOutputResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.GcsOutputResult + * @static + * @param {google.cloud.retail.v2alpha.GcsOutputResult} message GcsOutputResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcsOutputResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.outputUri = ""; + if (message.outputUri != null && message.hasOwnProperty("outputUri")) + object.outputUri = message.outputUri; + return object; + }; + + /** + * Converts this GcsOutputResult to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.GcsOutputResult + * @instance + * @returns {Object.} JSON object + */ + GcsOutputResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GcsOutputResult + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.GcsOutputResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcsOutputResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.GcsOutputResult"; + }; + + return GcsOutputResult; + })(); + v2alpha.Model = (function() { /** @@ -80382,7 +82252,9 @@ * @property {Array.|null} [replacementControlIds] ServingConfig replacementControlIds * @property {Array.|null} [ignoreControlIds] ServingConfig ignoreControlIds * @property {string|null} [diversityLevel] ServingConfig diversityLevel + * @property {google.cloud.retail.v2alpha.ServingConfig.DiversityType|null} [diversityType] ServingConfig diversityType * @property {string|null} [enableCategoryFilterLevel] ServingConfig enableCategoryFilterLevel + * @property {google.cloud.retail.v2alpha.SearchRequest.IPersonalizationSpec|null} [personalizationSpec] ServingConfig personalizationSpec * @property {Array.|null} [solutionTypes] ServingConfig solutionTypes */ @@ -80531,6 +82403,14 @@ */ ServingConfig.prototype.diversityLevel = ""; + /** + * ServingConfig diversityType. + * @member {google.cloud.retail.v2alpha.ServingConfig.DiversityType} diversityType + * @memberof google.cloud.retail.v2alpha.ServingConfig + * @instance + */ + ServingConfig.prototype.diversityType = 0; + /** * ServingConfig enableCategoryFilterLevel. * @member {string} enableCategoryFilterLevel @@ -80539,6 +82419,14 @@ */ ServingConfig.prototype.enableCategoryFilterLevel = ""; + /** + * ServingConfig personalizationSpec. + * @member {google.cloud.retail.v2alpha.SearchRequest.IPersonalizationSpec|null|undefined} personalizationSpec + * @memberof google.cloud.retail.v2alpha.ServingConfig + * @instance + */ + ServingConfig.prototype.personalizationSpec = null; + /** * ServingConfig solutionTypes. * @member {Array.} solutionTypes @@ -80618,6 +82506,10 @@ writer.int32(message.solutionTypes[i]); writer.ldelim(); } + if (message.diversityType != null && Object.hasOwnProperty.call(message, "diversityType")) + writer.uint32(/* id 20, wireType 0 =*/160).int32(message.diversityType); + if (message.personalizationSpec != null && Object.hasOwnProperty.call(message, "personalizationSpec")) + $root.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.encode(message.personalizationSpec, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); return writer; }; @@ -80730,10 +82622,18 @@ message.diversityLevel = reader.string(); break; } + case 20: { + message.diversityType = reader.int32(); + break; + } case 16: { message.enableCategoryFilterLevel = reader.string(); break; } + case 21: { + message.personalizationSpec = $root.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.decode(reader, reader.uint32()); + break; + } case 19: { if (!(message.solutionTypes && message.solutionTypes.length)) message.solutionTypes = []; @@ -80863,9 +82763,23 @@ if (message.diversityLevel != null && message.hasOwnProperty("diversityLevel")) if (!$util.isString(message.diversityLevel)) return "diversityLevel: string expected"; + if (message.diversityType != null && message.hasOwnProperty("diversityType")) + switch (message.diversityType) { + default: + return "diversityType: enum value expected"; + case 0: + case 2: + case 3: + break; + } if (message.enableCategoryFilterLevel != null && message.hasOwnProperty("enableCategoryFilterLevel")) if (!$util.isString(message.enableCategoryFilterLevel)) return "enableCategoryFilterLevel: string expected"; + if (message.personalizationSpec != null && message.hasOwnProperty("personalizationSpec")) { + var error = $root.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.verify(message.personalizationSpec); + if (error) + return "personalizationSpec." + error; + } if (message.solutionTypes != null && message.hasOwnProperty("solutionTypes")) { if (!Array.isArray(message.solutionTypes)) return "solutionTypes: array expected"; @@ -80972,8 +82886,33 @@ } if (object.diversityLevel != null) message.diversityLevel = String(object.diversityLevel); + switch (object.diversityType) { + default: + if (typeof object.diversityType === "number") { + message.diversityType = object.diversityType; + break; + } + break; + case "DIVERSITY_TYPE_UNSPECIFIED": + case 0: + message.diversityType = 0; + break; + case "RULE_BASED_DIVERSITY": + case 2: + message.diversityType = 2; + break; + case "DATA_DRIVEN_DIVERSITY": + case 3: + message.diversityType = 3; + break; + } if (object.enableCategoryFilterLevel != null) message.enableCategoryFilterLevel = String(object.enableCategoryFilterLevel); + if (object.personalizationSpec != null) { + if (typeof object.personalizationSpec !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ServingConfig.personalizationSpec: object expected"); + message.personalizationSpec = $root.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.fromObject(object.personalizationSpec); + } if (object.solutionTypes) { if (!Array.isArray(object.solutionTypes)) throw TypeError(".google.cloud.retail.v2alpha.ServingConfig.solutionTypes: array expected"); @@ -81035,6 +82974,8 @@ object.dynamicFacetSpec = null; object.diversityLevel = ""; object.enableCategoryFilterLevel = ""; + object.diversityType = options.enums === String ? "DIVERSITY_TYPE_UNSPECIFIED" : 0; + object.personalizationSpec = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -81100,6 +83041,10 @@ for (var j = 0; j < message.solutionTypes.length; ++j) object.solutionTypes[j] = options.enums === String ? $root.google.cloud.retail.v2alpha.SolutionType[message.solutionTypes[j]] === undefined ? message.solutionTypes[j] : $root.google.cloud.retail.v2alpha.SolutionType[message.solutionTypes[j]] : message.solutionTypes[j]; } + if (message.diversityType != null && message.hasOwnProperty("diversityType")) + object.diversityType = options.enums === String ? $root.google.cloud.retail.v2alpha.ServingConfig.DiversityType[message.diversityType] === undefined ? message.diversityType : $root.google.cloud.retail.v2alpha.ServingConfig.DiversityType[message.diversityType] : message.diversityType; + if (message.personalizationSpec != null && message.hasOwnProperty("personalizationSpec")) + object.personalizationSpec = $root.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.toObject(message.personalizationSpec, options); return object; }; @@ -81129,6 +83074,22 @@ return typeUrlPrefix + "/google.cloud.retail.v2alpha.ServingConfig"; }; + /** + * DiversityType enum. + * @name google.cloud.retail.v2alpha.ServingConfig.DiversityType + * @enum {number} + * @property {number} DIVERSITY_TYPE_UNSPECIFIED=0 DIVERSITY_TYPE_UNSPECIFIED value + * @property {number} RULE_BASED_DIVERSITY=2 RULE_BASED_DIVERSITY value + * @property {number} DATA_DRIVEN_DIVERSITY=3 DATA_DRIVEN_DIVERSITY value + */ + ServingConfig.DiversityType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DIVERSITY_TYPE_UNSPECIFIED"] = 0; + values[valuesById[2] = "RULE_BASED_DIVERSITY"] = 2; + values[valuesById[3] = "DATA_DRIVEN_DIVERSITY"] = 3; + return values; + })(); + return ServingConfig; })(); @@ -83456,6 +85417,7 @@ * @interface IWriteUserEventRequest * @property {string|null} [parent] WriteUserEventRequest parent * @property {google.cloud.retail.v2alpha.IUserEvent|null} [userEvent] WriteUserEventRequest userEvent + * @property {boolean|null} [writeAsync] WriteUserEventRequest writeAsync */ /** @@ -83489,6 +85451,14 @@ */ WriteUserEventRequest.prototype.userEvent = null; + /** + * WriteUserEventRequest writeAsync. + * @member {boolean} writeAsync + * @memberof google.cloud.retail.v2alpha.WriteUserEventRequest + * @instance + */ + WriteUserEventRequest.prototype.writeAsync = false; + /** * Creates a new WriteUserEventRequest instance using the specified properties. * @function create @@ -83517,6 +85487,8 @@ writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); if (message.userEvent != null && Object.hasOwnProperty.call(message, "userEvent")) $root.google.cloud.retail.v2alpha.UserEvent.encode(message.userEvent, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.writeAsync != null && Object.hasOwnProperty.call(message, "writeAsync")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.writeAsync); return writer; }; @@ -83559,6 +85531,10 @@ message.userEvent = $root.google.cloud.retail.v2alpha.UserEvent.decode(reader, reader.uint32()); break; } + case 3: { + message.writeAsync = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -83602,6 +85578,9 @@ if (error) return "userEvent." + error; } + if (message.writeAsync != null && message.hasOwnProperty("writeAsync")) + if (typeof message.writeAsync !== "boolean") + return "writeAsync: boolean expected"; return null; }; @@ -83624,6 +85603,8 @@ throw TypeError(".google.cloud.retail.v2alpha.WriteUserEventRequest.userEvent: object expected"); message.userEvent = $root.google.cloud.retail.v2alpha.UserEvent.fromObject(object.userEvent); } + if (object.writeAsync != null) + message.writeAsync = Boolean(object.writeAsync); return message; }; @@ -83643,11 +85624,14 @@ if (options.defaults) { object.parent = ""; object.userEvent = null; + object.writeAsync = false; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; if (message.userEvent != null && message.hasOwnProperty("userEvent")) object.userEvent = $root.google.cloud.retail.v2alpha.UserEvent.toObject(message.userEvent, options); + if (message.writeAsync != null && message.hasOwnProperty("writeAsync")) + object.writeAsync = message.writeAsync; return object; }; @@ -83686,10 +85670,12 @@ * Properties of a CollectUserEventRequest. * @memberof google.cloud.retail.v2alpha * @interface ICollectUserEventRequest + * @property {string|null} [prebuiltRule] CollectUserEventRequest prebuiltRule * @property {string|null} [parent] CollectUserEventRequest parent * @property {string|null} [userEvent] CollectUserEventRequest userEvent * @property {string|null} [uri] CollectUserEventRequest uri * @property {number|Long|null} [ets] CollectUserEventRequest ets + * @property {string|null} [rawJson] CollectUserEventRequest rawJson */ /** @@ -83707,6 +85693,14 @@ this[keys[i]] = properties[keys[i]]; } + /** + * CollectUserEventRequest prebuiltRule. + * @member {string|null|undefined} prebuiltRule + * @memberof google.cloud.retail.v2alpha.CollectUserEventRequest + * @instance + */ + CollectUserEventRequest.prototype.prebuiltRule = null; + /** * CollectUserEventRequest parent. * @member {string} parent @@ -83739,6 +85733,28 @@ */ CollectUserEventRequest.prototype.ets = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + /** + * CollectUserEventRequest rawJson. + * @member {string} rawJson + * @memberof google.cloud.retail.v2alpha.CollectUserEventRequest + * @instance + */ + CollectUserEventRequest.prototype.rawJson = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CollectUserEventRequest conversionRule. + * @member {"prebuiltRule"|undefined} conversionRule + * @memberof google.cloud.retail.v2alpha.CollectUserEventRequest + * @instance + */ + Object.defineProperty(CollectUserEventRequest.prototype, "conversionRule", { + get: $util.oneOfGetter($oneOfFields = ["prebuiltRule"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * Creates a new CollectUserEventRequest instance using the specified properties. * @function create @@ -83771,6 +85787,10 @@ writer.uint32(/* id 3, wireType 2 =*/26).string(message.uri); if (message.ets != null && Object.hasOwnProperty.call(message, "ets")) writer.uint32(/* id 4, wireType 0 =*/32).int64(message.ets); + if (message.rawJson != null && Object.hasOwnProperty.call(message, "rawJson")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.rawJson); + if (message.prebuiltRule != null && Object.hasOwnProperty.call(message, "prebuiltRule")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.prebuiltRule); return writer; }; @@ -83805,6 +85825,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 6: { + message.prebuiltRule = reader.string(); + break; + } case 1: { message.parent = reader.string(); break; @@ -83821,6 +85845,10 @@ message.ets = reader.int64(); break; } + case 5: { + message.rawJson = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -83856,6 +85884,12 @@ CollectUserEventRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + var properties = {}; + if (message.prebuiltRule != null && message.hasOwnProperty("prebuiltRule")) { + properties.conversionRule = 1; + if (!$util.isString(message.prebuiltRule)) + return "prebuiltRule: string expected"; + } if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; @@ -83868,6 +85902,9 @@ if (message.ets != null && message.hasOwnProperty("ets")) if (!$util.isInteger(message.ets) && !(message.ets && $util.isInteger(message.ets.low) && $util.isInteger(message.ets.high))) return "ets: integer|Long expected"; + if (message.rawJson != null && message.hasOwnProperty("rawJson")) + if (!$util.isString(message.rawJson)) + return "rawJson: string expected"; return null; }; @@ -83883,6 +85920,8 @@ if (object instanceof $root.google.cloud.retail.v2alpha.CollectUserEventRequest) return object; var message = new $root.google.cloud.retail.v2alpha.CollectUserEventRequest(); + if (object.prebuiltRule != null) + message.prebuiltRule = String(object.prebuiltRule); if (object.parent != null) message.parent = String(object.parent); if (object.userEvent != null) @@ -83898,6 +85937,8 @@ message.ets = object.ets; else if (typeof object.ets === "object") message.ets = new $util.LongBits(object.ets.low >>> 0, object.ets.high >>> 0).toNumber(); + if (object.rawJson != null) + message.rawJson = String(object.rawJson); return message; }; @@ -83923,6 +85964,7 @@ object.ets = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else object.ets = options.longs === String ? "0" : 0; + object.rawJson = ""; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; @@ -83935,6 +85977,13 @@ object.ets = options.longs === String ? String(message.ets) : message.ets; else object.ets = options.longs === String ? $util.Long.prototype.toString.call(message.ets) : options.longs === Number ? new $util.LongBits(message.ets.low >>> 0, message.ets.high >>> 0).toNumber() : message.ets; + if (message.rawJson != null && message.hasOwnProperty("rawJson")) + object.rawJson = message.rawJson; + if (message.prebuiltRule != null && message.hasOwnProperty("prebuiltRule")) { + object.prebuiltRule = message.prebuiltRule; + if (options.oneofs) + object.conversionRule = "prebuiltRule"; + } return object; }; diff --git a/packages/google-cloud-retail/protos/protos.json b/packages/google-cloud-retail/protos/protos.json index 24aeb658c11..0c69647e16d 100644 --- a/packages/google-cloud-retail/protos/protos.json +++ b/packages/google-cloud-retail/protos/protos.json @@ -4062,6 +4062,14 @@ "recommendationsFilteringOption": { "type": "RecommendationsFilteringOption", "id": 8 + }, + "exactSearchableOption": { + "type": "ExactSearchableOption", + "id": 11 + }, + "retrievableOption": { + "type": "RetrievableOption", + "id": 12 } }, "nested": { @@ -4092,6 +4100,20 @@ "SEARCHABLE_ENABLED": 1, "SEARCHABLE_DISABLED": 2 } + }, + "ExactSearchableOption": { + "values": { + "EXACT_SEARCHABLE_OPTION_UNSPECIFIED": 0, + "EXACT_SEARCHABLE_ENABLED": 1, + "EXACT_SEARCHABLE_DISABLED": 2 + } + }, + "RetrievableOption": { + "values": { + "RETRIEVABLE_OPTION_UNSPECIFIED": 0, + "RETRIEVABLE_ENABLED": 1, + "RETRIEVABLE_DISABLED": 2 + } } } }, @@ -4220,6 +4242,23 @@ "languageCode": { "type": "string", "id": 5 + }, + "feeds": { + "rule": "repeated", + "type": "MerchantCenterFeedFilter", + "id": 6 + } + } + }, + "MerchantCenterFeedFilter": { + "fields": { + "primaryFeedId": { + "type": "int64", + "id": 1 + }, + "primaryFeedName": { + "type": "string", + "id": 2 } } }, @@ -5042,6 +5081,22 @@ "notificationPubsubTopic": { "type": "string", "id": 6 + }, + "transformedUserEventsMetadata": { + "type": "TransformedUserEventsMetadata", + "id": 7 + } + } + }, + "TransformedUserEventsMetadata": { + "fields": { + "sourceEventsCount": { + "type": "int64", + "id": 1 + }, + "transformedEventsCount": { + "type": "int64", + "id": 2 } } }, @@ -5263,7 +5318,10 @@ }, "retrievableFields": { "type": "google.protobuf.FieldMask", - "id": 30 + "id": 30, + "options": { + "deprecated": true + } }, "variants": { "rule": "repeated", @@ -5272,6 +5330,14 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "localInventories": { + "rule": "repeated", + "type": "LocalInventory", + "id": 35, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } }, "nested": { @@ -5647,6 +5713,22 @@ } ] }, + "BatchRemoveCatalogAttributes": { + "requestType": "BatchRemoveCatalogAttributesRequest", + "responseType": "BatchRemoveCatalogAttributesResponse", + "options": { + "(google.api.http).post": "/v2alpha/{attributes_config=projects/*/locations/*/catalogs/*/attributesConfig}:batchRemoveCatalogAttributes", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2alpha/{attributes_config=projects/*/locations/*/catalogs/*/attributesConfig}:batchRemoveCatalogAttributes", + "body": "*" + } + } + ] + }, "ReplaceCatalogAttribute": { "requestType": "ReplaceCatalogAttributeRequest", "responseType": "AttributesConfig", @@ -5861,6 +5943,40 @@ } } }, + "BatchRemoveCatalogAttributesRequest": { + "fields": { + "attributesConfig": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "retail.googleapis.com/AttributesConfig" + } + }, + "attributeKeys": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "BatchRemoveCatalogAttributesResponse": { + "fields": { + "deletedCatalogAttributes": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "resetCatalogAttributes": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + }, "ReplaceCatalogAttributeRequest": { "fields": { "attributesConfig": { @@ -5967,6 +6083,10 @@ "maxSuggestions": { "type": "int32", "id": 5 + }, + "enableAttributeSuggestions": { + "type": "bool", + "id": 9 } } }, @@ -5985,6 +6105,11 @@ "rule": "repeated", "type": "RecentSearchResult", "id": 3 + }, + "attributeResults": { + "keyType": "string", + "type": "AttributeResult", + "id": 4 } }, "nested": { @@ -6008,6 +6133,15 @@ "id": 1 } } + }, + "AttributeResult": { + "fields": { + "suggestions": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } } } }, @@ -6027,7 +6161,10 @@ "fields": { "facetSpec": { "type": "SearchRequest.FacetSpec", - "id": 3 + "id": 3, + "options": { + "deprecated": true + } }, "rule": { "type": "Rule", @@ -6066,10 +6203,7 @@ "searchSolutionUseCase": { "rule": "repeated", "type": "SearchSolutionUseCase", - "id": 7, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } + "id": 7 } } }, @@ -6492,6 +6626,11 @@ "keyType": "string", "type": "google.protobuf.Value", "id": 5 + }, + "personalLabels": { + "rule": "repeated", + "type": "string", + "id": 7 } } }, @@ -6840,6 +6979,11 @@ "rule": "repeated", "type": "BigQueryOutputResult", "id": 1 + }, + "gcsResult": { + "rule": "repeated", + "type": "GcsOutputResult", + "id": 2 } } }, @@ -6855,6 +6999,14 @@ } } }, + "GcsOutputResult": { + "fields": { + "outputUri": { + "type": "string", + "id": 1 + } + } + }, "Model": { "options": { "(google.api.resource).type": "retail.googleapis.com/Model", @@ -7111,8 +7263,8 @@ "(google.api.http).post": "/v2alpha/{parent=projects/*/locations/*/catalogs/*}/models", "(google.api.http).body": "model", "(google.api.method_signature)": "parent,model", - "(google.longrunning.operation_info).response_type": "Model", - "(google.longrunning.operation_info).metadata_type": "CreateModelMetadata" + "(google.longrunning.operation_info).response_type": "google.cloud.retail.v2alpha.Model", + "(google.longrunning.operation_info).metadata_type": "google.cloud.retail.v2alpha.CreateModelMetadata" }, "parsedOptions": [ { @@ -7126,8 +7278,8 @@ }, { "(google.longrunning.operation_info)": { - "response_type": "Model", - "metadata_type": "CreateModelMetadata" + "response_type": "google.cloud.retail.v2alpha.Model", + "metadata_type": "google.cloud.retail.v2alpha.CreateModelMetadata" } } ] @@ -7235,8 +7387,8 @@ "(google.api.http).post": "/v2alpha/{name=projects/*/locations/*/catalogs/*/models/*}:tune", "(google.api.http).body": "*", "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "TuneModelResponse", - "(google.longrunning.operation_info).metadata_type": "TuneModelMetadata" + "(google.longrunning.operation_info).response_type": "google.cloud.retail.v2alpha.TuneModelResponse", + "(google.longrunning.operation_info).metadata_type": "google.cloud.retail.v2alpha.TuneModelMetadata" }, "parsedOptions": [ { @@ -7250,8 +7402,8 @@ }, { "(google.longrunning.operation_info)": { - "response_type": "TuneModelResponse", - "metadata_type": "TuneModelMetadata" + "response_type": "google.cloud.retail.v2alpha.TuneModelResponse", + "metadata_type": "google.cloud.retail.v2alpha.TuneModelMetadata" } } ] @@ -8286,10 +8438,18 @@ "type": "string", "id": 8 }, + "diversityType": { + "type": "DiversityType", + "id": 20 + }, "enableCategoryFilterLevel": { "type": "string", "id": 16 }, + "personalizationSpec": { + "type": "SearchRequest.PersonalizationSpec", + "id": 21 + }, "solutionTypes": { "rule": "repeated", "type": "SolutionType", @@ -8298,6 +8458,15 @@ "(google.api.field_behavior)": "IMMUTABLE" } } + }, + "nested": { + "DiversityType": { + "values": { + "DIVERSITY_TYPE_UNSPECIFIED": 0, + "RULE_BASED_DIVERSITY": 2, + "DATA_DRIVEN_DIVERSITY": 3 + } + } } }, "ServingConfigService": { @@ -8709,11 +8878,26 @@ "options": { "(google.api.field_behavior)": "REQUIRED" } + }, + "writeAsync": { + "type": "bool", + "id": 3 } } }, "CollectUserEventRequest": { + "oneofs": { + "conversionRule": { + "oneof": [ + "prebuiltRule" + ] + } + }, "fields": { + "prebuiltRule": { + "type": "string", + "id": 6 + }, "parent": { "type": "string", "id": 1, @@ -8735,6 +8919,10 @@ "ets": { "type": "int64", "id": 4 + }, + "rawJson": { + "type": "string", + "id": 5 } } }, diff --git a/packages/google-cloud-retail/samples/README.md b/packages/google-cloud-retail/samples/README.md index 43cb51ffbbb..0412fc5c451 100644 --- a/packages/google-cloud-retail/samples/README.md +++ b/packages/google-cloud-retail/samples/README.md @@ -56,6 +56,7 @@ * [User_event_service.rejoin_user_events](#user_event_service.rejoin_user_events) * [User_event_service.write_user_event](#user_event_service.write_user_event) * [Catalog_service.add_catalog_attribute](#catalog_service.add_catalog_attribute) + * [Catalog_service.batch_remove_catalog_attributes](#catalog_service.batch_remove_catalog_attributes) * [Catalog_service.get_attributes_config](#catalog_service.get_attributes_config) * [Catalog_service.get_completion_config](#catalog_service.get_completion_config) * [Catalog_service.get_default_branch](#catalog_service.get_default_branch) @@ -923,6 +924,23 @@ __Usage:__ +### Catalog_service.batch_remove_catalog_attributes + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2alpha/catalog_service.batch_remove_catalog_attributes.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-retail/samples/generated/v2alpha/catalog_service.batch_remove_catalog_attributes.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-retail/samples/generated/v2alpha/catalog_service.batch_remove_catalog_attributes.js` + + +----- + + + + ### Catalog_service.get_attributes_config View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2alpha/catalog_service.get_attributes_config.js). diff --git a/packages/google-cloud-retail/samples/generated/v2alpha/catalog_service.batch_remove_catalog_attributes.js b/packages/google-cloud-retail/samples/generated/v2alpha/catalog_service.batch_remove_catalog_attributes.js new file mode 100644 index 00000000000..549459ca306 --- /dev/null +++ b/packages/google-cloud-retail/samples/generated/v2alpha/catalog_service.batch_remove_catalog_attributes.js @@ -0,0 +1,70 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(attributesConfig, attributeKeys) { + // [START retail_v2alpha_generated_CatalogService_BatchRemoveCatalogAttributes_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The attributes config resource shared by all catalog attributes + * being deleted. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` + */ + // const attributesConfig = 'abc123' + /** + * Required. The attribute name keys of the + * CatalogAttribute google.cloud.retail.v2alpha.CatalogAttribute s to + * delete. A maximum of 1000 catalog attributes can be deleted in a batch. + */ + // const attributeKeys = 'abc123' + + // Imports the Retail library + const {CatalogServiceClient} = require('@google-cloud/retail').v2alpha; + + // Instantiates a client + const retailClient = new CatalogServiceClient(); + + async function callBatchRemoveCatalogAttributes() { + // Construct request + const request = { + attributesConfig, + attributeKeys, + }; + + // Run request + const response = await retailClient.batchRemoveCatalogAttributes(request); + console.log(response); + } + + callBatchRemoveCatalogAttributes(); + // [END retail_v2alpha_generated_CatalogService_BatchRemoveCatalogAttributes_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-retail/samples/generated/v2alpha/catalog_service.get_completion_config.js b/packages/google-cloud-retail/samples/generated/v2alpha/catalog_service.get_completion_config.js index 637169fa3ed..3ae062dce01 100644 --- a/packages/google-cloud-retail/samples/generated/v2alpha/catalog_service.get_completion_config.js +++ b/packages/google-cloud-retail/samples/generated/v2alpha/catalog_service.get_completion_config.js @@ -30,7 +30,7 @@ function main(name) { */ /** * Required. Full CompletionConfig resource name. Format: - * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig` */ // const name = 'abc123' diff --git a/packages/google-cloud-retail/samples/generated/v2alpha/completion_service.complete_query.js b/packages/google-cloud-retail/samples/generated/v2alpha/completion_service.complete_query.js index e4d6046fac9..d59db6d161b 100644 --- a/packages/google-cloud-retail/samples/generated/v2alpha/completion_service.complete_query.js +++ b/packages/google-cloud-retail/samples/generated/v2alpha/completion_service.complete_query.js @@ -60,8 +60,9 @@ function main(catalog, query) { */ // const languageCodes = 'abc123' /** - * The device type context for completion suggestions. - * It is useful to apply different suggestions on different device types, e.g. + * The device type context for completion suggestions. We recommend that you + * leave this field empty. + * It can apply different suggestions on different device types, e.g. * `DESKTOP`, `MOBILE`. If it is empty, the suggestions are across all device * types. * Supported formats: @@ -92,6 +93,11 @@ function main(catalog, query) { * capped by 20. */ // const maxSuggestions = 1234 + /** + * If true, attribute suggestions are enabled and provided in response. + * This field is only available for "cloud-retail" dataset. + */ + // const enableAttributeSuggestions = true // Imports the Retail library const {CompletionServiceClient} = require('@google-cloud/retail').v2alpha; diff --git a/packages/google-cloud-retail/samples/generated/v2alpha/completion_service.import_completion_data.js b/packages/google-cloud-retail/samples/generated/v2alpha/completion_service.import_completion_data.js index b95bc8a0898..13561952575 100644 --- a/packages/google-cloud-retail/samples/generated/v2alpha/completion_service.import_completion_data.js +++ b/packages/google-cloud-retail/samples/generated/v2alpha/completion_service.import_completion_data.js @@ -39,8 +39,8 @@ function main(parent, inputConfig) { // const inputConfig = {} /** * Pub/Sub topic for receiving notification. If this field is set, - * when the import is finished, a notification will be sent to - * specified Pub/Sub topic. The message data will be JSON string of a + * when the import is finished, a notification is sent to + * specified Pub/Sub topic. The message data is JSON string of a * Operation google.longrunning.Operation. * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. */ diff --git a/packages/google-cloud-retail/samples/generated/v2alpha/control_service.get_control.js b/packages/google-cloud-retail/samples/generated/v2alpha/control_service.get_control.js index c359a57f9f9..5a7aa3bff3f 100644 --- a/packages/google-cloud-retail/samples/generated/v2alpha/control_service.get_control.js +++ b/packages/google-cloud-retail/samples/generated/v2alpha/control_service.get_control.js @@ -29,7 +29,7 @@ function main(name) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The resource name of the Control to delete. Format: + * Required. The resource name of the Control to get. Format: * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}` */ // const name = 'abc123' diff --git a/packages/google-cloud-retail/samples/generated/v2alpha/model_service.create_model.js b/packages/google-cloud-retail/samples/generated/v2alpha/model_service.create_model.js index f301ddfe6d3..5c7e3784bbb 100644 --- a/packages/google-cloud-retail/samples/generated/v2alpha/model_service.create_model.js +++ b/packages/google-cloud-retail/samples/generated/v2alpha/model_service.create_model.js @@ -30,15 +30,16 @@ function main(parent, model) { */ /** * Required. The parent resource under which to create the model. Format: - * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id} + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` */ // const parent = 'abc123' /** - * Required. The payload of the Model to create. + * Required. The payload of the Model google.cloud.retail.v2alpha.Model to + * create. */ // const model = {} /** - * Optional. Whether to run a dry_run to validate the request (without + * Optional. Whether to run a dry run to validate the request (without * actually creating the model). */ // const dryRun = true diff --git a/packages/google-cloud-retail/samples/generated/v2alpha/model_service.delete_model.js b/packages/google-cloud-retail/samples/generated/v2alpha/model_service.delete_model.js index 1339dd8f195..d93fe33095e 100644 --- a/packages/google-cloud-retail/samples/generated/v2alpha/model_service.delete_model.js +++ b/packages/google-cloud-retail/samples/generated/v2alpha/model_service.delete_model.js @@ -29,9 +29,9 @@ function main(name) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The resource name of the Model to delete. - * Format: - * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id} + * Required. The resource name of the + * Model google.cloud.retail.v2alpha.Model to delete. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` */ // const name = 'abc123' diff --git a/packages/google-cloud-retail/samples/generated/v2alpha/model_service.list_models.js b/packages/google-cloud-retail/samples/generated/v2alpha/model_service.list_models.js index 93d15b65699..f6d86b859f3 100644 --- a/packages/google-cloud-retail/samples/generated/v2alpha/model_service.list_models.js +++ b/packages/google-cloud-retail/samples/generated/v2alpha/model_service.list_models.js @@ -31,7 +31,7 @@ function main(parent) { /** * Required. The parent for which to list models. * Format: - * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id} + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` */ // const parent = 'abc123' /** diff --git a/packages/google-cloud-retail/samples/generated/v2alpha/model_service.pause_model.js b/packages/google-cloud-retail/samples/generated/v2alpha/model_service.pause_model.js index a8df9b88cd7..ddd01b3069d 100644 --- a/packages/google-cloud-retail/samples/generated/v2alpha/model_service.pause_model.js +++ b/packages/google-cloud-retail/samples/generated/v2alpha/model_service.pause_model.js @@ -31,7 +31,7 @@ function main(name) { /** * Required. The name of the model to pause. * Format: - * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id} + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` */ // const name = 'abc123' diff --git a/packages/google-cloud-retail/samples/generated/v2alpha/model_service.resume_model.js b/packages/google-cloud-retail/samples/generated/v2alpha/model_service.resume_model.js index efcf35842ab..2cf3d673e9f 100644 --- a/packages/google-cloud-retail/samples/generated/v2alpha/model_service.resume_model.js +++ b/packages/google-cloud-retail/samples/generated/v2alpha/model_service.resume_model.js @@ -31,7 +31,7 @@ function main(name) { /** * Required. The name of the model to resume. * Format: - * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id} + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` */ // const name = 'abc123' diff --git a/packages/google-cloud-retail/samples/generated/v2alpha/model_service.tune_model.js b/packages/google-cloud-retail/samples/generated/v2alpha/model_service.tune_model.js index 18b8af29a07..4eb7efa8ba2 100644 --- a/packages/google-cloud-retail/samples/generated/v2alpha/model_service.tune_model.js +++ b/packages/google-cloud-retail/samples/generated/v2alpha/model_service.tune_model.js @@ -31,7 +31,7 @@ function main(name) { /** * Required. The resource name of the model to tune. * Format: - * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id} + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` */ // const name = 'abc123' diff --git a/packages/google-cloud-retail/samples/generated/v2alpha/model_service.update_model.js b/packages/google-cloud-retail/samples/generated/v2alpha/model_service.update_model.js index c4f16d6834a..d7e88d1b57c 100644 --- a/packages/google-cloud-retail/samples/generated/v2alpha/model_service.update_model.js +++ b/packages/google-cloud-retail/samples/generated/v2alpha/model_service.update_model.js @@ -29,12 +29,13 @@ function main(model) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The body of the updated Model. + * Required. The body of the updated + * Model google.cloud.retail.v2alpha.Model. */ // const model = {} /** * Optional. Indicates which fields in the provided 'model' to - * update. If not set, will by default update all fields. + * update. If not set, by default updates all fields. */ // const updateMask = {} diff --git a/packages/google-cloud-retail/samples/generated/v2alpha/prediction_service.predict.js b/packages/google-cloud-retail/samples/generated/v2alpha/prediction_service.predict.js index 0ccea81d7d4..662706599c0 100644 --- a/packages/google-cloud-retail/samples/generated/v2alpha/prediction_service.predict.js +++ b/packages/google-cloud-retail/samples/generated/v2alpha/prediction_service.predict.js @@ -38,7 +38,7 @@ function main(placement, userEvent) { * The ID of the Recommendations AI serving config or placement. * Before you can request predictions from your model, you must create at * least one serving config or placement for it. For more information, see - * Managing serving configurations + * Manage serving configs * (https://cloud.google.com/retail/docs/manage-configs). * The full list of available serving configs can be seen at * https://console.cloud.google.com/ai/retail/catalogs/default_catalog/configs @@ -61,14 +61,14 @@ function main(placement, userEvent) { */ // const userEvent = {} /** - * Maximum number of results to return per page. Set this property - * to the number of prediction results needed. If zero, the service will - * choose a reasonable default. The maximum allowed value is 100. Values - * above 100 will be coerced to 100. + * Maximum number of results to return. Set this property to the number of + * prediction results needed. If zero, the service will choose a reasonable + * default. The maximum allowed value is 100. Values above 100 will be coerced + * to 100. */ // const pageSize = 1234 /** - * This field is not used for now; leave it unset. + * This field is not used; leave it unset. */ // const pageToken = 'abc123' /** @@ -89,12 +89,11 @@ function main(placement, userEvent) { * * tag=("Red" OR "Blue") tag="New-Arrival" tag=(NOT "promotional") * * filterOutOfStockItems tag=(-"promotional") * * filterOutOfStockItems - * If your filter blocks all prediction results, the API will return generic - * (unfiltered) popular products. If you only want results strictly matching - * the filters, set `strictFiltering` to True in `PredictRequest.params` to - * receive empty results instead. - * Note that the API will never return items with storageStatus of "EXPIRED" - * or "DELETED" regardless of filter choices. + * If your filter blocks all prediction results, the API will return *no* + * results. If instead you want empty result sets to return generic + * (unfiltered) popular products, set `strictFiltering` to False in + * `PredictRequest.params`. Note that the API will never return items with + * storageStatus of "EXPIRED" or "DELETED" regardless of filter choices. * If `filterSyntaxV2` is set to true under the `params` field, then * attribute-based expressions are expected instead of the above described * tag-based syntax. Examples: @@ -119,7 +118,7 @@ function main(placement, userEvent) { * * `returnScore`: Boolean. If set to true, the prediction 'score' * corresponding to each returned product will be set in the * `results.metadata` field in the prediction response. The given - * 'score' indicates the probability of an product being clicked/purchased + * 'score' indicates the probability of a product being clicked/purchased * given the user's context and history. * * `strictFiltering`: Boolean. True by default. If set to false, the service * will return generic (unfiltered) popular products instead of empty if diff --git a/packages/google-cloud-retail/samples/generated/v2alpha/product_service.import_products.js b/packages/google-cloud-retail/samples/generated/v2alpha/product_service.import_products.js index a781e33934f..eb2a3072ad3 100644 --- a/packages/google-cloud-retail/samples/generated/v2alpha/product_service.import_products.js +++ b/packages/google-cloud-retail/samples/generated/v2alpha/product_service.import_products.js @@ -44,8 +44,8 @@ function main(parent, inputConfig) { */ // const errorsConfig = {} /** - * Indicates which fields in the provided imported 'products' to update. If - * not set, will by default update all fields. + * Indicates which fields in the provided imported `products` to update. If + * not set, all fields are updated. */ // const updateMask = {} /** @@ -56,23 +56,19 @@ function main(parent, inputConfig) { // const reconciliationMode = {} /** * Full Pub/Sub topic name for receiving notification. If this field is set, - * when the import is finished, a notification will be sent to - * specified Pub/Sub topic. The message data will be JSON string of a + * when the import is finished, a notification is sent to + * specified Pub/Sub topic. The message data is JSON string of a * Operation google.longrunning.Operation. * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. It has * to be within the same project as * ImportProductsRequest.parent google.cloud.retail.v2alpha.ImportProductsRequest.parent. - * Make sure that both - * `cloud-retail-customer-data-access@system.gserviceaccount.com` and - * `service-@gcp-sa-retail.iam.gserviceaccount.com` - * have the `pubsub.topics.publish` IAM permission on the topic. - * Only supported when - * ImportProductsRequest.reconciliation_mode google.cloud.retail.v2alpha.ImportProductsRequest.reconciliation_mode - * is set to `FULL`. + * Make sure that `service-@gcp-sa-retail.iam.gserviceaccount.com` has the + * `pubsub.topics.publish` IAM permission on the topic. */ // const notificationPubsubTopic = 'abc123' /** - * If true, will perform the FULL import even if it would delete a large + * If true, this performs the FULL import even if it would delete a large * proportion of the products in the default branch, which could potentially * cause outages if you have live predict/search traffic. * Only supported when diff --git a/packages/google-cloud-retail/samples/generated/v2alpha/search_service.search.js b/packages/google-cloud-retail/samples/generated/v2alpha/search_service.search.js index c48a0d38775..af9258f76e5 100644 --- a/packages/google-cloud-retail/samples/generated/v2alpha/search_service.search.js +++ b/packages/google-cloud-retail/samples/generated/v2alpha/search_service.search.js @@ -33,7 +33,7 @@ function main(placement, visitorId) { * `projects/* /locations/global/catalogs/default_catalog/servingConfigs/default_serving_config` * or the name of the legacy placement resource, such as * `projects/* /locations/global/catalogs/default_catalog/placements/default_search`. - * This field is used to identify the serving configuration name and the set + * This field is used to identify the serving config name and the set * of models that will be used to make the search. */ // const placement = 'abc123' @@ -244,7 +244,7 @@ function main(placement, visitorId) { * the same as * UserEvent.page_categories google.cloud.retail.v2alpha.UserEvent.page_categories; * To represent full path of category, use '>' sign to separate different - * hierarchies. If '>' is part of the category name, please replace it with + * hierarchies. If '>' is part of the category name, replace it with * other character(s). * Category pages include special pages such as sales or promotions. For * instance, a special sale page may have the category hierarchy: @@ -258,6 +258,14 @@ function main(placement, visitorId) { // const searchMode = {} /** * The specification for personalization. + * Notice that if both + * ServingConfig.personalization_spec google.cloud.retail.v2alpha.ServingConfig.personalization_spec + * and + * SearchRequest.personalization_spec google.cloud.retail.v2alpha.SearchRequest.personalization_spec + * are set. + * SearchRequest.personalization_spec google.cloud.retail.v2alpha.SearchRequest.personalization_spec + * will override + * ServingConfig.personalization_spec google.cloud.retail.v2alpha.ServingConfig.personalization_spec. */ // const personalizationSpec = {} /** diff --git a/packages/google-cloud-retail/samples/generated/v2alpha/serving_config_service.add_control.js b/packages/google-cloud-retail/samples/generated/v2alpha/serving_config_service.add_control.js index 0459af055f7..d0a1af01f59 100644 --- a/packages/google-cloud-retail/samples/generated/v2alpha/serving_config_service.add_control.js +++ b/packages/google-cloud-retail/samples/generated/v2alpha/serving_config_service.add_control.js @@ -30,7 +30,7 @@ function main(servingConfig, controlId) { */ /** * Required. The source ServingConfig resource name . Format: - * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id} + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` */ // const servingConfig = 'abc123' /** diff --git a/packages/google-cloud-retail/samples/generated/v2alpha/serving_config_service.delete_serving_config.js b/packages/google-cloud-retail/samples/generated/v2alpha/serving_config_service.delete_serving_config.js index 6163b84f498..355ad20e346 100644 --- a/packages/google-cloud-retail/samples/generated/v2alpha/serving_config_service.delete_serving_config.js +++ b/packages/google-cloud-retail/samples/generated/v2alpha/serving_config_service.delete_serving_config.js @@ -30,7 +30,7 @@ function main(name) { */ /** * Required. The resource name of the ServingConfig to delete. Format: - * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id} + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` */ // const name = 'abc123' diff --git a/packages/google-cloud-retail/samples/generated/v2alpha/serving_config_service.get_serving_config.js b/packages/google-cloud-retail/samples/generated/v2alpha/serving_config_service.get_serving_config.js index dd73fc17198..3bac283ef66 100644 --- a/packages/google-cloud-retail/samples/generated/v2alpha/serving_config_service.get_serving_config.js +++ b/packages/google-cloud-retail/samples/generated/v2alpha/serving_config_service.get_serving_config.js @@ -30,7 +30,7 @@ function main(name) { */ /** * Required. The resource name of the ServingConfig to get. Format: - * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id} + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` */ // const name = 'abc123' diff --git a/packages/google-cloud-retail/samples/generated/v2alpha/serving_config_service.list_serving_configs.js b/packages/google-cloud-retail/samples/generated/v2alpha/serving_config_service.list_serving_configs.js index 031adf60b4a..c9bfa75f3db 100644 --- a/packages/google-cloud-retail/samples/generated/v2alpha/serving_config_service.list_serving_configs.js +++ b/packages/google-cloud-retail/samples/generated/v2alpha/serving_config_service.list_serving_configs.js @@ -30,7 +30,7 @@ function main(parent) { */ /** * Required. The catalog resource name. Format: - * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id} + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` */ // const parent = 'abc123' /** diff --git a/packages/google-cloud-retail/samples/generated/v2alpha/serving_config_service.remove_control.js b/packages/google-cloud-retail/samples/generated/v2alpha/serving_config_service.remove_control.js index f256e5072b6..2b6c6a1f9f3 100644 --- a/packages/google-cloud-retail/samples/generated/v2alpha/serving_config_service.remove_control.js +++ b/packages/google-cloud-retail/samples/generated/v2alpha/serving_config_service.remove_control.js @@ -30,7 +30,7 @@ function main(servingConfig, controlId) { */ /** * Required. The source ServingConfig resource name . Format: - * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id} + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` */ // const servingConfig = 'abc123' /** diff --git a/packages/google-cloud-retail/samples/generated/v2alpha/snippet_metadata.google.cloud.retail.v2alpha.json b/packages/google-cloud-retail/samples/generated/v2alpha/snippet_metadata.google.cloud.retail.v2alpha.json index c71708f06aa..e7691f6c619 100644 --- a/packages/google-cloud-retail/samples/generated/v2alpha/snippet_metadata.google.cloud.retail.v2alpha.json +++ b/packages/google-cloud-retail/samples/generated/v2alpha/snippet_metadata.google.cloud.retail.v2alpha.json @@ -451,6 +451,50 @@ } } }, + { + "regionTag": "retail_v2alpha_generated_CatalogService_BatchRemoveCatalogAttributes_async", + "title": "CatalogService batchRemoveCatalogAttributes Sample", + "origin": "API_DEFINITION", + "description": " Removes all specified [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute]s from the [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig].", + "canonical": true, + "file": "catalog_service.batch_remove_catalog_attributes.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchRemoveCatalogAttributes", + "fullName": "google.cloud.retail.v2alpha.CatalogService.BatchRemoveCatalogAttributes", + "async": true, + "parameters": [ + { + "name": "attributes_config", + "type": "TYPE_STRING" + }, + { + "name": "attribute_keys", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse", + "client": { + "shortName": "CatalogServiceClient", + "fullName": "google.cloud.retail.v2alpha.CatalogServiceClient" + }, + "method": { + "shortName": "BatchRemoveCatalogAttributes", + "fullName": "google.cloud.retail.v2alpha.CatalogService.BatchRemoveCatalogAttributes", + "service": { + "shortName": "CatalogService", + "fullName": "google.cloud.retail.v2alpha.CatalogService" + } + } + } + }, { "regionTag": "retail_v2alpha_generated_CatalogService_ReplaceCatalogAttribute_async", "title": "CatalogService replaceCatalogAttribute Sample", @@ -503,14 +547,14 @@ "regionTag": "retail_v2alpha_generated_CompletionService_CompleteQuery_async", "title": "CatalogService completeQuery Sample", "origin": "API_DEFINITION", - "description": " Completes the specified prefix with keyword suggestions. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", + "description": " Completes the specified prefix with keyword suggestions. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.", "canonical": true, "file": "completion_service.complete_query.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 114, + "end": 120, "type": "FULL" } ], @@ -546,6 +590,10 @@ { "name": "max_suggestions", "type": "TYPE_INT32" + }, + { + "name": "enable_attribute_suggestions", + "type": "TYPE_BOOL" } ], "resultType": ".google.cloud.retail.v2alpha.CompleteQueryResponse", @@ -567,7 +615,7 @@ "regionTag": "retail_v2alpha_generated_CompletionService_ImportCompletionData_async", "title": "CatalogService importCompletionData Sample", "origin": "API_DEFINITION", - "description": " Bulk import of processed completion dataset. Request processing is asynchronous. Partial updating is not supported. The operation is successfully finished only after the imported suggestions are indexed successfully and ready for serving. The process takes hours. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", + "description": " Bulk import of processed completion dataset. Request processing is asynchronous. Partial updating is not supported. The operation is successfully finished only after the imported suggestions are indexed successfully and ready for serving. The process takes hours. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.", "canonical": true, "file": "completion_service.import_completion_data.js", "language": "JAVASCRIPT", @@ -703,7 +751,7 @@ "regionTag": "retail_v2alpha_generated_ControlService_UpdateControl_async", "title": "CatalogService updateControl Sample", "origin": "API_DEFINITION", - "description": " Updates a Control. [Control][google.cloud.retail.v2alpha.Control] cannot be set to a different oneof field, if so an INVALID_ARGUMENT is returned. If the [Control][google.cloud.retail.v2alpha.Control] to delete does not exist, a NOT_FOUND error is returned.", + "description": " Updates a Control. [Control][google.cloud.retail.v2alpha.Control] cannot be set to a different oneof field, if so an INVALID_ARGUMENT is returned. If the [Control][google.cloud.retail.v2alpha.Control] to update does not exist, a NOT_FOUND error is returned.", "canonical": true, "file": "control_service.update_control.js", "language": "JAVASCRIPT", @@ -787,7 +835,7 @@ "regionTag": "retail_v2alpha_generated_ControlService_ListControls_async", "title": "CatalogService listControls Sample", "origin": "API_DEFINITION", - "description": " Lists all Controls linked to this catalog.", + "description": " Lists all Controls by their parent [Catalog][google.cloud.retail.v2alpha.Catalog].", "canonical": true, "file": "control_service.list_controls.js", "language": "JAVASCRIPT", @@ -846,7 +894,7 @@ "segments": [ { "start": 25, - "end": 65, + "end": 66, "type": "FULL" } ], @@ -1055,14 +1103,14 @@ "regionTag": "retail_v2alpha_generated_ModelService_UpdateModel_async", "title": "CatalogService updateModel Sample", "origin": "API_DEFINITION", - "description": " Update of model metadata. Only fields that currently can be updated are: filtering_option, periodic_tuning_state. If other values are provided, this API method will ignore them.", + "description": " Update of model metadata. Only fields that currently can be updated are: `filtering_option` and `periodic_tuning_state`. If other values are provided, this API method ignores them.", "canonical": true, "file": "model_service.update_model.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 58, + "end": 59, "type": "FULL" } ], @@ -1146,7 +1194,7 @@ "segments": [ { "start": 25, - "end": 178, + "end": 177, "type": "FULL" } ], @@ -1498,7 +1546,7 @@ "segments": [ { "start": 25, - "end": 103, + "end": 99, "type": "FULL" } ], @@ -1559,7 +1607,7 @@ "regionTag": "retail_v2alpha_generated_ProductService_SetInventory_async", "title": "CatalogService setInventory Sample", "origin": "API_DEFINITION", - "description": " Updates inventory information for a [Product][google.cloud.retail.v2alpha.Product] while respecting the last update timestamps of each inventory field. This process is asynchronous and does not require the [Product][google.cloud.retail.v2alpha.Product] to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the [Product][google.cloud.retail.v2alpha.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]. When inventory is updated with [ProductService.CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct], the specified inventory field value(s) will overwrite any existing value(s) while ignoring the last update time for this field. Furthermore, the last update time for the specified inventory fields will be overwritten to the time of the [ProductService.CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] or [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] request. If no inventory fields are set in [CreateProductRequest.product][google.cloud.retail.v2alpha.CreateProductRequest.product], then any pre-existing inventory information for this product will be used. If no inventory fields are set in [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask], then any existing inventory information will be preserved. Pre-existing inventory information can only be updated with [ProductService.SetInventory][google.cloud.retail.v2alpha.ProductService.SetInventory], [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.AddFulfillmentPlaces], and [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.RemoveFulfillmentPlaces]. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", + "description": " Updates inventory information for a [Product][google.cloud.retail.v2alpha.Product] while respecting the last update timestamps of each inventory field. This process is asynchronous and does not require the [Product][google.cloud.retail.v2alpha.Product] to exist before updating fulfillment information. If the request is valid, the update is enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the [Product][google.cloud.retail.v2alpha.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]. When inventory is updated with [ProductService.CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct], the specified inventory field value(s) overwrite any existing value(s) while ignoring the last update time for this field. Furthermore, the last update times for the specified inventory fields are overwritten by the times of the [ProductService.CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] or [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] request. If no inventory fields are set in [CreateProductRequest.product][google.cloud.retail.v2alpha.CreateProductRequest.product], then any pre-existing inventory information for this product is used. If no inventory fields are set in [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask], then any existing inventory information is preserved. Pre-existing inventory information can only be updated with [ProductService.SetInventory][google.cloud.retail.v2alpha.ProductService.SetInventory], [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.AddFulfillmentPlaces], and [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.RemoveFulfillmentPlaces]. The returned [Operation][google.longrunning.Operation]s is obsolete after one day, and the [GetOperation][google.longrunning.Operations.GetOperation] API returns `NOT_FOUND` afterwards. If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates are not marked as [done][google.longrunning.Operation.done] until they are obsolete. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.", "canonical": true, "file": "product_service.set_inventory.js", "language": "JAVASCRIPT", @@ -1611,7 +1659,7 @@ "regionTag": "retail_v2alpha_generated_ProductService_AddFulfillmentPlaces_async", "title": "CatalogService addFulfillmentPlaces Sample", "origin": "API_DEFINITION", - "description": " Incrementally adds place IDs to [Product.fulfillment_info.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]. This process is asynchronous and does not require the [Product][google.cloud.retail.v2alpha.Product] to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the added place IDs are not immediately manifested in the [Product][google.cloud.retail.v2alpha.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", + "description": " Incrementally adds place IDs to [Product.fulfillment_info.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]. This process is asynchronous and does not require the [Product][google.cloud.retail.v2alpha.Product] to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the added place IDs are not immediately manifested in the [Product][google.cloud.retail.v2alpha.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]. The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards. If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.", "canonical": true, "file": "product_service.add_fulfillment_places.js", "language": "JAVASCRIPT", @@ -1667,7 +1715,7 @@ "regionTag": "retail_v2alpha_generated_ProductService_RemoveFulfillmentPlaces_async", "title": "CatalogService removeFulfillmentPlaces Sample", "origin": "API_DEFINITION", - "description": " Incrementally removes place IDs from a [Product.fulfillment_info.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]. This process is asynchronous and does not require the [Product][google.cloud.retail.v2alpha.Product] to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the removed place IDs are not immediately manifested in the [Product][google.cloud.retail.v2alpha.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", + "description": " Incrementally removes place IDs from a [Product.fulfillment_info.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]. This process is asynchronous and does not require the [Product][google.cloud.retail.v2alpha.Product] to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the removed place IDs are not immediately manifested in the [Product][google.cloud.retail.v2alpha.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]. The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards. If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.", "canonical": true, "file": "product_service.remove_fulfillment_places.js", "language": "JAVASCRIPT", @@ -1723,7 +1771,7 @@ "regionTag": "retail_v2alpha_generated_ProductService_AddLocalInventories_async", "title": "CatalogService addLocalInventories Sample", "origin": "API_DEFINITION", - "description": " Updates local inventory information for a [Product][google.cloud.retail.v2alpha.Product] at a list of places, while respecting the last update timestamps of each inventory field. This process is asynchronous and does not require the [Product][google.cloud.retail.v2alpha.Product] to exist before updating inventory information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the [Product][google.cloud.retail.v2alpha.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]. Local inventory information can only be modified using this method. [ProductService.CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] has no effect on local inventories. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", + "description": " Updates local inventory information for a [Product][google.cloud.retail.v2alpha.Product] at a list of places, while respecting the last update timestamps of each inventory field. This process is asynchronous and does not require the [Product][google.cloud.retail.v2alpha.Product] to exist before updating inventory information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the [Product][google.cloud.retail.v2alpha.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]. Local inventory information can only be modified using this method. [ProductService.CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] has no effect on local inventories. The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards. If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.", "canonical": true, "file": "product_service.add_local_inventories.js", "language": "JAVASCRIPT", @@ -1779,7 +1827,7 @@ "regionTag": "retail_v2alpha_generated_ProductService_RemoveLocalInventories_async", "title": "CatalogService removeLocalInventories Sample", "origin": "API_DEFINITION", - "description": " Remove local inventory information for a [Product][google.cloud.retail.v2alpha.Product] at a list of places at a removal timestamp. This process is asynchronous. If the request is valid, the removal will be enqueued and processed downstream. As a consequence, when a response is returned, removals are not immediately manifested in the [Product][google.cloud.retail.v2alpha.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]. Local inventory information can only be removed using this method. [ProductService.CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] has no effect on local inventories. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", + "description": " Remove local inventory information for a [Product][google.cloud.retail.v2alpha.Product] at a list of places at a removal timestamp. This process is asynchronous. If the request is valid, the removal will be enqueued and processed downstream. As a consequence, when a response is returned, removals are not immediately manifested in the [Product][google.cloud.retail.v2alpha.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]. Local inventory information can only be removed using this method. [ProductService.CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] has no effect on local inventories. The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards. If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.", "canonical": true, "file": "product_service.remove_local_inventories.js", "language": "JAVASCRIPT", @@ -1831,14 +1879,14 @@ "regionTag": "retail_v2alpha_generated_SearchService_Search_async", "title": "CatalogService search Sample", "origin": "API_DEFINITION", - "description": " Performs a search. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.", + "description": " Performs a search. This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.", "canonical": true, "file": "search_service.search.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 307, + "end": 315, "type": "FULL" } ], @@ -2270,7 +2318,7 @@ "segments": [ { "start": 25, - "end": 59, + "end": 66, "type": "FULL" } ], @@ -2286,6 +2334,10 @@ { "name": "user_event", "type": ".google.cloud.retail.v2alpha.UserEvent" + }, + { + "name": "write_async", + "type": "TYPE_BOOL" } ], "resultType": ".google.cloud.retail.v2alpha.UserEvent", @@ -2314,7 +2366,7 @@ "segments": [ { "start": 25, - "end": 73, + "end": 85, "type": "FULL" } ], @@ -2323,6 +2375,10 @@ "fullName": "google.cloud.retail.v2alpha.UserEventService.CollectUserEvent", "async": true, "parameters": [ + { + "name": "prebuilt_rule", + "type": "TYPE_STRING" + }, { "name": "parent", "type": "TYPE_STRING" @@ -2338,6 +2394,10 @@ { "name": "ets", "type": "TYPE_INT64" + }, + { + "name": "raw_json", + "type": "TYPE_STRING" } ], "resultType": ".google.api.HttpBody", @@ -2407,7 +2467,7 @@ "regionTag": "retail_v2alpha_generated_UserEventService_ImportUserEvents_async", "title": "CatalogService importUserEvents Sample", "origin": "API_DEFINITION", - "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.", + "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`.", "canonical": true, "file": "user_event_service.import_user_events.js", "language": "JAVASCRIPT", @@ -2455,7 +2515,7 @@ "regionTag": "retail_v2alpha_generated_UserEventService_RejoinUserEvents_async", "title": "CatalogService rejoinUserEvents Sample", "origin": "API_DEFINITION", - "description": " Starts a user event rejoin operation with latest product catalog. Events will not be annotated with detailed product information if product is missing from the catalog at the time the user event is ingested, and these events are stored as unjoined events with a limited usage on training and serving. This method can be used to start a join operation on specified events with latest version of product catalog. It can also be used to correct events joined with the wrong product catalog. A rejoin operation can take hours or days to complete.", + "description": " Starts a user-event rejoin operation with latest product catalog. Events are not annotated with detailed product information for products that are missing from the catalog when the user event is ingested. These events are stored as unjoined events with limited usage on training and serving. You can use this method to start a join operation on specified events with the latest version of product catalog. You can also use this method to correct events joined with the wrong product catalog. A rejoin operation can take hours or days to complete.", "canonical": true, "file": "user_event_service.rejoin_user_events.js", "language": "JAVASCRIPT", diff --git a/packages/google-cloud-retail/samples/generated/v2alpha/user_event_service.collect_user_event.js b/packages/google-cloud-retail/samples/generated/v2alpha/user_event_service.collect_user_event.js index e5f542a0c09..adfa7ca8eb9 100644 --- a/packages/google-cloud-retail/samples/generated/v2alpha/user_event_service.collect_user_event.js +++ b/packages/google-cloud-retail/samples/generated/v2alpha/user_event_service.collect_user_event.js @@ -28,6 +28,11 @@ function main(parent, userEvent) { * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ + /** + * The prebuilt rule name that can convert a specific type of raw_json. + * For example: "default_schema/v1.0" + */ + // const prebuiltRule = 'abc123' /** * Required. The parent catalog name, such as * `projects/1234/locations/global/catalogs/default_catalog`. @@ -51,6 +56,13 @@ function main(parent, userEvent) { * payload bytes. */ // const ets = 1234 + /** + * An arbitrary serialized JSON string that contains necessary information + * that can comprise a user event. When this field is specified, the + * user_event field will be ignored. Note: line-delimited JSON is not + * supported, a single JSON only. + */ + // const rawJson = 'abc123' // Imports the Retail library const {UserEventServiceClient} = require('@google-cloud/retail').v2alpha; diff --git a/packages/google-cloud-retail/samples/generated/v2alpha/user_event_service.rejoin_user_events.js b/packages/google-cloud-retail/samples/generated/v2alpha/user_event_service.rejoin_user_events.js index 73257790d89..4b3800bd34a 100644 --- a/packages/google-cloud-retail/samples/generated/v2alpha/user_event_service.rejoin_user_events.js +++ b/packages/google-cloud-retail/samples/generated/v2alpha/user_event_service.rejoin_user_events.js @@ -36,8 +36,8 @@ function main(parent) { /** * The type of the user event rejoin to define the scope and range of the user * events to be rejoined with the latest product catalog. Defaults to - * USER_EVENT_REJOIN_SCOPE_UNSPECIFIED if this field is not set, or set to an - * invalid integer value. + * `USER_EVENT_REJOIN_SCOPE_UNSPECIFIED` if this field is not set, or set to + * an invalid integer value. */ // const userEventRejoinScope = {} diff --git a/packages/google-cloud-retail/samples/generated/v2alpha/user_event_service.write_user_event.js b/packages/google-cloud-retail/samples/generated/v2alpha/user_event_service.write_user_event.js index 3286c8f3526..5e13afed3ca 100644 --- a/packages/google-cloud-retail/samples/generated/v2alpha/user_event_service.write_user_event.js +++ b/packages/google-cloud-retail/samples/generated/v2alpha/user_event_service.write_user_event.js @@ -37,6 +37,13 @@ function main(parent, userEvent) { * Required. User event to write. */ // const userEvent = {} + /** + * If set to true, the user event will be written asynchronously after + * validation, and the API will respond without waiting for the write. + * Therefore, silent failures can occur even if the API returns success. In + * case of silent failures, error messages can be found in Stackdriver logs. + */ + // const writeAsync = true // Imports the Retail library const {UserEventServiceClient} = require('@google-cloud/retail').v2alpha; diff --git a/packages/google-cloud-retail/src/v2/catalog_service_client.ts b/packages/google-cloud-retail/src/v2/catalog_service_client.ts index 5b75717098a..32de58815dc 100644 --- a/packages/google-cloud-retail/src/v2/catalog_service_client.ts +++ b/packages/google-cloud-retail/src/v2/catalog_service_client.ts @@ -125,6 +125,9 @@ export class CatalogServiceClient { (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { opts['scopes'] = staticMembers.scopes; diff --git a/packages/google-cloud-retail/src/v2/completion_service_client.ts b/packages/google-cloud-retail/src/v2/completion_service_client.ts index 073bef1cafe..01413d5e601 100644 --- a/packages/google-cloud-retail/src/v2/completion_service_client.ts +++ b/packages/google-cloud-retail/src/v2/completion_service_client.ts @@ -127,6 +127,9 @@ export class CompletionServiceClient { (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { opts['scopes'] = staticMembers.scopes; diff --git a/packages/google-cloud-retail/src/v2/control_service_client.ts b/packages/google-cloud-retail/src/v2/control_service_client.ts index 1b1c792b370..5e9499d4862 100644 --- a/packages/google-cloud-retail/src/v2/control_service_client.ts +++ b/packages/google-cloud-retail/src/v2/control_service_client.ts @@ -125,6 +125,9 @@ export class ControlServiceClient { (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { opts['scopes'] = staticMembers.scopes; diff --git a/packages/google-cloud-retail/src/v2/prediction_service_client.ts b/packages/google-cloud-retail/src/v2/prediction_service_client.ts index 9dc1b1aecf5..b7fd730333e 100644 --- a/packages/google-cloud-retail/src/v2/prediction_service_client.ts +++ b/packages/google-cloud-retail/src/v2/prediction_service_client.ts @@ -123,6 +123,9 @@ export class PredictionServiceClient { (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { opts['scopes'] = staticMembers.scopes; diff --git a/packages/google-cloud-retail/src/v2/product_service_client.ts b/packages/google-cloud-retail/src/v2/product_service_client.ts index b43eeb496f0..570420c88f9 100644 --- a/packages/google-cloud-retail/src/v2/product_service_client.ts +++ b/packages/google-cloud-retail/src/v2/product_service_client.ts @@ -127,6 +127,9 @@ export class ProductServiceClient { (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { opts['scopes'] = staticMembers.scopes; diff --git a/packages/google-cloud-retail/src/v2/search_service_client.ts b/packages/google-cloud-retail/src/v2/search_service_client.ts index 4f20e8f9bc0..41cf783af71 100644 --- a/packages/google-cloud-retail/src/v2/search_service_client.ts +++ b/packages/google-cloud-retail/src/v2/search_service_client.ts @@ -128,6 +128,9 @@ export class SearchServiceClient { (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { opts['scopes'] = staticMembers.scopes; diff --git a/packages/google-cloud-retail/src/v2/serving_config_service_client.ts b/packages/google-cloud-retail/src/v2/serving_config_service_client.ts index d23ae556e17..375df798169 100644 --- a/packages/google-cloud-retail/src/v2/serving_config_service_client.ts +++ b/packages/google-cloud-retail/src/v2/serving_config_service_client.ts @@ -125,6 +125,9 @@ export class ServingConfigServiceClient { (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { opts['scopes'] = staticMembers.scopes; diff --git a/packages/google-cloud-retail/src/v2/user_event_service_client.ts b/packages/google-cloud-retail/src/v2/user_event_service_client.ts index e6e38be5774..c9529b9fdb7 100644 --- a/packages/google-cloud-retail/src/v2/user_event_service_client.ts +++ b/packages/google-cloud-retail/src/v2/user_event_service_client.ts @@ -124,6 +124,9 @@ export class UserEventServiceClient { (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { opts['scopes'] = staticMembers.scopes; diff --git a/packages/google-cloud-retail/src/v2alpha/catalog_service_client.ts b/packages/google-cloud-retail/src/v2alpha/catalog_service_client.ts index 64f1bcf3108..ba921395e9f 100644 --- a/packages/google-cloud-retail/src/v2alpha/catalog_service_client.ts +++ b/packages/google-cloud-retail/src/v2alpha/catalog_service_client.ts @@ -125,6 +125,9 @@ export class CatalogServiceClient { (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { opts['scopes'] = staticMembers.scopes; @@ -239,6 +242,9 @@ export class CatalogServiceClient { selector: 'google.longrunning.Operations.GetOperation', get: '/v2alpha/{name=projects/*/locations/*/catalogs/*/branches/*/operations/*}', additional_bindings: [ + { + get: '/v2alpha/{name=projects/*/locations/*/catalogs/*/branches/*/places/*/operations/*}', + }, { get: '/v2alpha/{name=projects/*/locations/*/catalogs/*/operations/*}', }, @@ -322,6 +328,7 @@ export class CatalogServiceClient { 'updateAttributesConfig', 'addCatalogAttribute', 'removeCatalogAttribute', + 'batchRemoveCatalogAttributes', 'replaceCatalogAttribute', ]; for (const methodName of catalogServiceStubMethods) { @@ -755,7 +762,7 @@ export class CatalogServiceClient { * The request object that will be sent. * @param {string} request.name * Required. Full CompletionConfig resource name. Format: - * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1399,6 +1406,115 @@ export class CatalogServiceClient { callback ); } + /** + * Removes all specified + * {@link google.cloud.retail.v2alpha.CatalogAttribute|CatalogAttribute}s from the + * {@link google.cloud.retail.v2alpha.AttributesConfig|AttributesConfig}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.attributesConfig + * Required. The attributes config resource shared by all catalog attributes + * being deleted. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig` + * @param {string[]} request.attributeKeys + * Required. The attribute name keys of the + * {@link google.cloud.retail.v2alpha.CatalogAttribute|CatalogAttribute}s to + * delete. A maximum of 1000 catalog attributes can be deleted in a batch. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [BatchRemoveCatalogAttributesResponse]{@link google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2alpha/catalog_service.batch_remove_catalog_attributes.js + * region_tag:retail_v2alpha_generated_CatalogService_BatchRemoveCatalogAttributes_async + */ + batchRemoveCatalogAttributes( + request?: protos.google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesResponse, + ( + | protos.google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesRequest + | undefined + ), + {} | undefined + ] + >; + batchRemoveCatalogAttributes( + request: protos.google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesResponse, + | protos.google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesRequest + | null + | undefined, + {} | null | undefined + > + ): void; + batchRemoveCatalogAttributes( + request: protos.google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesRequest, + callback: Callback< + protos.google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesResponse, + | protos.google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesRequest + | null + | undefined, + {} | null | undefined + > + ): void; + batchRemoveCatalogAttributes( + request?: protos.google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesResponse, + | protos.google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesResponse, + | protos.google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesResponse, + ( + | protos.google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + attributes_config: request.attributesConfig ?? '', + }); + this.initialize(); + return this.innerApiCalls.batchRemoveCatalogAttributes( + request, + options, + callback + ); + } /** * Replaces the specified * {@link google.cloud.retail.v2alpha.CatalogAttribute|CatalogAttribute} in the diff --git a/packages/google-cloud-retail/src/v2alpha/catalog_service_client_config.json b/packages/google-cloud-retail/src/v2alpha/catalog_service_client_config.json index 08407daa19a..430dc2ec64e 100644 --- a/packages/google-cloud-retail/src/v2alpha/catalog_service_client_config.json +++ b/packages/google-cloud-retail/src/v2alpha/catalog_service_client_config.json @@ -79,6 +79,11 @@ "retry_codes_name": "idempotent", "retry_params_name": "319f27672a8be83550d842a373549dd84649a57e" }, + "BatchRemoveCatalogAttributes": { + "timeout_millis": 5000, + "retry_codes_name": "idempotent", + "retry_params_name": "319f27672a8be83550d842a373549dd84649a57e" + }, "ReplaceCatalogAttribute": { "timeout_millis": 5000, "retry_codes_name": "idempotent", diff --git a/packages/google-cloud-retail/src/v2alpha/completion_service_client.ts b/packages/google-cloud-retail/src/v2alpha/completion_service_client.ts index 95593a850d4..b2710f1945e 100644 --- a/packages/google-cloud-retail/src/v2alpha/completion_service_client.ts +++ b/packages/google-cloud-retail/src/v2alpha/completion_service_client.ts @@ -43,7 +43,7 @@ const version = require('../../../package.json').version; * Auto-completion service for retail. * * This feature is only available for users who have Retail Search enabled. - * Please enable Retail Search on Cloud Console before using this feature. + * Enable Retail Search on Cloud Console before using this feature. * @class * @memberof v2alpha */ @@ -127,6 +127,9 @@ export class CompletionServiceClient { (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { opts['scopes'] = staticMembers.scopes; @@ -224,6 +227,9 @@ export class CompletionServiceClient { selector: 'google.longrunning.Operations.GetOperation', get: '/v2alpha/{name=projects/*/locations/*/catalogs/*/branches/*/operations/*}', additional_bindings: [ + { + get: '/v2alpha/{name=projects/*/locations/*/catalogs/*/branches/*/places/*/operations/*}', + }, { get: '/v2alpha/{name=projects/*/locations/*/catalogs/*/operations/*}', }, @@ -398,7 +404,7 @@ export class CompletionServiceClient { * Completes the specified prefix with keyword suggestions. * * This feature is only available for users who have Retail Search enabled. - * Please enable Retail Search on Cloud Console before using this feature. + * Enable Retail Search on Cloud Console before using this feature. * * @param {Object} request * The request object that will be sent. @@ -430,8 +436,10 @@ export class CompletionServiceClient { * Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum * number of language codes is 3. * @param {string} request.deviceType - * The device type context for completion suggestions. - * It is useful to apply different suggestions on different device types, e.g. + * The device type context for completion suggestions. We recommend that you + * leave this field empty. + * + * It can apply different suggestions on different device types, e.g. * `DESKTOP`, `MOBILE`. If it is empty, the suggestions are across all device * types. * @@ -465,6 +473,10 @@ export class CompletionServiceClient { * * The maximum allowed max suggestions is 20. If it is set higher, it will be * capped by 20. + * @param {boolean} request.enableAttributeSuggestions + * If true, attribute suggestions are enabled and provided in response. + * + * This field is only available for "cloud-retail" dataset. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -559,7 +571,7 @@ export class CompletionServiceClient { * are indexed successfully and ready for serving. The process takes hours. * * This feature is only available for users who have Retail Search enabled. - * Please enable Retail Search on Cloud Console before using this feature. + * Enable Retail Search on Cloud Console before using this feature. * * @param {Object} request * The request object that will be sent. @@ -571,8 +583,8 @@ export class CompletionServiceClient { * Required. The desired input location of the data. * @param {string} request.notificationPubsubTopic * Pub/Sub topic for receiving notification. If this field is set, - * when the import is finished, a notification will be sent to - * specified Pub/Sub topic. The message data will be JSON string of a + * when the import is finished, a notification is sent to + * specified Pub/Sub topic. The message data is JSON string of a * {@link google.longrunning.Operation|Operation}. * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. * @param {object} [options] diff --git a/packages/google-cloud-retail/src/v2alpha/control_service_client.ts b/packages/google-cloud-retail/src/v2alpha/control_service_client.ts index bfa3e9c0feb..5b7f3f1fa7a 100644 --- a/packages/google-cloud-retail/src/v2alpha/control_service_client.ts +++ b/packages/google-cloud-retail/src/v2alpha/control_service_client.ts @@ -125,6 +125,9 @@ export class ControlServiceClient { (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { opts['scopes'] = staticMembers.scopes; @@ -233,6 +236,9 @@ export class ControlServiceClient { selector: 'google.longrunning.Operations.GetOperation', get: '/v2alpha/{name=projects/*/locations/*/catalogs/*/branches/*/operations/*}', additional_bindings: [ + { + get: '/v2alpha/{name=projects/*/locations/*/catalogs/*/branches/*/places/*/operations/*}', + }, { get: '/v2alpha/{name=projects/*/locations/*/catalogs/*/operations/*}', }, @@ -597,7 +603,7 @@ export class ControlServiceClient { * * {@link google.cloud.retail.v2alpha.Control|Control} cannot be set to a different * oneof field, if so an INVALID_ARGUMENT is returned. If the - * {@link google.cloud.retail.v2alpha.Control|Control} to delete does not exist, a + * {@link google.cloud.retail.v2alpha.Control|Control} to update does not exist, a * NOT_FOUND error is returned. * * @param {Object} request @@ -702,7 +708,7 @@ export class ControlServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Required. The resource name of the Control to delete. Format: + * Required. The resource name of the Control to get. Format: * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. @@ -784,7 +790,8 @@ export class ControlServiceClient { } /** - * Lists all Controls linked to this catalog. + * Lists all Controls by their parent + * {@link google.cloud.retail.v2alpha.Catalog|Catalog}. * * @param {Object} request * The request object that will be sent. diff --git a/packages/google-cloud-retail/src/v2alpha/gapic_metadata.json b/packages/google-cloud-retail/src/v2alpha/gapic_metadata.json index 89ef22cebb6..54e5bfd3f59 100644 --- a/packages/google-cloud-retail/src/v2alpha/gapic_metadata.json +++ b/packages/google-cloud-retail/src/v2alpha/gapic_metadata.json @@ -55,6 +55,11 @@ "removeCatalogAttribute" ] }, + "BatchRemoveCatalogAttributes": { + "methods": [ + "batchRemoveCatalogAttributes" + ] + }, "ReplaceCatalogAttribute": { "methods": [ "replaceCatalogAttribute" @@ -117,6 +122,11 @@ "removeCatalogAttribute" ] }, + "BatchRemoveCatalogAttributes": { + "methods": [ + "batchRemoveCatalogAttributes" + ] + }, "ReplaceCatalogAttribute": { "methods": [ "replaceCatalogAttribute" diff --git a/packages/google-cloud-retail/src/v2alpha/model_service_client.ts b/packages/google-cloud-retail/src/v2alpha/model_service_client.ts index 7b82d9b2df3..9ce18c5da3f 100644 --- a/packages/google-cloud-retail/src/v2alpha/model_service_client.ts +++ b/packages/google-cloud-retail/src/v2alpha/model_service_client.ts @@ -44,11 +44,11 @@ const version = require('../../../package.json').version; /** * Service for performing CRUD operations on models. * Recommendation models contain all the metadata necessary to generate a set of - * models for the Predict() api. A model is queried + * models for the `Predict()` API. A model is queried * indirectly via a ServingConfig, which associates a model with a * given Placement (e.g. Frequently Bought Together on Home Page). * - * This service allows customers to e.g.: + * This service allows you to do the following: * * * Initiate training of a model. * * Pause training of an existing model. @@ -137,6 +137,9 @@ export class ModelServiceClient { (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { opts['scopes'] = staticMembers.scopes; @@ -245,6 +248,9 @@ export class ModelServiceClient { selector: 'google.longrunning.Operations.GetOperation', get: '/v2alpha/{name=projects/*/locations/*/catalogs/*/branches/*/operations/*}', additional_bindings: [ + { + get: '/v2alpha/{name=projects/*/locations/*/catalogs/*/branches/*/places/*/operations/*}', + }, { get: '/v2alpha/{name=projects/*/locations/*/catalogs/*/operations/*}', }, @@ -442,7 +448,7 @@ export class ModelServiceClient { * @param {string} request.name * Required. The name of the model to pause. * Format: - * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id} + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -529,7 +535,7 @@ export class ModelServiceClient { * @param {string} request.name * Required. The name of the model to resume. * Format: - * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id} + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -614,9 +620,9 @@ export class ModelServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Required. The resource name of the [Model] to delete. - * Format: - * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id} + * Required. The resource name of the + * {@link google.cloud.retail.v2alpha.Model|Model} to delete. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -697,16 +703,18 @@ export class ModelServiceClient { } /** * Update of model metadata. Only fields that - * currently can be updated are: filtering_option, periodic_tuning_state. - * If other values are provided, this API method will ignore them. + * currently can be updated are: `filtering_option` and + * `periodic_tuning_state`. + * If other values are provided, this API method ignores them. * * @param {Object} request * The request object that will be sent. * @param {google.cloud.retail.v2alpha.Model} request.model - * Required. The body of the updated [Model]. + * Required. The body of the updated + * {@link google.cloud.retail.v2alpha.Model|Model}. * @param {google.protobuf.FieldMask} [request.updateMask] * Optional. Indicates which fields in the provided 'model' to - * update. If not set, will by default update all fields. + * update. If not set, by default updates all fields. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -793,11 +801,12 @@ export class ModelServiceClient { * The request object that will be sent. * @param {string} request.parent * Required. The parent resource under which to create the model. Format: - * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id} + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` * @param {google.cloud.retail.v2alpha.Model} request.model - * Required. The payload of the [Model] to create. + * Required. The payload of the {@link google.cloud.retail.v2alpha.Model|Model} to + * create. * @param {boolean} [request.dryRun] - * Optional. Whether to run a dry_run to validate the request (without + * Optional. Whether to run a dry run to validate the request (without * actually creating the model). * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. @@ -938,7 +947,7 @@ export class ModelServiceClient { * @param {string} request.name * Required. The resource name of the model to tune. * Format: - * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id} + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1078,7 +1087,7 @@ export class ModelServiceClient { * @param {string} request.parent * Required. The parent for which to list models. * Format: - * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id} + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` * @param {number} [request.pageSize] * Optional. Maximum number of results to return. If unspecified, defaults * to 50. Max allowed value is 1000. @@ -1174,7 +1183,7 @@ export class ModelServiceClient { * @param {string} request.parent * Required. The parent for which to list models. * Format: - * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id} + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` * @param {number} [request.pageSize] * Optional. Maximum number of results to return. If unspecified, defaults * to 50. Max allowed value is 1000. @@ -1224,7 +1233,7 @@ export class ModelServiceClient { * @param {string} request.parent * Required. The parent for which to list models. * Format: - * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id} + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` * @param {number} [request.pageSize] * Optional. Maximum number of results to return. If unspecified, defaults * to 50. Max allowed value is 1000. diff --git a/packages/google-cloud-retail/src/v2alpha/prediction_service_client.ts b/packages/google-cloud-retail/src/v2alpha/prediction_service_client.ts index c9007825523..a44e20c60a6 100644 --- a/packages/google-cloud-retail/src/v2alpha/prediction_service_client.ts +++ b/packages/google-cloud-retail/src/v2alpha/prediction_service_client.ts @@ -123,6 +123,9 @@ export class PredictionServiceClient { (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { opts['scopes'] = staticMembers.scopes; @@ -220,6 +223,9 @@ export class PredictionServiceClient { selector: 'google.longrunning.Operations.GetOperation', get: '/v2alpha/{name=projects/*/locations/*/catalogs/*/branches/*/operations/*}', additional_bindings: [ + { + get: '/v2alpha/{name=projects/*/locations/*/catalogs/*/branches/*/places/*/operations/*}', + }, { get: '/v2alpha/{name=projects/*/locations/*/catalogs/*/operations/*}', }, @@ -390,7 +396,7 @@ export class PredictionServiceClient { * The ID of the Recommendations AI serving config or placement. * Before you can request predictions from your model, you must create at * least one serving config or placement for it. For more information, see - * [Managing serving configurations] + * [Manage serving configs] * (https://cloud.google.com/retail/docs/manage-configs). * * The full list of available serving configs can be seen at @@ -411,12 +417,12 @@ export class PredictionServiceClient { * a random unique ID and leave * {@link google.cloud.retail.v2alpha.UserInfo.user_id|UserInfo.user_id} unset. * @param {number} request.pageSize - * Maximum number of results to return per page. Set this property - * to the number of prediction results needed. If zero, the service will - * choose a reasonable default. The maximum allowed value is 100. Values - * above 100 will be coerced to 100. + * Maximum number of results to return. Set this property to the number of + * prediction results needed. If zero, the service will choose a reasonable + * default. The maximum allowed value is 100. Values above 100 will be coerced + * to 100. * @param {string} request.pageToken - * This field is not used for now; leave it unset. + * This field is not used; leave it unset. * @param {string} request.filter * Filter for restricting prediction results with a length limit of 5,000 * characters. Accepts values for tags and the `filterOutOfStockItems` flag. @@ -441,12 +447,11 @@ export class PredictionServiceClient { * * filterOutOfStockItems tag=(-"promotional") * * filterOutOfStockItems * - * If your filter blocks all prediction results, the API will return generic - * (unfiltered) popular products. If you only want results strictly matching - * the filters, set `strictFiltering` to True in `PredictRequest.params` to - * receive empty results instead. - * Note that the API will never return items with storageStatus of "EXPIRED" - * or "DELETED" regardless of filter choices. + * If your filter blocks all prediction results, the API will return *no* + * results. If instead you want empty result sets to return generic + * (unfiltered) popular products, set `strictFiltering` to False in + * `PredictRequest.params`. Note that the API will never return items with + * storageStatus of "EXPIRED" or "DELETED" regardless of filter choices. * * If `filterSyntaxV2` is set to true under the `params` field, then * attribute-based expressions are expected instead of the above described @@ -471,7 +476,7 @@ export class PredictionServiceClient { * * `returnScore`: Boolean. If set to true, the prediction 'score' * corresponding to each returned product will be set in the * `results.metadata` field in the prediction response. The given - * 'score' indicates the probability of an product being clicked/purchased + * 'score' indicates the probability of a product being clicked/purchased * given the user's context and history. * * `strictFiltering`: Boolean. True by default. If set to false, the service * will return generic (unfiltered) popular products instead of empty if diff --git a/packages/google-cloud-retail/src/v2alpha/product_service_client.ts b/packages/google-cloud-retail/src/v2alpha/product_service_client.ts index 723bc9e25a3..d93df14e308 100644 --- a/packages/google-cloud-retail/src/v2alpha/product_service_client.ts +++ b/packages/google-cloud-retail/src/v2alpha/product_service_client.ts @@ -127,6 +127,9 @@ export class ProductServiceClient { (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { opts['scopes'] = staticMembers.scopes; @@ -238,6 +241,9 @@ export class ProductServiceClient { selector: 'google.longrunning.Operations.GetOperation', get: '/v2alpha/{name=projects/*/locations/*/catalogs/*/branches/*/operations/*}', additional_bindings: [ + { + get: '/v2alpha/{name=projects/*/locations/*/catalogs/*/branches/*/places/*/operations/*}', + }, { get: '/v2alpha/{name=projects/*/locations/*/catalogs/*/operations/*}', }, @@ -1154,31 +1160,26 @@ export class ProductServiceClient { * @param {google.cloud.retail.v2alpha.ImportErrorsConfig} request.errorsConfig * The desired location of errors incurred during the Import. * @param {google.protobuf.FieldMask} request.updateMask - * Indicates which fields in the provided imported 'products' to update. If - * not set, will by default update all fields. + * Indicates which fields in the provided imported `products` to update. If + * not set, all fields are updated. * @param {google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode} request.reconciliationMode * The mode of reconciliation between existing products and the products to be * imported. Defaults to * {@link google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode.INCREMENTAL|ReconciliationMode.INCREMENTAL}. * @param {string} request.notificationPubsubTopic * Full Pub/Sub topic name for receiving notification. If this field is set, - * when the import is finished, a notification will be sent to - * specified Pub/Sub topic. The message data will be JSON string of a + * when the import is finished, a notification is sent to + * specified Pub/Sub topic. The message data is JSON string of a * {@link google.longrunning.Operation|Operation}. * * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. It has * to be within the same project as * {@link google.cloud.retail.v2alpha.ImportProductsRequest.parent|ImportProductsRequest.parent}. - * Make sure that both - * `cloud-retail-customer-data-access@system.gserviceaccount.com` and - * `service-@gcp-sa-retail.iam.gserviceaccount.com` - * have the `pubsub.topics.publish` IAM permission on the topic. - * - * Only supported when - * {@link google.cloud.retail.v2alpha.ImportProductsRequest.reconciliation_mode|ImportProductsRequest.reconciliation_mode} - * is set to `FULL`. + * Make sure that `service-@gcp-sa-retail.iam.gserviceaccount.com` has the + * `pubsub.topics.publish` IAM permission on the topic. * @param {boolean} request.skipDefaultBranchProtection - * If true, will perform the FULL import even if it would delete a large + * If true, this performs the FULL import even if it would delete a large * proportion of the products in the default branch, which could potentially * cause outages if you have live predict/search traffic. * @@ -1323,9 +1324,9 @@ export class ProductServiceClient { * * This process is asynchronous and does not require the * {@link google.cloud.retail.v2alpha.Product|Product} to exist before updating - * fulfillment information. If the request is valid, the update will be - * enqueued and processed downstream. As a consequence, when a response is - * returned, updates are not immediately manifested in the + * fulfillment information. If the request is valid, the update is enqueued + * and processed downstream. As a consequence, when a response is returned, + * updates are not immediately manifested in the * {@link google.cloud.retail.v2alpha.Product|Product} queried by * {@link google.cloud.retail.v2alpha.ProductService.GetProduct|ProductService.GetProduct} * or @@ -1335,10 +1336,10 @@ export class ProductServiceClient { * {@link google.cloud.retail.v2alpha.ProductService.CreateProduct|ProductService.CreateProduct} * and * {@link google.cloud.retail.v2alpha.ProductService.UpdateProduct|ProductService.UpdateProduct}, - * the specified inventory field value(s) will overwrite any existing value(s) + * the specified inventory field value(s) overwrite any existing value(s) * while ignoring the last update time for this field. Furthermore, the last - * update time for the specified inventory fields will be overwritten to the - * time of the + * update times for the specified inventory fields are overwritten by the + * times of the * {@link google.cloud.retail.v2alpha.ProductService.CreateProduct|ProductService.CreateProduct} * or * {@link google.cloud.retail.v2alpha.ProductService.UpdateProduct|ProductService.UpdateProduct} @@ -1346,11 +1347,11 @@ export class ProductServiceClient { * * If no inventory fields are set in * {@link google.cloud.retail.v2alpha.CreateProductRequest.product|CreateProductRequest.product}, - * then any pre-existing inventory information for this product will be used. + * then any pre-existing inventory information for this product is used. * * If no inventory fields are set in * {@link google.cloud.retail.v2alpha.SetInventoryRequest.set_mask|SetInventoryRequest.set_mask}, - * then any existing inventory information will be preserved. + * then any existing inventory information is preserved. * * Pre-existing inventory information can only be updated with * {@link google.cloud.retail.v2alpha.ProductService.SetInventory|ProductService.SetInventory}, @@ -1358,8 +1359,17 @@ export class ProductServiceClient { * and * {@link google.cloud.retail.v2alpha.ProductService.RemoveFulfillmentPlaces|ProductService.RemoveFulfillmentPlaces}. * + * The returned {@link google.longrunning.Operation|Operation}s is obsolete after + * one day, and the {@link google.longrunning.Operations.GetOperation|GetOperation} + * API returns `NOT_FOUND` afterwards. + * + * If conflicting updates are issued, the + * {@link google.longrunning.Operation|Operation}s associated with the stale + * updates are not marked as {@link google.longrunning.Operation.done|done} until + * they are obsolete. + * * This feature is only available for users who have Retail Search enabled. - * Please enable Retail Search on Cloud Console before using this feature. + * Enable Retail Search on Cloud Console before using this feature. * * @param {Object} request * The request object that will be sent. @@ -1586,8 +1596,17 @@ export class ProductServiceClient { * or * {@link google.cloud.retail.v2alpha.ProductService.ListProducts|ProductService.ListProducts}. * + * The returned {@link google.longrunning.Operation|Operation}s will be obsolete + * after 1 day, and {@link google.longrunning.Operations.GetOperation|GetOperation} + * API will return NOT_FOUND afterwards. + * + * If conflicting updates are issued, the + * {@link google.longrunning.Operation|Operation}s associated with the stale + * updates will not be marked as {@link google.longrunning.Operation.done|done} + * until being obsolete. + * * This feature is only available for users who have Retail Search enabled. - * Please enable Retail Search on Cloud Console before using this feature. + * Enable Retail Search on Cloud Console before using this feature. * * @param {Object} request * The request object that will be sent. @@ -1792,8 +1811,17 @@ export class ProductServiceClient { * or * {@link google.cloud.retail.v2alpha.ProductService.ListProducts|ProductService.ListProducts}. * + * The returned {@link google.longrunning.Operation|Operation}s will be obsolete + * after 1 day, and {@link google.longrunning.Operations.GetOperation|GetOperation} + * API will return NOT_FOUND afterwards. + * + * If conflicting updates are issued, the + * {@link google.longrunning.Operation|Operation}s associated with the stale + * updates will not be marked as {@link google.longrunning.Operation.done|done} + * until being obsolete. + * * This feature is only available for users who have Retail Search enabled. - * Please enable Retail Search on Cloud Console before using this feature. + * Enable Retail Search on Cloud Console before using this feature. * * @param {Object} request * The request object that will be sent. @@ -2004,8 +2032,17 @@ export class ProductServiceClient { * {@link google.cloud.retail.v2alpha.ProductService.UpdateProduct|ProductService.UpdateProduct} * has no effect on local inventories. * + * The returned {@link google.longrunning.Operation|Operation}s will be obsolete + * after 1 day, and {@link google.longrunning.Operations.GetOperation|GetOperation} + * API will return NOT_FOUND afterwards. + * + * If conflicting updates are issued, the + * {@link google.longrunning.Operation|Operation}s associated with the stale + * updates will not be marked as {@link google.longrunning.Operation.done|done} + * until being obsolete. + * * This feature is only available for users who have Retail Search enabled. - * Please enable Retail Search on Cloud Console before using this feature. + * Enable Retail Search on Cloud Console before using this feature. * * @param {Object} request * The request object that will be sent. @@ -2198,8 +2235,17 @@ export class ProductServiceClient { * {@link google.cloud.retail.v2alpha.ProductService.UpdateProduct|ProductService.UpdateProduct} * has no effect on local inventories. * + * The returned {@link google.longrunning.Operation|Operation}s will be obsolete + * after 1 day, and {@link google.longrunning.Operations.GetOperation|GetOperation} + * API will return NOT_FOUND afterwards. + * + * If conflicting updates are issued, the + * {@link google.longrunning.Operation|Operation}s associated with the stale + * updates will not be marked as {@link google.longrunning.Operation.done|done} + * until being obsolete. + * * This feature is only available for users who have Retail Search enabled. - * Please enable Retail Search on Cloud Console before using this feature. + * Enable Retail Search on Cloud Console before using this feature. * * @param {Object} request * The request object that will be sent. diff --git a/packages/google-cloud-retail/src/v2alpha/search_service_client.ts b/packages/google-cloud-retail/src/v2alpha/search_service_client.ts index 1c956ee9538..841ad5976eb 100644 --- a/packages/google-cloud-retail/src/v2alpha/search_service_client.ts +++ b/packages/google-cloud-retail/src/v2alpha/search_service_client.ts @@ -44,7 +44,7 @@ const version = require('../../../package.json').version; * Service for search. * * This feature is only available for users who have Retail Search enabled. - * Please enable Retail Search on Cloud Console before using this feature. + * Enable Retail Search on Cloud Console before using this feature. * @class * @memberof v2alpha */ @@ -128,6 +128,9 @@ export class SearchServiceClient { (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { opts['scopes'] = staticMembers.scopes; @@ -239,6 +242,9 @@ export class SearchServiceClient { selector: 'google.longrunning.Operations.GetOperation', get: '/v2alpha/{name=projects/*/locations/*/catalogs/*/branches/*/operations/*}', additional_bindings: [ + { + get: '/v2alpha/{name=projects/*/locations/*/catalogs/*/branches/*/places/*/operations/*}', + }, { get: '/v2alpha/{name=projects/*/locations/*/catalogs/*/operations/*}', }, @@ -399,7 +405,7 @@ export class SearchServiceClient { * Performs a search. * * This feature is only available for users who have Retail Search enabled. - * Please enable Retail Search on Cloud Console before using this feature. + * Enable Retail Search on Cloud Console before using this feature. * * @param {Object} request * The request object that will be sent. @@ -408,7 +414,7 @@ export class SearchServiceClient { * `projects/* /locations/global/catalogs/default_catalog/servingConfigs/default_serving_config` * or the name of the legacy placement resource, such as * `projects/* /locations/global/catalogs/default_catalog/placements/default_search`. - * This field is used to identify the serving configuration name and the set + * This field is used to identify the serving config name and the set * of models that will be used to make the search. * @param {string} request.branch * The branch resource name, such as @@ -612,7 +618,7 @@ export class SearchServiceClient { * {@link google.cloud.retail.v2alpha.UserEvent.page_categories|UserEvent.page_categories}; * * To represent full path of category, use '>' sign to separate different - * hierarchies. If '>' is part of the category name, please replace it with + * hierarchies. If '>' is part of the category name, replace it with * other character(s). * * Category pages include special pages such as sales or promotions. For @@ -623,6 +629,15 @@ export class SearchServiceClient { * request triggers both product search and faceted search. * @param {google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec} request.personalizationSpec * The specification for personalization. + * + * Notice that if both + * {@link google.cloud.retail.v2alpha.ServingConfig.personalization_spec|ServingConfig.personalization_spec} + * and + * {@link google.cloud.retail.v2alpha.SearchRequest.personalization_spec|SearchRequest.personalization_spec} + * are set. + * {@link google.cloud.retail.v2alpha.SearchRequest.personalization_spec|SearchRequest.personalization_spec} + * will override + * {@link google.cloud.retail.v2alpha.ServingConfig.personalization_spec|ServingConfig.personalization_spec}. * @param {number[]} request.labels * The labels applied to a resource must meet the following requirements: * @@ -733,7 +748,7 @@ export class SearchServiceClient { * `projects/* /locations/global/catalogs/default_catalog/servingConfigs/default_serving_config` * or the name of the legacy placement resource, such as * `projects/* /locations/global/catalogs/default_catalog/placements/default_search`. - * This field is used to identify the serving configuration name and the set + * This field is used to identify the serving config name and the set * of models that will be used to make the search. * @param {string} request.branch * The branch resource name, such as @@ -937,7 +952,7 @@ export class SearchServiceClient { * {@link google.cloud.retail.v2alpha.UserEvent.page_categories|UserEvent.page_categories}; * * To represent full path of category, use '>' sign to separate different - * hierarchies. If '>' is part of the category name, please replace it with + * hierarchies. If '>' is part of the category name, replace it with * other character(s). * * Category pages include special pages such as sales or promotions. For @@ -948,6 +963,15 @@ export class SearchServiceClient { * request triggers both product search and faceted search. * @param {google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec} request.personalizationSpec * The specification for personalization. + * + * Notice that if both + * {@link google.cloud.retail.v2alpha.ServingConfig.personalization_spec|ServingConfig.personalization_spec} + * and + * {@link google.cloud.retail.v2alpha.SearchRequest.personalization_spec|SearchRequest.personalization_spec} + * are set. + * {@link google.cloud.retail.v2alpha.SearchRequest.personalization_spec|SearchRequest.personalization_spec} + * will override + * {@link google.cloud.retail.v2alpha.ServingConfig.personalization_spec|ServingConfig.personalization_spec}. * @param {number[]} request.labels * The labels applied to a resource must meet the following requirements: * @@ -1014,7 +1038,7 @@ export class SearchServiceClient { * `projects/* /locations/global/catalogs/default_catalog/servingConfigs/default_serving_config` * or the name of the legacy placement resource, such as * `projects/* /locations/global/catalogs/default_catalog/placements/default_search`. - * This field is used to identify the serving configuration name and the set + * This field is used to identify the serving config name and the set * of models that will be used to make the search. * @param {string} request.branch * The branch resource name, such as @@ -1218,7 +1242,7 @@ export class SearchServiceClient { * {@link google.cloud.retail.v2alpha.UserEvent.page_categories|UserEvent.page_categories}; * * To represent full path of category, use '>' sign to separate different - * hierarchies. If '>' is part of the category name, please replace it with + * hierarchies. If '>' is part of the category name, replace it with * other character(s). * * Category pages include special pages such as sales or promotions. For @@ -1229,6 +1253,15 @@ export class SearchServiceClient { * request triggers both product search and faceted search. * @param {google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec} request.personalizationSpec * The specification for personalization. + * + * Notice that if both + * {@link google.cloud.retail.v2alpha.ServingConfig.personalization_spec|ServingConfig.personalization_spec} + * and + * {@link google.cloud.retail.v2alpha.SearchRequest.personalization_spec|SearchRequest.personalization_spec} + * are set. + * {@link google.cloud.retail.v2alpha.SearchRequest.personalization_spec|SearchRequest.personalization_spec} + * will override + * {@link google.cloud.retail.v2alpha.ServingConfig.personalization_spec|ServingConfig.personalization_spec}. * @param {number[]} request.labels * The labels applied to a resource must meet the following requirements: * diff --git a/packages/google-cloud-retail/src/v2alpha/serving_config_service_client.ts b/packages/google-cloud-retail/src/v2alpha/serving_config_service_client.ts index ea614bd0bc2..9e32e0c6792 100644 --- a/packages/google-cloud-retail/src/v2alpha/serving_config_service_client.ts +++ b/packages/google-cloud-retail/src/v2alpha/serving_config_service_client.ts @@ -125,6 +125,9 @@ export class ServingConfigServiceClient { (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { opts['scopes'] = staticMembers.scopes; @@ -233,6 +236,9 @@ export class ServingConfigServiceClient { selector: 'google.longrunning.Operations.GetOperation', get: '/v2alpha/{name=projects/*/locations/*/catalogs/*/branches/*/operations/*}', additional_bindings: [ + { + get: '/v2alpha/{name=projects/*/locations/*/catalogs/*/branches/*/places/*/operations/*}', + }, { get: '/v2alpha/{name=projects/*/locations/*/catalogs/*/operations/*}', }, @@ -517,7 +523,7 @@ export class ServingConfigServiceClient { * The request object that will be sent. * @param {string} request.name * Required. The resource name of the ServingConfig to delete. Format: - * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id} + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -722,7 +728,7 @@ export class ServingConfigServiceClient { * The request object that will be sent. * @param {string} request.name * Required. The resource name of the ServingConfig to get. Format: - * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id} + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -820,7 +826,7 @@ export class ServingConfigServiceClient { * The request object that will be sent. * @param {string} request.servingConfig * Required. The source ServingConfig resource name . Format: - * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id} + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` * @param {string} request.controlId * Required. The id of the control to apply. Assumed to be in the same catalog * as the serving config - if id is not found a NOT_FOUND error is returned. @@ -912,7 +918,7 @@ export class ServingConfigServiceClient { * The request object that will be sent. * @param {string} request.servingConfig * Required. The source ServingConfig resource name . Format: - * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id} + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` * @param {string} request.controlId * Required. The id of the control to apply. Assumed to be in the same catalog * as the serving config. @@ -1008,7 +1014,7 @@ export class ServingConfigServiceClient { * The request object that will be sent. * @param {string} request.parent * Required. The catalog resource name. Format: - * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id} + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` * @param {number} [request.pageSize] * Optional. Maximum number of results to return. If unspecified, defaults * to 100. If a value greater than 100 is provided, at most 100 results are @@ -1110,7 +1116,7 @@ export class ServingConfigServiceClient { * The request object that will be sent. * @param {string} request.parent * Required. The catalog resource name. Format: - * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id} + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` * @param {number} [request.pageSize] * Optional. Maximum number of results to return. If unspecified, defaults * to 100. If a value greater than 100 is provided, at most 100 results are @@ -1160,7 +1166,7 @@ export class ServingConfigServiceClient { * The request object that will be sent. * @param {string} request.parent * Required. The catalog resource name. Format: - * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id} + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` * @param {number} [request.pageSize] * Optional. Maximum number of results to return. If unspecified, defaults * to 100. If a value greater than 100 is provided, at most 100 results are diff --git a/packages/google-cloud-retail/src/v2alpha/user_event_service_client.ts b/packages/google-cloud-retail/src/v2alpha/user_event_service_client.ts index 43ed8a39f08..ceae78b88c4 100644 --- a/packages/google-cloud-retail/src/v2alpha/user_event_service_client.ts +++ b/packages/google-cloud-retail/src/v2alpha/user_event_service_client.ts @@ -124,6 +124,9 @@ export class UserEventServiceClient { (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { opts['scopes'] = staticMembers.scopes; @@ -221,6 +224,9 @@ export class UserEventServiceClient { selector: 'google.longrunning.Operations.GetOperation', get: '/v2alpha/{name=projects/*/locations/*/catalogs/*/branches/*/operations/*}', additional_bindings: [ + { + get: '/v2alpha/{name=projects/*/locations/*/catalogs/*/branches/*/places/*/operations/*}', + }, { get: '/v2alpha/{name=projects/*/locations/*/catalogs/*/operations/*}', }, @@ -426,6 +432,11 @@ export class UserEventServiceClient { * `projects/1234/locations/global/catalogs/default_catalog`. * @param {google.cloud.retail.v2alpha.UserEvent} request.userEvent * Required. User event to write. + * @param {boolean} request.writeAsync + * If set to true, the user event will be written asynchronously after + * validation, and the API will respond without waiting for the write. + * Therefore, silent failures can occur even if the API returns success. In + * case of silent failures, error messages can be found in Stackdriver logs. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -519,6 +530,9 @@ export class UserEventServiceClient { * * @param {Object} request * The request object that will be sent. + * @param {string} request.prebuiltRule + * The prebuilt rule name that can convert a specific type of raw_json. + * For example: "default_schema/v1.0" * @param {string} request.parent * Required. The parent catalog name, such as * `projects/1234/locations/global/catalogs/default_catalog`. @@ -534,6 +548,11 @@ export class UserEventServiceClient { * The event timestamp in milliseconds. This prevents browser caching of * otherwise identical get requests. The name is abbreviated to reduce the * payload bytes. + * @param {string} request.rawJson + * An arbitrary serialized JSON string that contains necessary information + * that can comprise a user event. When this field is specified, the + * user_event field will be ignored. Note: line-delimited JSON is not + * supported, a single JSON only. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -796,9 +815,9 @@ export class UserEventServiceClient { * 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 + * `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. + * `Operation.metadata` is of type `ImportMetadata`. * * @param {Object} request * The request object that will be sent. @@ -941,14 +960,14 @@ export class UserEventServiceClient { >; } /** - * Starts a user event rejoin operation with latest product catalog. Events - * will not be annotated with detailed product information if product is - * missing from the catalog at the time the user event is ingested, and these - * events are stored as unjoined events with a limited usage on training and - * serving. This method can be used to start a join operation on specified - * events with latest version of product catalog. It can also be used to - * correct events joined with the wrong product catalog. A rejoin operation - * can take hours or days to complete. + * Starts a user-event rejoin operation with latest product catalog. Events + * are not annotated with detailed product information for products that are + * missing from the catalog when the user event is ingested. These + * events are stored as unjoined events with limited usage on training and + * serving. You can use this method to start a join operation on specified + * events with the latest version of product catalog. You can also use this + * method to correct events joined with the wrong product catalog. A rejoin + * operation can take hours or days to complete. * * @param {Object} request * The request object that will be sent. @@ -958,8 +977,8 @@ export class UserEventServiceClient { * @param {google.cloud.retail.v2alpha.RejoinUserEventsRequest.UserEventRejoinScope} request.userEventRejoinScope * The type of the user event rejoin to define the scope and range of the user * events to be rejoined with the latest product catalog. Defaults to - * USER_EVENT_REJOIN_SCOPE_UNSPECIFIED if this field is not set, or set to an - * invalid integer value. + * `USER_EVENT_REJOIN_SCOPE_UNSPECIFIED` if this field is not set, or set to + * an invalid integer value. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. diff --git a/packages/google-cloud-retail/src/v2beta/catalog_service_client.ts b/packages/google-cloud-retail/src/v2beta/catalog_service_client.ts index 16126450947..717dcd1eade 100644 --- a/packages/google-cloud-retail/src/v2beta/catalog_service_client.ts +++ b/packages/google-cloud-retail/src/v2beta/catalog_service_client.ts @@ -125,6 +125,9 @@ export class CatalogServiceClient { (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { opts['scopes'] = staticMembers.scopes; diff --git a/packages/google-cloud-retail/src/v2beta/completion_service_client.ts b/packages/google-cloud-retail/src/v2beta/completion_service_client.ts index 52182c21368..7385245634a 100644 --- a/packages/google-cloud-retail/src/v2beta/completion_service_client.ts +++ b/packages/google-cloud-retail/src/v2beta/completion_service_client.ts @@ -127,6 +127,9 @@ export class CompletionServiceClient { (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { opts['scopes'] = staticMembers.scopes; diff --git a/packages/google-cloud-retail/src/v2beta/control_service_client.ts b/packages/google-cloud-retail/src/v2beta/control_service_client.ts index 603bd5bb1b4..25f499e335c 100644 --- a/packages/google-cloud-retail/src/v2beta/control_service_client.ts +++ b/packages/google-cloud-retail/src/v2beta/control_service_client.ts @@ -125,6 +125,9 @@ export class ControlServiceClient { (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { opts['scopes'] = staticMembers.scopes; diff --git a/packages/google-cloud-retail/src/v2beta/model_service_client.ts b/packages/google-cloud-retail/src/v2beta/model_service_client.ts index 210906d3140..3f159ce4aff 100644 --- a/packages/google-cloud-retail/src/v2beta/model_service_client.ts +++ b/packages/google-cloud-retail/src/v2beta/model_service_client.ts @@ -137,6 +137,9 @@ export class ModelServiceClient { (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { opts['scopes'] = staticMembers.scopes; diff --git a/packages/google-cloud-retail/src/v2beta/prediction_service_client.ts b/packages/google-cloud-retail/src/v2beta/prediction_service_client.ts index c2ad7f54fe2..2ae86c042c5 100644 --- a/packages/google-cloud-retail/src/v2beta/prediction_service_client.ts +++ b/packages/google-cloud-retail/src/v2beta/prediction_service_client.ts @@ -123,6 +123,9 @@ export class PredictionServiceClient { (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { opts['scopes'] = staticMembers.scopes; diff --git a/packages/google-cloud-retail/src/v2beta/product_service_client.ts b/packages/google-cloud-retail/src/v2beta/product_service_client.ts index 2ac7ca4c4df..7a090f50262 100644 --- a/packages/google-cloud-retail/src/v2beta/product_service_client.ts +++ b/packages/google-cloud-retail/src/v2beta/product_service_client.ts @@ -127,6 +127,9 @@ export class ProductServiceClient { (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { opts['scopes'] = staticMembers.scopes; diff --git a/packages/google-cloud-retail/src/v2beta/search_service_client.ts b/packages/google-cloud-retail/src/v2beta/search_service_client.ts index ea996eaeafc..29fc5edeecd 100644 --- a/packages/google-cloud-retail/src/v2beta/search_service_client.ts +++ b/packages/google-cloud-retail/src/v2beta/search_service_client.ts @@ -128,6 +128,9 @@ export class SearchServiceClient { (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { opts['scopes'] = staticMembers.scopes; diff --git a/packages/google-cloud-retail/src/v2beta/serving_config_service_client.ts b/packages/google-cloud-retail/src/v2beta/serving_config_service_client.ts index 144ddd5906e..27a06a8c04d 100644 --- a/packages/google-cloud-retail/src/v2beta/serving_config_service_client.ts +++ b/packages/google-cloud-retail/src/v2beta/serving_config_service_client.ts @@ -125,6 +125,9 @@ export class ServingConfigServiceClient { (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { opts['scopes'] = staticMembers.scopes; diff --git a/packages/google-cloud-retail/src/v2beta/user_event_service_client.ts b/packages/google-cloud-retail/src/v2beta/user_event_service_client.ts index 994a7f011f8..7cebffb33f3 100644 --- a/packages/google-cloud-retail/src/v2beta/user_event_service_client.ts +++ b/packages/google-cloud-retail/src/v2beta/user_event_service_client.ts @@ -124,6 +124,9 @@ export class UserEventServiceClient { (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { opts['scopes'] = staticMembers.scopes; diff --git a/packages/google-cloud-retail/test/gapic_catalog_service_v2alpha.ts b/packages/google-cloud-retail/test/gapic_catalog_service_v2alpha.ts index 64ae0b5c311..3b4cf595db3 100644 --- a/packages/google-cloud-retail/test/gapic_catalog_service_v2alpha.ts +++ b/packages/google-cloud-retail/test/gapic_catalog_service_v2alpha.ts @@ -1433,6 +1433,143 @@ describe('v2alpha.CatalogServiceClient', () => { }); }); + describe('batchRemoveCatalogAttributes', () => { + it('invokes batchRemoveCatalogAttributes without error', async () => { + const client = new catalogserviceModule.v2alpha.CatalogServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest', + ['attributesConfig'] + ); + request.attributesConfig = defaultValue1; + const expectedHeaderRequestParams = `attributes_config=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse() + ); + client.innerApiCalls.batchRemoveCatalogAttributes = + stubSimpleCall(expectedResponse); + const [response] = await client.batchRemoveCatalogAttributes(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.batchRemoveCatalogAttributes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchRemoveCatalogAttributes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchRemoveCatalogAttributes without error using callback', async () => { + const client = new catalogserviceModule.v2alpha.CatalogServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest', + ['attributesConfig'] + ); + request.attributesConfig = defaultValue1; + const expectedHeaderRequestParams = `attributes_config=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse() + ); + client.innerApiCalls.batchRemoveCatalogAttributes = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchRemoveCatalogAttributes( + request, + ( + err?: Error | null, + result?: protos.google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.batchRemoveCatalogAttributes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchRemoveCatalogAttributes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchRemoveCatalogAttributes with error', async () => { + const client = new catalogserviceModule.v2alpha.CatalogServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest', + ['attributesConfig'] + ); + request.attributesConfig = defaultValue1; + const expectedHeaderRequestParams = `attributes_config=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchRemoveCatalogAttributes = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.batchRemoveCatalogAttributes(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.batchRemoveCatalogAttributes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchRemoveCatalogAttributes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchRemoveCatalogAttributes with closed client', async () => { + const client = new catalogserviceModule.v2alpha.CatalogServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest', + ['attributesConfig'] + ); + request.attributesConfig = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.batchRemoveCatalogAttributes(request), + expectedError + ); + }); + }); + describe('replaceCatalogAttribute', () => { it('invokes replaceCatalogAttribute without error', async () => { const client = new catalogserviceModule.v2alpha.CatalogServiceClient({